Last active
February 28, 2019 16:06
-
-
Save random-robbie/ea743d66f706683f86a4e32757bca49a to your computer and use it in GitHub Desktop.
This file contains 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
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