-
-
Save cmlh/4b74409671eeafd4d2e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# shodan-stream.py | |
# Read a firehose/ stream of 1% of the data that Shodan collects in real-time. | |
# | |
# WARNING: This script only works with people that have a subscription API plan! | |
# And by default the Streaming API only returns 1% of the data that Shodan gathers. | |
# If you wish to have more access please contact us at support@shodan.io for pricing | |
# information. | |
# | |
# Author: achillean | |
import shodan | |
import sys | |
# Configuration | |
API_KEY = 'YOUR API KEY' | |
try: | |
# Setup the api | |
api = shodan.Shodan(API_KEY) | |
for banner in api.stream.banners(): | |
print banner | |
except Exception, e: | |
print 'Error: %s' % e | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment