From 5ff4597f8221dd905859e04bde3ef8e5d57614af Mon Sep 17 00:00:00 2001 From: NotoriousRebel Date: Sun, 13 Jan 2019 13:47:52 -0500 Subject: [PATCH 1/2] added some fstrings. --- theHarvester.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/theHarvester.py b/theHarvester.py index 3f3d752e..1ffda90f 100755 --- a/theHarvester.py +++ b/theHarvester.py @@ -389,7 +389,7 @@ def start(argv): db.store_all(word, all_emails, 'email', 'yahoo') elif engineitem == "all": - print(("Full harvest on " + word)) + print(f'Full harvest on {word}') all_emails = [] all_hosts = [] @@ -612,7 +612,7 @@ def start(argv): else: print("\033[1;33;40m \n[+] IP addresses found:") print("-----------------------") - print("Total IP addresses: " + str(len(all_ip)) + "\n") + print(f"Total IP addresses: {str(len(all_ip))} \n") for ip in sorted(list(set(all_ip))): print(ip) print("\n[+] Emails found:") @@ -633,7 +633,7 @@ def start(argv): if all_emails == []: print("No emails found.") else: - print("Total emails: " + str(len(all_emails)) + "\n") + print(f"Total emails: {str(len(all_emails))} \n") print(("\n".join(sorted(list(set(all_emails)))))) print("\033[1;33;40m \n[+] Hosts found:") @@ -642,7 +642,7 @@ def start(argv): print("No hosts found.") else: total = len(all_hosts) - print(("Total hosts: " + str(total) + "\n")) + print(f"Total hosts: {str(total)} \n") all_hosts = sorted(list(set(all_hosts))) for host in all_hosts: print(host) @@ -670,7 +670,7 @@ def start(argv): print('\nNo Trello URLs found.') else: total = len(trello_urls) - print(("\nTotal URLs: " + str(total) + "\n")) + print(f"\nTotal URLs: f{str(total)} \n") for url in sorted(list(set(trello_urls))): print(url) From 9337d9c3a45f2464428ad58adb259d4b0fbaa4c9 Mon Sep 17 00:00:00 2001 From: NotoriousRebel Date: Sun, 13 Jan 2019 21:15:40 -0500 Subject: [PATCH 2/2] Added error check for duckduckgo to make sure not indexing from an empty list. --- discovery/duckduckgosearch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discovery/duckduckgosearch.py b/discovery/duckduckgosearch.py index 3f3bb740..3790bb05 100644 --- a/discovery/duckduckgosearch.py +++ b/discovery/duckduckgosearch.py @@ -48,9 +48,11 @@ def crawl(self, text): load = json.loads(text) for key in load.keys(): # Iterate through keys of dict. val = load.get(key) - if isinstance(val, int) or isinstance(val, dict): + if isinstance(val, int) or isinstance(val, dict) or val is None: continue if isinstance(val, list): + if len(val) == 0: # Make sure not indexing an empty list + continue val = val[0] # First value should be dict. if isinstance(val, dict): # Sanity check. for key in val.keys():