用shodan的python搜索apache并返回ssl版本
以下是一个示例代码,用于使用Shodan Python库搜索Apache并返回SSL版本:
import shodan
# 输入你的API Key
SHODAN_API_KEY = "YOUR API KEY"
# 初始化Shodan API
api = shodan.Shodan(SHODAN_API_KEY)
# 搜索Apache服务器
results = api.search("apache")
# 遍历结果
for result in results['matches']:
# 获取SSL信息
ssl_info = result['ssl']
# 输出SSL版本
print("SSL version: {}".format(ssl_info['version']))
请注意,在使用此代码之前,您需要先安装Shodan Python库并获取您自己的API Key。您可以在Shodan网站上注册并获得免费的API Key。
原文地址: http://www.cveoy.top/t/topic/nLe 著作权归作者所有。请勿转载和采集!