Skip to content

Commit 23c9d4f

Browse files
committed
Do final cleanup
1 parent 05e803f commit 23c9d4f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

modules/auxiliary/admin/huawei/huawei_wifi_info.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ def run
9393
get_router_dhcp_info
9494
print_line('')
9595
get_wifi_info
96-
print_line('')
9796
end
9897

9998
def get_wifi_info
10099

101-
print_status('Now trying to get WiFi Key details...')
100+
print_status("#{peer} - Getting WiFi Key details...")
102101
res = send_request_raw(
103102
{
104103
'method' => 'GET',
@@ -112,7 +111,7 @@ def get_wifi_info
112111
resp_body = res.body.to_s
113112
log = ''
114113

115-
print_status('WiFi Key Details')
114+
print_status("WiFi Key Details")
116115

117116
wifi_ssid = get_router_ssid
118117
if wifi_ssid
@@ -137,7 +136,7 @@ def get_wifi_info
137136

138137
def get_router_info
139138

140-
print_status("Attempting to connect to #{rhost} to gather basic device information...")
139+
print_status("#{peer} - Gathering basic device information...")
141140
res = send_request_raw(
142141
{
143142
'method' => 'GET',
@@ -161,6 +160,8 @@ def get_router_info
161160
end
162161

163162
def get_router_ssid
163+
print_status("#{peer} - Gathering device SSID...")
164+
164165
res = send_request_raw(
165166
{
166167
'method' => 'GET',
@@ -183,6 +184,7 @@ def get_router_ssid
183184
end
184185

185186
def get_router_mac_filter_info
187+
print_status("#{peer} - Gathering MAC filters...")
186188
res = send_request_raw(
187189
{
188190
'method' => 'GET',
@@ -213,6 +215,7 @@ def get_router_mac_filter_info
213215
end
214216

215217
def get_router_wan_info
218+
print_status("#{peer} - Gathering WAN information...")
216219
res = send_request_raw(
217220
{
218221
'method' => 'GET',
@@ -236,7 +239,7 @@ def get_router_wan_info
236239
end
237240

238241
def get_router_dhcp_info
239-
242+
print_status("#{peer} - Gathering DHCP information...")
240243
res = send_request_raw(
241244
{
242245
'method' => 'GET',
@@ -272,19 +275,19 @@ def get_router_dhcp_info
272275
def is_target?(res)
273276
#check whether we got any response from server and proceed.
274277
unless res
275-
print_error('Failed to get any response from server.')
278+
print_error("#{peer} - Failed to get any response from server")
276279
return false
277280
end
278281

279282
#Is it a HTTP OK
280283
unless res.code == 200
281-
print_error('Did not get HTTP 200, URL was not found.')
284+
print_error("#{peer} - Did not get HTTP 200, URL was not found")
282285
return false
283286
end
284287

285288
#Check to verify server reported is a Huawei router
286289
unless res.headers['Server'].match(/IPWEBS\/1.4.0/i)
287-
print_error('Target doesn\'t seem to be a Huawei router')
290+
print_error("#{peer} - Target doesn't seem to be a Huawei router")
288291
return false
289292
end
290293

0 commit comments

Comments
 (0)