Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ozguralp authored Apr 10, 2020
1 parent bc7021a commit ae1a5d5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions hydra_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
iterator = 1
next_page = True
results = [[],[]]
results_final = []

while next_page:
try:
url = SYNACK_API_URL + HYDRA_TARGET + "?page="+str(iterator)+"&listing_uids="+target_codename+"&q=%2Bport_is_open%3Atrue"
target_response = requests.get(url, headers=headers).json()
for i in range (len(target_response)):
results[0].append((target_response[i]["ip"]))
results[1].append((str(target_response[i]["ports"])).split("'")[1])
ports = str(target_response[i]["ports"]).split("}}}}")
for j in range (len(ports)-1):
results[0].append((target_response[i]["ip"]))
results[1].append(str(ports[j]).split("'")[1])
print("Page "+str(iterator)+" done.")
if len(target_response) < 10:
print("Done loading target.")
Expand All @@ -31,4 +34,8 @@
next_page = False

for i in range (len(results[0])):
print str(results[0][i])+":"+str(results[1][i])
results_final.append (str(results[0][i])+":"+str(results[1][i]))
results_final.sort()

for i in range (len(results_final)):
print results_final[i]

0 comments on commit ae1a5d5

Please sign in to comment.