Path: blob/master/Botnets/Exploits/IPCAM FULL/scrap.py
5038 views
#!/usr/bin/python1# Python scanner, RCE Exploit CCTV2# Usage: python3 scrap.py 100034from urllib.request import Request, urlopen5import time, random67# Shodan API8req = Request("https://www.shodan.io/search?query=GoAhead+5ccc069c403ebaf9f0171e9517f40e41", headers={'User-Agent': 'Mozilla/5.0'})91011while 1:12try:13webpage = str(urlopen(req).read())14ips = []15while webpage.find("Document Error: Unauthorized") != -1:16webpage = webpage[webpage.find("Document Error: Unauthorized")-40:]17ips.append(webpage[webpage.find("<a href=")+9:webpage.find("\">Document Error")])18webpage = webpage[100:]19check = []20for ip in ips:21check.append(ip.strip("http://").strip("s://"))22reader = open("output.txt", "r")23data = reader.read()24reader.close()25current = data.split("\n")26while "\n" in current != -1:27current.remove("\n")28new = []29for ip in check:30if ip not in current:31new.append(ip)32current.append(ip)33writestring = ""34for ip in current:35writestring += ip + "\n"36writer = open("output.txt", "w")37writer.write(writestring[:len(writestring)-1])38writer.close()39time.sleep(15)40consoleprint = ""41for ip in new:42consoleprint += ip + ", "43if len(new) != 0:44print(str(len(new)) + " new IPs added: " + consoleprint[:len(consoleprint)-2])45except Exception as printouterror:46print(printouterror)474849