DVWA Series 8 medium-level Command Execution Vulnerability

Source: Internet
Author: User

DVWA Series 8 medium-level Command Execution Vulnerability

Set DVWA Security to medium, and click "View Source" in Command Execution to View the webpage Source code.

Here, the variable $ target used to receive the IP address entered by the user is filtered. The filtering method is to define a blacklist.
$ Substitutions = array ('&' => '', ';' => '',);
This line of statements defines an array and assigns it to the variable $ substitutions. The array contains two keys: & and;, and their corresponding values are NULL.
$ Target = str_replace (array_keys ($ substitutions), $ substitutions, $ target );
This line of statements replaces the characters in the $ target variable with the str_replace function by replacing array_keys ($ substitutions) with $ substitutions, that is, replace & and; both are replaced with null values.
Anyone who knows a little about network security knows that the blacklist is unreliable, because there are inevitable omissions in the blacklist, which provides an opportunity for hackers to bypass. As defined here, the blacklist only includes the & and; symbols. Through the analysis of the previous blog, we know that there are too many methods to bypass, for example, "|", "|", and ">. Therefore, the medium-level command execution vulnerability is actually very simple.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.