[~/repos/shodan]$ python --version
Python 2.6.6
[~/repos/shodan]$ shodan count linux
10786267
[~/repos/shodan]$ shodan host 8.8.8.8
8.8.8.8
Traceback (most recent call last):
File "/usr/bin/shodan", line 4, in <module>
__import__('pkg_resources').run_script('shodan==1.3.8', 'shodan')
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 742, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 1674, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.6/site-packages/shodan-1.3.8-py2.6.egg/EGG-INFO/scripts/shodan", line 1134, in <module>
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/shodan-1.3.8-py2.6.egg/EGG-INFO/scripts/shodan", line 488, in host
ValueError: zero length field name in format
[~/repos/shodan]$ shodan alert
Usage: shodan alert [OPTIONS] COMMAND [ARGS]...
Options:
-h, --help Show this message and exit.
Commands:
clear Remove all alerts
list List all the active alerts
remove Remove the specified alert
[~/repos/shodan]$ shodan alert list
Traceback (most recent call last):
File "/usr/bin/shodan", line 4, in <module>
__import__('pkg_resources').run_script('shodan==1.3.8', 'shodan')
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 742, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 1674, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.6/site-packages/shodan-1.3.8-py2.6.egg/EGG-INFO/scripts/shodan", line 1134, in <module>
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 86, in augment_usage_errors
yield
File "/usr/lib/python2.6/site-packages/click-6.2-py2.6.egg/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/shodan-1.3.8-py2.6.egg/EGG-INFO/scripts/shodan", line 351, in alert_list
ValueError: zero length field name in format
#!/usr/bin/env python
# Initialize Shodan
import shodan
api = shodan.Shodan("API_KEY")
# Create a new alert
alert = api.create_alert('desktops', CRAZY/24')
try:
# Subscribe to data for the created alert
for banner in api.stream.alert(alert['id']):
print banner
except:
# Cleanup if any error occurs
api.delete_alert(alert['id'])