DVWA Series 9 High level command execution vulnerability

Source: Internet
Author: User

Switch DVWA security to the high level and view the Web page source in command execution.

650) this.width=650; "Style=" background-image:none;border-bottom:0px;border-left:0px;padding-left:0px; padding-right:0px;border-top:0px;border-right:0px;padding-top:0px; "title=" image "border=" 0 "alt=" image "src=" http ://s3.51cto.com/wyfs02/m01/77/79/wkiom1zo1ots0bawaaf3wpnflhg094.png "height=" 420 "/>

Here the first is to use the Stripslashes function to obtain the IP address is processed, mainly to remove the added slash after escaping, the reason has been explained before, because the high level will automatically enable PHP MAGIC_QUOTES_GPC magic Quotes, All value data is automatically escaped with the Addslashes () function, so it needs to be removed with the stripslashes () function.

The explode function is then used to "." Divide the IP address of the $target variable into a delimiter, and then you will get an array and assign a value to the variable $octet.

Next use the IF statement, using the Is_numeric function to determine whether each value in the $octet array is a numeric data, and also use the sizeof function to determine whether the number of elements in the $octet array is 4. This judgment condition is very harsh, basically can ensure that the user input must be the correct IP address, the previous use of all the command execution vulnerability will not be effective.

But the problem here is also obvious, this filtering method only for the command parameter is the IP address of the situation to function, if we want to execute the other system command, this method will not work.

So is there a generic command to enforce the vulnerability defense method? The method of course has, in the next blog will be on this part of the content analysis.

This article from "a pot of turbid wine" blog, reproduced please contact the author!

DVWA Series 9 High level command execution vulnerability

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.