Created
February 25, 2016 11:00
-
-
Save 0xded093/87018cc3c097a7695871 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import censys | |
from censys import * | |
api = censys.ipv4.CensysIPv4(api_id="945c7b3d-7940-42a1-8cdf-b2c90aee51fc", api_secret="mdoqmxnhuPfEYQxfReKgFZzdOjOtlmjR") | |
res = api.search(sys.argv[1]) | |
matches = res['metadata']['count'] | |
pageNum = matches / 100 | |
if matches % 100 != 0: | |
pageNum = pageNum + 1 | |
for i in res.get('results'): | |
print "{} {}".format(i.get("ip"), " ".join(i.get('protocols')) | |
## bypass first page limit | |
#count = 1 | |
#while count <= pageNum: | |
# res = api.search(sys.argv[1], page=count) | |
# count = count+1 | |
# for i in res.get('results'): | |
# print "{} {}".format(i.get("ip"), " ".join(i.get('protocols')) | |
########################################################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment