mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-26 07:23:17 +08:00
Cleaned up trello search and modified theHarvester to utilize Trello to return hostnames and Trello urls.
This commit is contained in:
parent
2a5d3221f1
commit
6011dadbd7
2 changed files with 28 additions and 10 deletions
|
@ -17,12 +17,13 @@ def __init__(self, word, limit):
|
|||
|
||||
def do_search(self):
|
||||
try:
|
||||
urly= "https://" + self.server + "/search?num=100&start=" + str(self.counter) + "&hl=en&meta=&q=site%3Atrello.com%20" + self.word
|
||||
urly = "https://" + self.server + "/search?num=100&start=" + str(
|
||||
self.counter) + "&hl=en&meta=&q=site%3Atrello.com%20" + self.word
|
||||
except Exception as e:
|
||||
print(e)
|
||||
headers = {'User-Agent': googleUA}
|
||||
try:
|
||||
r=requests.get(urly,headers=headers)
|
||||
r = requests.get(urly, headers=headers)
|
||||
time.sleep(getDelay())
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
@ -34,17 +35,18 @@ def get_emails(self):
|
|||
return rawres.emails()
|
||||
|
||||
def get_urls(self):
|
||||
print('\tSearching Trello Urls..')
|
||||
try:
|
||||
rawres = myparser.parser(self.totalresults, "trello.com")
|
||||
urls = rawres.urls()
|
||||
trello_urls = rawres.urls()
|
||||
visited = set()
|
||||
for url in urls:
|
||||
#iterate through urls gathered and visit them
|
||||
if url not in visited:
|
||||
for url in trello_urls:
|
||||
# iterate through trello urls gathered and visit them, append text to totalresults
|
||||
if url not in visited: # make sure visiting unique urls
|
||||
visited.add(url)
|
||||
self.totalresults += requests.get(url=url, headers={'User-Agent': googleUA}).text
|
||||
rawres = myparser.parser(self.totalresults, self.word)
|
||||
return rawres.hostnames()
|
||||
return rawres.hostnames(), trello_urls
|
||||
except Exception as e:
|
||||
print("Error occurred: " + str(e))
|
||||
|
||||
|
@ -53,4 +55,4 @@ def process(self):
|
|||
self.do_search()
|
||||
time.sleep(getDelay())
|
||||
self.counter += 100
|
||||
print("\tSearching " + str(self.counter) + " results..")
|
||||
print("\tSearching " + str(self.counter) + " results..")
|
||||
|
|
|
@ -102,6 +102,7 @@ def start(argv):
|
|||
limit = 500
|
||||
all_ip = []
|
||||
full = []
|
||||
trello_info = ([], False)
|
||||
dnsserver = ""
|
||||
for value in enumerate(opts):
|
||||
opt = value[1][0]
|
||||
|
@ -375,7 +376,9 @@ def start(argv):
|
|||
search.process()
|
||||
emails = search.get_emails()
|
||||
all_emails.extend(emails)
|
||||
hosts = search.get_urls()
|
||||
info = search.get_urls()
|
||||
hosts = info[0]
|
||||
trello_info = (info[1], True )
|
||||
all_hosts.extend(hosts)
|
||||
db = stash.stash_manager()
|
||||
db.store_all(word, hosts, 'host', 'trello')
|
||||
|
@ -573,10 +576,21 @@ def start(argv):
|
|||
pass
|
||||
else:
|
||||
host_ip.append(ip.lower())
|
||||
|
||||
db = stash.stash_manager()
|
||||
db.store_all(word, host_ip, 'ip', 'DNS-resolver')
|
||||
|
||||
if trello_info[1] == True: #indicates user selected Trello
|
||||
print("\033[1;33;40m \n[+] Urls found from Trello:")
|
||||
print("------------------------------------")
|
||||
trello_urls = trello_info[0]
|
||||
if trello_urls == []:
|
||||
print('\nNo trello urls found')
|
||||
else:
|
||||
total = len(trello_urls)
|
||||
print(("\nTotal urls: " + str(total) + "\n"))
|
||||
for url in sorted(list(set(trello_urls))):
|
||||
print(url)
|
||||
|
||||
# DNS Brute force####################################################
|
||||
dnsres = []
|
||||
if dnsbrute == True:
|
||||
|
@ -708,6 +722,8 @@ def start(argv):
|
|||
else:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
###################################################################
|
||||
# Here i need to add explosion mode.
|
||||
# Tengo que sacar los TLD para hacer esto.
|
||||
|
|
Loading…
Reference in a new issue