Skip to content

Commit

Permalink
Add the ability to whitelist a specific vulnerability in Shodan Monit…
Browse files Browse the repository at this point in the history
…or instead of whitelisting the while IP:port
  • Loading branch information
achillean committed Jul 9, 2022
1 parent f181eae commit 7d043d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGELOG
=========

1.28.0
------
* Add the ability to whitelist a specific vulnerability in Shodan Monitor instead of whitelisting the while IP:port
* Show scan ID when scanning without showing results (credit to @seadog007)
* Handle bad gateway errors (credit to @yaron-cider)


1.27.0
------
* New command: ``shodan alert export`` to save the current network monitoring configuration
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='shodan',
version='1.27.0',
version='1.28.0',
description='Python library and command-line utility for Shodan (https://developer.shodan.io)',
long_description=README,
long_description_content_type='text/x-rst',
Expand Down
8 changes: 7 additions & 1 deletion shodan/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,14 @@ def disable_alert_trigger(self, aid, trigger):
"""Disable the given trigger on the alert."""
return self._request('/shodan/alert/{}/trigger/{}'.format(aid, trigger), {}, method='delete')

def ignore_alert_trigger_notification(self, aid, trigger, ip, port):
def ignore_alert_trigger_notification(self, aid, trigger, ip, port, vulns=None):
"""Ignore trigger notifications for the provided IP and port."""
# The "vulnerable" and "vulnerable_unverified" triggers let you specify specific vulnerabilities
# to ignore. If a user provides a "vulns" list and specifies on of those triggers then we'll use
# a different API endpoint.
if trigger in ('vulnerable', 'vulnerable_unverified') and vulns and isinstance(vulns, list):
return self._request('/shodan/alert/{}/trigger/{}/ignore/{}:{}/{}'.format(aid, trigger, ip, port, ','.join(vulns)), {}, method='put')

return self._request('/shodan/alert/{}/trigger/{}/ignore/{}:{}'.format(aid, trigger, ip, port), {}, method='put')

def unignore_alert_trigger_notification(self, aid, trigger, ip, port):
Expand Down

0 comments on commit 7d043d7

Please sign in to comment.