Lulz-Tigre

CCTV Scanner

Apr 21st, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.43 KB | None | 0 0
  1. #!/usr/bin/python
  2. # Python scanner, RCE Exploit CCTV
  3. # Made By Cam | http://leakedfiles.org/forums/showthread.php?tid=10
  4. # Usage: python3 scrap.py 1000
  5.  
  6. from urllib.request import Request, urlopen
  7. import time, random
  8.  
  9. # Shodan API
  10. req = Request("https://www.shodan.io/search?query=GoAhead+5ccc069c403ebaf9f0171e9517f40e41", headers={'User-Agent': 'Mozilla/5.0'})
  11.  
  12.  
  13. while 1:
  14.     try:
  15.         webpage = str(urlopen(req).read())
  16.         ips = []
  17.         while webpage.find("Document Error: Unauthorized") != -1:
  18.             webpage = webpage[webpage.find("Document Error: Unauthorized")-40:]
  19.             ips.append(webpage[webpage.find("<a href=")+9:webpage.find("\">Document Error")])
  20.             webpage = webpage[100:]
  21.         check = []
  22.         for ip in ips:
  23.             check.append(ip.strip("http://").strip("s://"))
  24.         reader = open("output.txt", "r")
  25.         data = reader.read()
  26.         reader.close()
  27.         current = data.split("\n")
  28.         while "\n" in current != -1:
  29.             current.remove("\n")
  30.         new = []
  31.         for ip in check:
  32.             if ip not in current:
  33.                 new.append(ip)
  34.                 current.append(ip)
  35.         writestring = ""
  36.         for ip in current:
  37.             writestring += ip + "\n"
  38.         writer = open("output.txt", "w")
  39.         writer.write(writestring[:len(writestring)-1])
  40.         writer.close()
  41.         time.sleep(15)
  42.         consoleprint = ""
  43.         for ip in new:
  44.             consoleprint += ip + ", "
  45.         if len(new) != 0:
  46.             print(str(len(new)) + " new IPs added: " + consoleprint[:len(consoleprint)-2])
  47.     except Exception as printouterror:
  48.         print(printouterror)
Add Comment
Please, Sign In to add comment