mirror of
https://github.com/laramies/theHarvester.git
synced 2026-09-18 15:48:44 +02:00
@@ -5,3 +5,5 @@ stash.sqlite
|
||||
*.sqlite
|
||||
.vscode
|
||||
venv
|
||||
.xml
|
||||
.html
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *
|
||||
* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *
|
||||
* *
|
||||
* TheHarvester Ver. 3.0.2 *
|
||||
* TheHarvester Ver. 3.0.4 *
|
||||
* Coded by Christian Martorella *
|
||||
* Edge-Security Research *
|
||||
* cmartorella@edge-security.com *
|
||||
@@ -108,7 +108,7 @@ https://github.com/laramies/theHarvester
|
||||
Thanks:
|
||||
-------
|
||||
* Matthew Brown @NotoriousRebel
|
||||
* Janos Zold @Jzod
|
||||
* Janos Zold @Jzold
|
||||
* John Matherly - SHODAN project
|
||||
* Lee Baird for suggestions and bugs reporting
|
||||
* Ahmed Aboul Ela - subdomain names dictionary (big and small)
|
||||
|
||||
+8
-11
@@ -35,13 +35,17 @@ class search_censys:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def process(self,morepage):
|
||||
self.counter=1
|
||||
while self.counter <= morepage and self.counter <= 10:
|
||||
def process(self):
|
||||
self.url="https://" + self.server + "/ipv4/_search?q=" + str(self.word) + "&page=1"
|
||||
self.do_search()
|
||||
self.counter=2
|
||||
pages = censysparser.parser(self)
|
||||
totalpages = pages.search_numberofpages()
|
||||
while self.counter <= totalpages:
|
||||
try:
|
||||
self.page =str(self.counter)
|
||||
self.url="https://" + self.server + "/ipv4/_search?q=" + str(self.word) + "&page=" + str(self.page)
|
||||
print("\tSearching Censys results..")
|
||||
print("\tSearching Censys results page " + self.page + "...")
|
||||
self.do_search()
|
||||
except Exception as e:
|
||||
print("Error occurred: " + str(e))
|
||||
@@ -60,11 +64,4 @@ class search_censys:
|
||||
return ips.search_ipaddresses()
|
||||
except Exception as e:
|
||||
print("Error occurred: " + str(e))
|
||||
|
||||
def get_totalnumberofpages(self):
|
||||
try:
|
||||
pages = censysparser.parser(self)
|
||||
return pages.search_numberofpages()
|
||||
except Exception as e:
|
||||
print("Error occurred: " + str(e))
|
||||
|
||||
|
||||
+17
-6
@@ -10,7 +10,7 @@ import time
|
||||
try:
|
||||
import requests
|
||||
except:
|
||||
print("Request library not found, please install it before proceeding\n")
|
||||
print("Requests library not found, please install it before proceeding\n")
|
||||
sys.exit()
|
||||
|
||||
try:
|
||||
@@ -30,7 +30,7 @@ print("* | __| '_ \ / _ \ / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *")
|
||||
print("* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *")
|
||||
print("* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *")
|
||||
print("* *")
|
||||
print("* theHarvester Ver. 3.0.3 *")
|
||||
print("* theHarvester Ver. 3.0.4 *")
|
||||
print("* Coded by Christian Martorella *")
|
||||
print("* Edge-Security Research *")
|
||||
print("* cmartorella@edge-security.com *")
|
||||
@@ -46,7 +46,7 @@ def usage():
|
||||
|
||||
print("Usage: theharvester options \n")
|
||||
print(" -d: Domain to search or company name")
|
||||
print(""" -b: data source: baidu, bing, bingapi, crtsh, dogpile,
|
||||
print(""" -b: data source: baidu, bing, bingapi, cenysy, crtsh, dogpile,
|
||||
google, google-certificates, googleCSE, googleplus, google-profiles,
|
||||
hunterio, linkedin, netcraft, pgp, threatcrowd,
|
||||
twitter, vhost, virustotal, yahoo, all""")
|
||||
@@ -150,6 +150,7 @@ def start(argv):
|
||||
db.store(word,x,'host','google')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
if engineitem == "netcraft":
|
||||
print("[-] Searching in Netcraft:")
|
||||
@@ -244,6 +245,10 @@ def start(argv):
|
||||
search.process()
|
||||
all_emails = search.get_emails()
|
||||
all_hosts = search.get_hostnames()
|
||||
db=stash.stash_manager()
|
||||
db.store_all(word,all_hosts,'host','yahoo')
|
||||
db.store_all(word,all_emails,'emails','yahoo')
|
||||
|
||||
|
||||
elif engineitem == "baidu":
|
||||
print("[-] Searching in Baidu..")
|
||||
@@ -251,6 +256,9 @@ def start(argv):
|
||||
search.process()
|
||||
all_emails = search.get_emails()
|
||||
all_hosts = search.get_hostnames()
|
||||
db=stash.stash_manager()
|
||||
db.store_all(word,all_hosts,'host','baidu')
|
||||
db.store_all(word,all_emails,'emails','baidu')
|
||||
|
||||
elif engineitem == "googleplus":
|
||||
print("[-] Searching in Google+ ..")
|
||||
@@ -311,10 +319,13 @@ def start(argv):
|
||||
#import locally or won't work
|
||||
search = censys.search_censys(word)
|
||||
search.process()
|
||||
totalnumberofpages = search.get_totalnumberofpages()
|
||||
all_emails = []
|
||||
all_ip = search.get_ipaddresses()
|
||||
all_hosts = search.get_hostnames()
|
||||
db=stash.stash_manager()
|
||||
db.store_all(word,all_hosts,'host','censys')
|
||||
db.store_all(word,all_ip,'ip','censys')
|
||||
|
||||
|
||||
elif engineitem == "trello":
|
||||
print("[-] Searching in Trello:")
|
||||
@@ -652,13 +663,13 @@ def start(argv):
|
||||
for x in full:
|
||||
x = x.split(":")
|
||||
if len(x) == 2:
|
||||
file.write('<host>' + '<ip>' + x[0] + '</ip><hostname>' + x[1] + '</hostname>' + '</host>')
|
||||
file.write('<host>' + '<ip>' + x[1] + '</ip><hostname>' + x[0] + '</hostname>' + '</host>')
|
||||
else:
|
||||
file.write('<host>' + x + '</host>')
|
||||
for x in vhost:
|
||||
x = x.split(":")
|
||||
if len(x) == 2:
|
||||
file.write('<vhost>' + '<ip>' + x[0] + '</ip><hostname>' + x[1] + '</hostname>' + '</vhost>')
|
||||
file.write('<vhost>' + '<ip>' + x[1] + '</ip><hostname>' + x[0] + '</hostname>' + '</vhost>')
|
||||
else:
|
||||
file.write('<vhost>' + x + '</vhost>')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user