Get the App
SLTechnology News&Howtos  ›  Network Security  › 

24 high level upload vulnerability of DVWA series

Shulou Source: shulou.com Published: 2022-06-01 04:15:46 10月06日 Update

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.

Tags: Statements vulnerabilities functions variables codes locations lists that is extensions measures files methods parts analysis search defense level good security next Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Docker Shulou Technology Xiaomi Shulou Information