Skip to content

Commit 005c36b

Browse files
committed
If data is empty, don't save (or even continue)
1 parent c41c7a1 commit 005c36b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/auxiliary/scanner/http/influxdb_enum.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ def run
5454
print_error("#{peer} - Failed to authenticate. Invalid username/password.")
5555
return
5656
elsif res.code == 200 && res.headers.include?('X-Influxdb-Version') && res.body.length > 0
57-
print_status('Enumerating...')
57+
print_status("#{peer} - Enumerating...")
5858
begin
5959
temp = JSON.parse(res.body)
60+
if temp.blank?
61+
print_status("#{peer} - Json data is empty")
62+
return
63+
end
6064
results = JSON.pretty_generate(temp)
6165
rescue JSON::ParserError
62-
print_error('Unable to parse JSON data.')
66+
print_error("#{peer} - Unable to parse JSON data.")
6367
return
6468
end
6569
print_good("Found:\n\n#{results}\n")

0 commit comments

Comments
 (0)