Skip to content

Commit

Permalink
Total counting
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnim committed Oct 3, 2023
1 parent 9d026b2 commit 5d44a3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/shodan/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def process(command, channel, username, params, files, conn):
if 'error' in json_response:
error = json_response['error']
return {'messages': [{'text': 'An error occurred, wrong/missing API key? Error: ' + error}]}
if 'matches' in json_response:
total = len(json_response['matches'])
if 'total' in json_response:
total = len(json_response['total'])
if total>0:
text += ', result(s): `' + str(total) + '`:\n'
if 'facets' in json_response:
Expand Down Expand Up @@ -338,7 +338,7 @@ def process(command, channel, username, params, files, conn):
if 'matches' in json_response:
matches = json_response['matches']
if len(matches) and page==1 and not table_header_displayed:
total = len(json_response['matches'])
total = len(json_response['total'])
text += '\nReturning up to 10 matches from the first page only; download the JSON file(s) for all ' + str(total) + ' result(s):'
text += '\n\n'
text += '| IP Address | Hostname(s) | Service | Port | Proto | Vulns | SSL/TLS | Product | Banner |\n'
Expand Down

0 comments on commit 5d44a3e

Please sign in to comment.