Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import sys
from pybinaryedge import BinaryEdge
def main():
##### CONFIG #####
be_api_key = "YOURAPIKEY"
##################
# Iterate over the first page of IPs having specific ssh configuration
be = BinaryEdge(be_api_key)
search = 'WHATYOUSEARCHINGFOR?'
be_response = be.host_search(search)
if "total" not in be_response:
raise Exception()
pages = be_response['total']
tp = int(pages)
ppp = (tp // 20) + 1
print("There are " + str(ppp) + " Pages of results")
for i in range(1, ppp + 1):
for ip in be.host_search(search, i)['events']:
try:
print(ip['result']['data']['request']['url'])
except:
pass
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.