Skip to content

Commit 7d043d7

Browse files
committed
Add the ability to whitelist a specific vulnerability in Shodan Monitor instead of whitelisting the while IP:port
1 parent f181eae commit 7d043d7

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
1.28.0
5+
------
6+
* Add the ability to whitelist a specific vulnerability in Shodan Monitor instead of whitelisting the while IP:port
7+
* Show scan ID when scanning without showing results (credit to @seadog007)
8+
* Handle bad gateway errors (credit to @yaron-cider)
9+
10+
411
1.27.0
512
------
613
* New command: ``shodan alert export`` to save the current network monitoring configuration

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='shodan',
12-
version='1.27.0',
12+
version='1.28.0',
1313
description='Python library and command-line utility for Shodan (https://developer.shodan.io)',
1414
long_description=README,
1515
long_description_content_type='text/x-rst',

shodan/client.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,14 @@ def disable_alert_trigger(self, aid, trigger):
721721
"""Disable the given trigger on the alert."""
722722
return self._request('/shodan/alert/{}/trigger/{}'.format(aid, trigger), {}, method='delete')
723723

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

728734
def unignore_alert_trigger_notification(self, aid, trigger, ip, port):

0 commit comments

Comments
 (0)