我使用这个脚本来获取shodan搜索词abc1234的系统的ip,但是我还想获取SSL证书的Issued to:Common Name,但是我无法在python API中实现这一点。在
#!/usr/bin/env python
import shodan
import sys
SHODAN_API_KEY = "key"
api = shodan.Shodan(SHODAN_API_KEY)
try:
# Search Shodan
results = api.search('abc1234')
# Show the results
print 'Results found: %s' % results['total']
for result in results['matches']:
print 'IP: %s' % result['ip_str']
print ''
except shodan.APIError, e:
print 'Error: %s' % e
支持SSL连接的服务将有一个Shodan横幅,其顶层属性名为SSL。ssl字典包含许多子属性。下面是一个例子:
以下是一种更具可读性的格式:
https://gist.github.com/achillean/88531c3e47cc2b9fc94435b6fd8fce08
您要找的房产是ssl.cert.issuer公司.CN。在Python中,这意味着:
^{pr2}$您还应该查看shodancli(https://cli.shodan.io),它可以处理80%的Shodan相关用例。我们这里有一些视频可以让你开始:
https://asciinema.org/~Shodan
对于这类问题,我建议打印出整个对象:
一旦你看到了整个对象所能提供的东西,就可以计算出确切的属性。在
相关问题 更多 >
编程相关推荐