Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

24 high level upload vulnerability of DVWA series

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Finally, let's analyze the code at the high level:

First of all, there is a sentence to understand:

$uploaded_ext = substr ($uploaded_name, strrpos ($uploaded_name,'.) + 1)

In this statement, we first use the strrpos () function to find "." The position that appears in the variable $uploaded_name, then increments the resulting value by 1, and finally uses the substr () function to intercept part of the string from the specified position of the variable $uploaded_name.

In short, the purpose of this statement is to truncate the extension from the file name we uploaded.

Then use the if statement to determine whether the extension is uppercase or lowercase jpg/jpeg, if not, upload is not allowed, so here is the definition of a whitelist, which is also a high security defense.

Finally, if you want to exploit upload vulnerabilities, you can search the web page code for $_ FILES, the variable used to receive uploaded files, or move_uploaded_file, the function used to perform upload operations, and then analyze whether filtering measures have been taken.

As a mainstream method of upload vulnerabilities, the forms of upload vulnerabilities are very diverse. As far as this upload vulnerability in DVWA is concerned, defining whitelist is a good defense method.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report