Skip to content

Commit cddf72c

Browse files
author
HD Moore
committed
Show errors when no results are found
1 parent ec3aecb commit cddf72c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/auxiliary/gather/shodan_search.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ def run
112112
results[page] = shodan_query(query, apikey, page)
113113

114114
if results[page]['total'].nil? || results[page]['total'] == 0
115-
print_error('No Results Found!')
115+
msg = "No results."
116+
if results[page]['error'].to_s.length > 0
117+
msg << " Error: #{results[page]['error']}"
118+
end
119+
print_error(msg)
120+
return
116121
end
117122

118123
# Determine page count based on total results

0 commit comments

Comments
 (0)