Windows Website security dog upload interception bypass

Source: Internet
Author: User

Windows Website security dog upload interception bypass

Website security dog's upload interception on win bypasses

Upload code:

<?phpif(isset($_POST['submit'])){$upfile = $_FILES['file']['name'];$tempfile = $_FILES['file']['tmp_name'];$ext = trim(get_extension($upfile)); //var_dump($ext);if(in_array($ext,array('php','php3','php5','asp','asa','cer','cdx','aspx','htaccess'))){die('Warning ! File type error..');}$savefile = $upfile;if(move_uploaded_file($tempfile,$savefile)){die('Success upload. FileName: '.$savefile);}else{die('Upload failed..');}}function get_extension($file){return strtolower(substr($file, strrpos($file, '.')+1));}?>



When the uploaded file extension contains some special characters (such as bypass. php? X, here X represents space % 20 or other special characters {% 80-% 99}). the dongle intercepts the file extension phpX and judges it as a legal file, so the upload is successful.

However, using the file name feature of windows, the existing file name is bypass. php and can be parsed.

 

Submit a bypass. phpX. The hex of X is \ x90.
 


 

 

Solution:

Filter extensions containing special characters

Related Article

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.