Skip to content

Commit 60e602c

Browse files
committed
Update chromecast wifi gather module to use Scanner for scanning in bulk
1 parent f50fa51 commit 60e602c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

modules/auxiliary/gather/chromecast_wifi.rb

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
class MetasploitModule < Msf::Auxiliary
99

1010
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Auxiliary::Scanner
1112

1213
def initialize(info = {})
1314
super(update_info(info,
@@ -24,16 +25,16 @@ def initialize(info = {})
2425

2526
register_options([
2627
Opt::RPORT(8008)
27-
], self.class)
28+
])
2829
end
2930

30-
def run
31+
def run_host(ip)
3132
res = scan
3233

3334
return unless res && res.code == 200
3435

35-
waps = Rex::Text::Table.new(
36-
'Header' => 'Wireless Access Points',
36+
waps_table = Rex::Text::Table.new(
37+
'Header' => "Wireless Access Points from #{rhost}",
3738
'Columns' => [
3839
'BSSID',
3940
'PWR',
@@ -46,7 +47,7 @@ def run
4647
)
4748

4849
JSON.parse(res.body).each do |wap|
49-
waps << [
50+
waps_table << [
5051
wap['bssid'],
5152
wap['signal_level'],
5253
enc(wap),
@@ -56,15 +57,16 @@ def run
5657
]
5758
end
5859

59-
print_line(waps.to_s)
60-
61-
report_note(
62-
:host => rhost,
63-
:port => rport,
64-
:proto => 'tcp',
65-
:type => 'chromecast.wifi',
66-
:data => waps.to_csv
67-
)
60+
unless waps_table.rows.empty?
61+
print_line(waps_table.to_s)
62+
report_note(
63+
:host => rhost,
64+
:port => rport,
65+
:proto => 'tcp',
66+
:type => 'chromecast.wifi',
67+
:data => waps_table.to_csv
68+
)
69+
end
6870
end
6971

7072
def scan

0 commit comments

Comments
 (0)