Advertisement
KekSec

Glype proxy scraper

May 19th, 2019
1,761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.94 KB | None | 0 0
  1. #!/usr/bin/python
  2. #ufonet zombie finder
  3. #coded by Freak/SynthMesc
  4. #Version 1.0.0
  5. import urllib2,urllib,sys,re,random,string,time,threading,requests,os
  6. try:
  7.     dorklist=sys.argv[1]
  8. except:
  9.     print "Usage: "+sys.argv[0]+" [DORK LIST]" #Simple usage for the skids out ther ^_^
  10.     exit(1)
  11. def randomIP():
  12.     return '.'.join('%s'%random.randint(0, 255) for i in range(4)) #Generate random IP for false headers
  13. def test(url,test):
  14.     if "=" in url:
  15.         url=url.split("=")[0] + "=" + test
  16.     else:
  17.         url=url + "?url=" + test
  18.     try:
  19.         keywords=[" IPv4 "]
  20.         print "[+] Trying "+url
  21.         resp=requests.get(url).text
  22.         for keyword in keywords:
  23.                 if keyword in resp and "404" not in resp:
  24.                     print "[+] Found keyword '"+keyword+"' at "+url
  25.                     f=open("glype.txt","a")
  26.                     f.write(url+"\r\n")
  27.                     f.close()
  28.                     break
  29.     except Exception as e:
  30.         print "[-] "+str(e)
  31.         pass
  32. def spyder(dork,page):
  33.     opener = urllib2.build_opener()
  34.     opener.addheaders = [('User-agent','Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11')] #Custom user agent.
  35.     opener.addheaders = [('CLIENT-IP',randomIP())] #Inject random IP header into multiple variables, to remain anonymous.
  36.     opener.addheaders = [('REMOTE-ADDR',randomIP())]
  37.     opener.addheaders = [('VIA',randomIP())]
  38.     opener.addheaders = [('X-FORWARDED-FOR',randomIP())]
  39.     opener.addheaders = [('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')]
  40.     opener.addheaders = [('Accept-Language','en-US,en;q=0.5')]
  41.     opener.addheaders = [('Accept-Encoding','gzip, deflate')]
  42.     opener.addheaders = [('Referer',dork)]
  43.     try:
  44.         searchresults=opener.open(dork,timeout=5).read()
  45.     except Exception, e:
  46.         print "[-] "+str(e)
  47.         print "[-] Bot has been blocked from google!!! Change VPN server or proxy! Press enter to continue"
  48.         raw_input()
  49.         spyder(dork, page)
  50.     try:
  51.         searchresults
  52.     except NameError:
  53. #       print "[-] Variable undefined, re-searching"
  54.         try:
  55.             searchresults=opener.open(dork,timeout=5).read()
  56.         except:
  57.             try:
  58.                 searchresults=opener.open(dork,timeout=5).read()
  59.             except:
  60.                 print "[-] Bot has been blocked from google!!! Change VPN server or proxy! Press enter to continue"
  61.                 raw_input()
  62.                 spyder(dork, page)
  63.     else:
  64.         pass
  65. #       print "[+] Variable defined, continuing search"
  66.  
  67.     for i in re.findall('''href=["'](.[^"']+)["']''',searchresults, re.I):
  68.         i=i.replace("amp;",'')
  69.         if i.endswith("start="+str(page)+"0&sa=N") and i.startswith("/search"):
  70.             dorkurl="https://encrypted.google.com"+i
  71.             print "[+] Searching next page "+dorkurl
  72.             time.sleep(5)
  73.             spyder(dorkurl,page)
  74.             page+=1
  75.         i=urllib2.unquote(i).decode('utf8')
  76.         try:
  77.             i=i.split("?q=")[1]
  78.             i=i.split("&sa=")[0]
  79.             if i.startswith("http"):
  80.                     if i.startswith("http://accounts.google.com"):
  81.                         continue
  82.                     elif i.startswith("http://www.google.com"):
  83.                         continue
  84.                     elif i.startswith("http://encrypted.google.com"):
  85.                         continue
  86.                     elif i.startswith("http://webcache.googleusercontent.com"):
  87.                         continue
  88.                     elif i!=dork.decode('utf8'):
  89.                         threading.Thread(target=test, args=(i,"https://www.whatismyip.com",)).start()
  90.         except:
  91.             continue
  92.     time.sleep(random.randrange(5,30))
  93. f=open(dorklist,"r")
  94. for dork in f.read().split("\n"):
  95.     print "[+] Searching for dork: '"+dork+"'"
  96.     spyder('https://encrypted.google.com/search?hl=en&q='+urllib.quote_plus(dork),1)
  97. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement