diff --git a/discovery/__init__.py b/discovery/__init__.py index a74b25bc..b40a0df2 100644 --- a/discovery/__init__.py +++ b/discovery/__init__.py @@ -21,4 +21,5 @@ "port_scanner", "takeover", "googlecertificates", - "googleCSE"] \ No newline at end of file + "googleCSE", + "censys"] \ No newline at end of file diff --git a/discovery/googleCSE.py b/discovery/googleCSE.py index 49b4252b..ca15245d 100644 --- a/discovery/googleCSE.py +++ b/discovery/googleCSE.py @@ -18,6 +18,9 @@ def __init__(self, word, limit, start): self.limit = limit self.counter = 1 self.api_key = "" + if self.api_key == "": + print("You need an API key in order to use the Hunter search engine. You can get one here: https://cse.google.com") + sys.exit() self.cse_id = "" self.lowRange = start self.highRange = start+100 diff --git a/theHarvester.py b/theHarvester.py index 2177d73b..669c22e9 100644 --- a/theHarvester.py +++ b/theHarvester.py @@ -126,7 +126,7 @@ def start(argv): dnstld = True elif opt == '-b': engines = set(arg.split(',')) - supportedengines = set(["baidu","bing","crtsh","bingapi","dogpile","google","googleCSE","virustotal","threatcrowd","googleplus","google-profiles",'google-certificates',"linkedin","pgp","twitter","vhost","yahoo","netcraft","hunter","all"]) + supportedengines = set(["baidu","bing","crtsh","censys","bingapi","dogpile","google","googleCSE","virustotal","threatcrowd","googleplus","google-profiles",'google-certificates',"linkedin","pgp","twitter","vhost","yahoo","netcraft","hunter","all"]) if set(engines).issubset(supportedengines): print("found supported engines") print(("[-] Starting harvesting process for domain: " + word + "\n")) @@ -197,8 +197,8 @@ def start(argv): search.store_results() all_emails = search.get_emails() db=stash.stash_manager() - db.store_all(word,all_hosts,'email','googleCSE') all_hosts = search.get_hostnames() + db.store_all(word,all_hosts,'email','googleCSE') db=stash.stash_manager() db.store_all(word,all_hosts,'host','googleCSE') @@ -298,6 +298,16 @@ def start(argv): all_emails = search.get_emails() all_hosts = search.get_hostnames() + elif engineitem == "censys": + print("[-] Searching in Censys:") + from discovery import censys + #import locally or won't work + search = censys.search_censys(word) + search.process(5) + all_emails = [] + all_hosts = search.get_hostnames() + + elif engineitem == "all": print(("Full harvest on " + word)) all_emails = []