Skip to content

Commit 0e66ca1

Browse files
committed
Fix rapid7#3444/rapid7#4774, get_json_document over JSON.parse
Forgot to update these when I wrote new modules.
1 parent 5de190f commit 0e66ca1

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

modules/auxiliary/scanner/http/chromecast_webserver.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ def run_host(ip)
3737

3838
return unless (res && res.code == 200)
3939

40-
begin
41-
json = JSON.parse(res.body)
42-
rescue JSON::ParserError
43-
return
44-
end
45-
40+
json = res.get_json_document
4641
name, ssid = json['name'], json['ssid']
4742

4843
if name && ssid

modules/auxiliary/scanner/http/chromecast_wifi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_host(ip)
4343
'SortIndex' => -1
4444
)
4545

46-
JSON.parse(res.body).each do |wap|
46+
res.get_json_document.each do |wap|
4747
waps_table << [
4848
wap['bssid'],
4949
wap['signal_level'],

0 commit comments

Comments
 (0)