inj3ctor_m4

Bing Dorker

Oct 2nd, 2014
1,654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.47 KB | None | 0 0
  1. #[Python] Bing Dorker
  2. #By INJ3CTOR_M4 // facebook.com/H4ck19
  3.  
  4. import re, urllib, requests, os, sys
  5. from urlparse import urlparse
  6. from platform import system
  7.  
  8. if system() == 'Linux':
  9.     os.system('clear')
  10. if system() == 'Windows':
  11.     os.system('cls')
  12.    
  13. start ='''
  14.        __________.__                
  15.        \______   \__| ____    ____  
  16.         |    |  _/  |/    \ / ___\
  17.         |    |   \ |   |  \/ /_/  >
  18.         |______  /__|___|  /\___  /
  19.                \/        \//_____/  
  20.  
  21. '''
  22.  
  23. gt = requests.session()
  24. useragent = {'User-Agent': 'msnbot/1.0 (+http://search.msn.com/msnbot.htm)'}
  25. def Bing_it(dork):
  26.     alllinks = []
  27.     i = 1
  28.     while True:
  29.         bing = gt.get('http://www.bing.com/search?q='+urllib.quote_plus(dork)+'&first='+str(i)+'&go=&filt=all&FORM=PERE2', headers=useragent).text
  30.         data = re.findall('<li.*?class="b_algo".*?>.*?<h2>.*?<a.*?href="(https?://.*?)"', bing)
  31.         for site in data:
  32.             site = urlparse(site)
  33.             alllinks.append(site.scheme+"://"+site.netloc+""+site.path)
  34.         i+=10
  35.         if not re.search('class="sb_pagN"', bing) :
  36.             break
  37.    
  38.     return list(set(alllinks))
  39.  
  40. print (start)
  41. try:
  42.     ip = sys.argv[1]
  43.     dork = raw_input("Dork? # ")
  44.     if not dork:
  45.         target = ('ip:'+ip)
  46.     else:
  47.         target = ('ip:'+ip+' '+dork)
  48.    
  49.     i = 0
  50.     print '\n\n\t\t[+] Grabbing '+ip+' begun\n\n'
  51.     for b in Bing_it(target):
  52.         print (b)
  53.         i+=1
  54.     print 'Found : '+str(i)+' Unique Domain.'
  55.  
  56. except IndexError:
  57.     print '\t\tUsage: python '+sys.argv[0]+' [127.0.0.1]\n'
Advertisement
Add Comment
Please, Sign In to add comment