python写端口批量扫描器

时间:2023-03-08 18:23:31

 用到shodan模块

话不多说,马上开始

pip3 install shodan

import shodan

SHODAN_API_KEY=" 你的shodankey"

api = shodan.Shodan(SHODAN_API_KEY)

try:

results=api.search("3389")

print ('Results found: %s' % results['total'])
for result in results['matches']:
print ('IP: %s' % result['ip_str'])
print (result['data'])
print ('')
except shodan.APIError as e:
print ('Error: %s' % e)
 python写端口批量扫描器