Shodan.py 搜索在打印匹配列表时不打印完整的结果集
Shodan.py search doesn't print full result set when printing matches list
我正在尝试打印出我正在执行的特定查询的完整结果列表,格式为 IP:PORT。但是它只打印部分数量。
results['total']
打印出1799(这也是在Shodan网站上搜索时的结果数量),但是打印出实际匹配时,只打印出99个结果。
可能是一些基本问题,比如没有显示所有的结果页面。我有一个 Shodan 教育帐户。
from shodan import Shodan
api = Shodan('APIKEY')
# Search Shodan
results = api.search('SearchQuery')
# Results found: 1799
print('Results found: {}'.format(results['total']))
# Prints 99 results.
for result in results['matches']:
print(str(result['ip_str']) + ":" + str(result['port']))
预期:1799 个结果
实际:100 个结果
提前致谢!
Shodan 仅 returns 第一页 contains 100 results, any further queries for pages beyond will cost 1 query credit。
获取更多页面:
api.search('SearchQuery', page=2)
等等...
根据文档,这是按预期工作的:
Stepping through the code, we first call the Shodan.search() method on
the api object which returns a dictionary of result information. We
then print how many results were found in total, and finally loop
through the returned matches and print their IP and banner. Each page
of search results contains up to 100 results.
文档在这个 pdf 中:https://media.readthedocs.org/pdf/shodan/latest/shodan.pdf
我正在尝试打印出我正在执行的特定查询的完整结果列表,格式为 IP:PORT。但是它只打印部分数量。
results['total']
打印出1799(这也是在Shodan网站上搜索时的结果数量),但是打印出实际匹配时,只打印出99个结果。
可能是一些基本问题,比如没有显示所有的结果页面。我有一个 Shodan 教育帐户。
from shodan import Shodan
api = Shodan('APIKEY')
# Search Shodan
results = api.search('SearchQuery')
# Results found: 1799
print('Results found: {}'.format(results['total']))
# Prints 99 results.
for result in results['matches']:
print(str(result['ip_str']) + ":" + str(result['port']))
预期:1799 个结果 实际:100 个结果
提前致谢!
Shodan 仅 returns 第一页 contains 100 results, any further queries for pages beyond will cost 1 query credit。
获取更多页面:
api.search('SearchQuery', page=2)
等等...
根据文档,这是按预期工作的:
Stepping through the code, we first call the Shodan.search() method on the api object which returns a dictionary of result information. We then print how many results were found in total, and finally loop through the returned matches and print their IP and banner. Each page of search results contains up to 100 results.
文档在这个 pdf 中:https://media.readthedocs.org/pdf/shodan/latest/shodan.pdf