Advertisement
Guest User

website grabber

a guest
Nov 20th, 2017
1,620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.62 KB | None | 0 0
  1. #zebyzeby
  2. from multiprocessing import pool
  3. import urllib
  4. import urllib2
  5. import httplib
  6. import socket
  7. import sys, os, re
  8. import requests
  9. from platform import system
  10. import sys
  11. print "Saber's website grabber"
  12. print "[1] Bing"
  13. print "[2] reverse ip lookup"
  14. ch1=raw_input("\n[>] ")
  15. def menu():
  16.     print  '''                _
  17. YOU HAVE TO PUT IP LISTS ON ip.txt'''
  18. menu()
  19. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. if ch1 == '2' :
  21.  url = 'http://api.hackertarget.com/reverseiplookup/?q='
  22.  lista = raw_input(" Enter List : ")
  23.  lista = open(lista,'r')
  24.  read = lista.readlines()
  25.  for ip in read:
  26.   ip = ip.rstrip("\n")
  27.   print("Scanning -> "+ip)
  28.   curl = url+ip
  29.   openurl = urllib2.urlopen(curl)
  30.   read = openurl.read()
  31.   file = open('ranged.txt','a')
  32.   file.write(read)
  33.   file.close()
  34.   file = open('ranged.txt','r')
  35.   read = file.readlines()
  36.   file.close()
  37.   os.system('rm ranged.txt')
  38.   for z in read:
  39.    z = z.rstrip("\n")
  40.    file = open('ranged.txt','a')
  41.    z = 'http://'+z
  42.    file.write(z+"\n")
  43.    file.close()
  44.    print(" good -> "+i)
  45.   print("Good,Saved In ranged.txt")
  46. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  47. if ch1 == '1' :
  48.   try:
  49.     lists = open(sys.argv[1], 'r').readlines()
  50.     for ips in lists:
  51.      ip = ips.rstrip()
  52.      page = 1
  53.      while page <= 50:
  54.       bing = "http://www.bing.com/search?q=ip%3A"+ip+"&count=50&first="+str(page)
  55.       openbing  = urllib2.urlopen(bing, timeout = 5)
  56.       readbing = openbing.read()
  57.       data = re.findall('<h2><a href="(.*?)"',readbing)
  58.       page += 50
  59.       print "Grabbed Domains[+]:", ip,"\n",
  60.       open('SitesBing.txt', "a").write("\n"+"\n".join(data))
  61.   except:
  62.    pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement