背景介绍
shodan设备搜索引擎,可以理解成别人预先处理好nmap扫全网,并且存储到数据库里,需要时直接进行查询。
常用于发现某种中间件存在漏洞,可以筛选全网受影响的设备,然后你自己可以批量运行你的攻击payload。
import shodanSHODAN_API_KEY = "你自己的API"api = shodan.Shodan(SHODAN_API_KEY)# Wrap the request in a try/ except block to catch errorstry:# Search Shodanresults = api.search('apache')# Show the resultsprint 'Results found: %s' % results['total']for result in results['matches']:print 'IP: %s' % result['ip_str']print result['data']print ''except shodan.APIError, e:print 'Error: %s' % e
