Created
January 7, 2015 19:22
-
-
Save achillean/3a48795cb75df6d1c903 to your computer and use it in GitHub Desktop.
How to read events from the Threatnet stream. Note: make sure you have the latest version of the Shodan Python library installed (>=1.2.3).
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
import shodan.threatnet | |
# Configuration | |
API_KEY = "Please enter your API key here" | |
# Create the object that interfaces with the Threatnet API | |
tnet = shodan.threatnet.Threatnet(API_KEY) | |
# Get a stream of events and print them to stdout | |
for event in tnet.stream.events(): | |
print event | |
# For full information on what information events contain please visit: | |
# https://developer.shodan.io/api/event-specification |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment