mirror of
https://github.com/laramies/theHarvester.git
synced 2024-11-10 17:13:07 +08:00
Reworked some more logic, and verified that the flag does get more hostnames and emails; although, the biggest obstacle is google blocking your ip.
This commit is contained in:
parent
c1fcf35aef
commit
079f63ee16
1 changed files with 12 additions and 6 deletions
|
@ -1,7 +1,4 @@
|
|||
import string
|
||||
import sys
|
||||
import myparser
|
||||
import re
|
||||
import time
|
||||
import requests
|
||||
import random
|
||||
|
@ -21,7 +18,13 @@ def __init__(self, word, limit, start, google_dorking):
|
|||
,("Mozilla/5.0 (Linux; Android 7.0; SM-G892A Build/NRD90M; wv) " +
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Mobile Safari/537.36"),
|
||||
("Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; RM-1152) " +
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15254")]
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15254"),
|
||||
"Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebKit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42"
|
||||
,"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.991"
|
||||
,"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 OPR/48.0.2685.52"
|
||||
,"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
|
||||
,"Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
|
||||
,"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"]
|
||||
self.quantity = "100"
|
||||
self.limit = limit
|
||||
self.counter = start
|
||||
|
@ -33,7 +36,9 @@ def do_search(self):
|
|||
except Exception, e:
|
||||
print e
|
||||
try:
|
||||
r=requests.get(urly)
|
||||
params = {'User-Agent': random.choice(self.userAgent)}
|
||||
r=requests.get(urly,params= params)
|
||||
print r.content
|
||||
except Exception,e:
|
||||
print e
|
||||
self.results = r.content
|
||||
|
@ -76,6 +81,7 @@ def process(self):
|
|||
print "\tSearching " + str(self.counter) + " results..."
|
||||
self.counter += 100
|
||||
if self.google_dorking == True: #check if boolean is true indicating user wanted google dorking
|
||||
time.sleep(5)
|
||||
self.counter = 0 #reset counter
|
||||
print '\n'
|
||||
print "[-]Utilizing Google Dorks: "
|
||||
|
@ -148,7 +154,7 @@ def send_dork(self, start, end): #helper function to minimize code reusability
|
|||
link = self.links[i] #get link from dork list
|
||||
#print 'about to get request this link: ',link
|
||||
req = requests.get(link, params=params)
|
||||
time.sleep(.1) # sleep for a short time
|
||||
time.sleep(.5) # sleep for a short time
|
||||
self.results = req.content
|
||||
self.totalresults += self.results
|
||||
except:
|
||||
|
|
Loading…
Reference in a new issue