Python中shodan模块是什么?

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。

shodan模块安装:

pipinstallshodan

常用函数:

shodan.Shodan(key)
Shodan.ports()
Shodan.services()

实例应用:

importshodan
try:
results=api.search('apache')
print(results)
print("Resultsfound:%s"%results['total'])
forresultinresults['matches']:
print(result['ip_str'])