File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 8
8
class MetasploitModule < Msf ::Auxiliary
9
9
10
10
include Msf ::Exploit ::Remote ::HttpClient
11
+ include Msf ::Auxiliary ::Scanner
11
12
12
13
def initialize ( info = { } )
13
14
super ( update_info ( info ,
@@ -24,16 +25,16 @@ def initialize(info = {})
24
25
25
26
register_options ( [
26
27
Opt ::RPORT ( 8008 )
27
- ] , self . class )
28
+ ] )
28
29
end
29
30
30
- def run
31
+ def run_host ( ip )
31
32
res = scan
32
33
33
34
return unless res && res . code == 200
34
35
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 } " ,
37
38
'Columns' => [
38
39
'BSSID' ,
39
40
'PWR' ,
@@ -46,7 +47,7 @@ def run
46
47
)
47
48
48
49
JSON . parse ( res . body ) . each do |wap |
49
- waps << [
50
+ waps_table << [
50
51
wap [ 'bssid' ] ,
51
52
wap [ 'signal_level' ] ,
52
53
enc ( wap ) ,
@@ -56,15 +57,16 @@ def run
56
57
]
57
58
end
58
59
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
68
70
end
69
71
70
72
def scan
You can’t perform that action at this time.
0 commit comments