Advertisement
ladyva

[Exploit] CCTV RCE Scanner

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