Skip to content

Instantly share code, notes, and snippets.

@random-robbie
Last active February 28, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save random-robbie/ea743d66f706683f86a4e32757bca49a to your computer and use it in GitHub Desktop.
Save random-robbie/ea743d66f706683f86a4e32757bca49a to your computer and use it in GitHub Desktop.
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