Advertisement
Anubis_MSF

Google Dorker.py

Sep 24th, 2013
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.20 KB | None | 0 0
  1. # This is a universal google dorker
  2. # You can use this for getting urls of every dork you know.
  3. # Just input the dork and number of pages,
  4. # the script will take care of the rest.
  5.  
  6. #-----------------------------------------------------
  7. # Name : Google Dorker.py
  8. # Version : beta
  9. # Author : Anubis
  10. # Contact : [email protected]
  11. # Facebook : www.facebook.com/zerouplink
  12. #-----------------------------------------------------
  13.  
  14. ###########################################################
  15.  
  16. global logo
  17. logo = '''
  18.  ___                _       ___          _
  19. / __|___  ___  __ _| |___  |   \ ___ _ _| |_____ _ _
  20. | (_ / _ \/ _ \/ _` | / -_) | |) / _ \ '_| / / -_) '_|
  21. \___\___/\___/\__, |_\___| |___/\___/_| |_\_\___|_|
  22.               |___/
  23.                             (-   Version : beta    -)
  24.                             (-  Author  : Anubis   -)
  25.                             (- MSF Forum Moderator -)'''
  26. try:
  27.     from pygoogle import pygoogle
  28. except ImportError:
  29.     print "[!] Pygoogle file not found!"
  30.     print "[!] Program can't continue"
  31.     print "[!] Get pygoogle file from this link"
  32.     print "\n\t\t[ http://pastebin.com/Q0xVF2nV ]"
  33.  
  34. class dorker():
  35.  
  36.     def __init__(self):
  37.         print logo
  38.  
  39.         search_dork = raw_input("\n\nEnter Dork : ")
  40.         pages = input("Enter number of pages : ")
  41.         f_output = raw_input("Enter file to output urls : ")
  42.  
  43.         if search_dork != '' and pages != '':
  44.             self.dork(search_dork,pages,f_output)
  45.  
  46.     def dork(self,search_term,p,output):
  47.         print "[+] Searching for %s " % search_term
  48.         gs = pygoogle(search_term)
  49.         gs.pages = p
  50.         print "[+] Results Found : %s " % (gs.get_result_count())
  51.         if gs.get_result_count() == 0: print "[-] No Results Found"; exit
  52.  
  53.         print "[+] Fetching [%s] Results " % (gs.get_result_count())
  54.         url_list = gs.get_urls()
  55.         print "[+] Got [%s] URLs" % (len(url_list))
  56.         print "[+] Writing URLs to [%s] " % (output)
  57.         with open(output,'w') as w_file:
  58.             for i in url_list: w_file.write(i+'\n')
  59.         print "[+] URLs saved to [%s] " % (output)
  60.  
  61. def main():
  62.     google = dorker()
  63.  
  64.  
  65. if __name__ == '__main__':
  66.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement