Skip to content

Commit

Permalink
Improved brute_tlds() function
Browse files Browse the repository at this point in the history
  • Loading branch information
filippolauria committed Feb 7, 2021
1 parent 96fc578 commit 772757b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dnsrecon.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@ def brute_tlds(res, domain, verbose=False, thread_num=None):
domain_main = domain.split(".")[0]

# Let the user know how long it could take
print_status("The operation could take up to: {0}".format(
time.strftime('%H:%M:%S', time.gmtime((len(itld) + len(gtld) + len(grtld) + len(stld) + len(cctld)) / 3))))
all_tlds_len = len(itld) + len(gtld) + len(grtld) + len(stld) + len(cctld)
duration = time.strftime('%H:%M:%S', time.gmtime(all_tlds_len / 3))
print_status(f"The operation could take up to: {duration}")

total_tlds = list(set(itld + gtld + grtld + stld))

Expand All @@ -305,12 +306,13 @@ def brute_tlds(res, domain, verbose=False, thread_num=None):

except Exception as e:
print_error(e)

found_tlds = []
for rcd_found in brtdata:
for rcd in rcd_found:
if re.search(r"^A", rcd[0]):
print_good({"type": rcd[0], "name": rcd[1], "address": rcd[2]})
found_tlds.append([{"type": rcd[0], "name": rcd[1], "address": rcd[2]}])
for type_, name_, addr_ in rcd_found:
if type_ in ['A', 'AAAA']:
print_good(f"\t {type_} {name_} {addr_}")
found_tlds.append([{"type": type_, "name": name_, "address": addr_}])
print_good(f"{len(found_tlds)} Records Found")
return found_tlds

Expand Down

0 comments on commit 772757b

Please sign in to comment.