用于shodan的python库和命令行实用程序(https://developer.shodan.io)
shodan的Python项目详细描述
Shodan是一个互联网连接设备的搜索引擎。谷歌允许你搜索网站, Shodan允许您搜索设备。这个库为开发人员提供了对所有 存储在Shodan中的数据,以便自动化任务并集成到现有工具中。
功能
- 搜索shodan
- Fast/ bulk IP lookups
- 流式API支持实时使用Shodan Firehose
- Network alerts (aka private firehose)
- Manage Email Notifications
- 充分利用已实现的搜索API
- 批量数据下载
- Command-line interface
快速启动
fromshodanimportShodanapi=Shodan('MY API KEY')# Lookup an IPipinfo=api.host('8.8.8.8')print(ipinfo)# Search for websites that have been "hacked"forbannerinapi.search_cursor('http.title:"hacked by"'):print(banner)# Get the total number of industrial control systems services on the Internetics_services=api.count('tag:ics')print('Industrial Control Systems: {}'.format(ics_services['total']))
从https://account.shodan.io获取api密钥
安装
要安装Shodan库,只需:
$ pip install shodan
或者如果您没有安装pip(您应该认真安装):
$ easy_install shodan