Advertisement
Guest User

reverseip

a guest
May 25th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import socket
  4. import urllib2
  5. import os, re
  6. import sys
  7. import cookielib
  8. import webbrowser
  9.  
  10.  
  11. def cls():
  12.  
  13. if os.name == "nt":
  14. os.system('cls' and 'color a')
  15. else:
  16. os.system('clear')
  17.  
  18. cls()
  19.  
  20. banner = '''
  21. \t\t-----------------------------------------------
  22. \t\t| Sem Recodar Newbies By VandaTheGod
  23. \t\t| REVERSE IP SITES
  24. \t\t| TWITTER.COM/VANDATHEGOD
  25. \t\t| Usar : python reverseip.py target.com sem o www
  26. \t\t-----------------------------------------------
  27. '''
  28.  
  29. print banner
  30.  
  31.  
  32. def main():
  33. try:
  34. host = raw_input('Coloque seu Site ou IP: ')
  35. print ""
  36. print "Por Favor Espere Seu Lammer fdp esta Listando .... "
  37. if host.startswith("http://"):
  38. host = host.replace("http://","")
  39. elif host.startswith("https://"):
  40. host = host.replace("https://", "")
  41. else:
  42. pass
  43.  
  44. ip = socket.gethostbyname(host)
  45.  
  46. #ip = sys.argv[1]
  47. cj = cookielib.CookieJar()
  48. opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  49.  
  50. next = 0
  51. while(next<=500):
  52.  
  53. url = "http://www.bing.com/search?q=ip%3A"+ip+"&first="+str(next)+"&FORM=PORE"
  54. #print url
  55. data = urllib2.Request(url)
  56. box = opener.open(data).read()
  57. next = next+10
  58. b = re.findall('<h2><a href="\S+', box)
  59. for bing in b:
  60.  
  61. x = bing.replace('<h2><a href="http://', "").replace('/"', "").replace('"', "")
  62. if x.startswith("www."):
  63. x = x.replace("www.", "")
  64. else:
  65. pass
  66.  
  67. with open("x.txt", 'a') as f:
  68. f.write(x)
  69. f.write("\n")
  70.  
  71. lines = open("x.txt", 'r').read().split("\n")
  72. lines_set = set(lines)
  73. count = 0
  74. for line in lines_set:
  75. with open("reverseip.txt", 'a') as neo:
  76. count = count + 1
  77. black = line.split("/")[0]
  78. neo.write(black)
  79. neo.write("\n")
  80.  
  81. print "Total Sites Found: " + str(count)
  82.  
  83. os.unlink("x.txt")
  84. webbrowser.open("reverseip.txt")
  85.  
  86.  
  87. except urllib2.HTTPError:
  88. pass
  89.  
  90. except socket.gaierror:
  91. print ""
  92. print "Por Favor Usar Dominio Valido ou Ip Valido"
  93. print ""
  94. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement