File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
modules/auxiliary/admin/huawei Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -207,27 +207,18 @@ def get_router_ssid
207
207
} )
208
208
209
209
#check whether we got any response from server and proceed.
210
- unless res
211
- print_error ( 'Failed to get any response from server!!!' )
212
- return
213
- end
214
-
215
- #Is it a HTTP OK
216
- unless res . code == 200
217
- print_error ( 'Did not get HTTP 200, URL was not found. Exiting!' )
218
- return
210
+ unless is_target? ( res )
211
+ return nil
219
212
end
220
213
221
- #Check to verify server reported is a Huawei router
222
- unless res . headers [ 'Server' ] . match ( /IPWEBS\/ 1.4.0/i )
223
- print_error ( 'Target doesn\'t seem to be a Huawei router. Exiting!' )
224
- return
225
- end
214
+ resp_body = res . body . to_s
226
215
227
216
# Grabbing the Wifi SSID
228
- if res . body . match ( /<WifiSsid>(.*)<\/ WifiSsid>/i )
217
+ if resp_body . match ( /<WifiSsid>(.*)<\/ WifiSsid>/i )
229
218
return $1
230
219
end
220
+
221
+ nil
231
222
end
232
223
233
224
def get_router_mac_filter_info
You can’t perform that action at this time.
0 commit comments