-
Notifications
You must be signed in to change notification settings - Fork 3
/
RecSetup.sh
276 lines (276 loc) · 8.12 KB
/
RecSetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#!/bin/sh
cd /bin/lib/sh/MK3S
echo "Program Library Installed"
unalias -a
echo "Installing Required Packages"
cd data/
git clone https://github.com/mksipe/LCRF
cd LCRF/
mkdir /bin/lib/sh/MK3S/ReferenceMaterial
chmod 755 *.txt
mv *.txt /bin/lib/sh/MK3S/data/ReferenceMaterial
cd /bin/lib/sh/MK3S
echo "2" >> /proc/sys/kernel/randomize_va_space
apt update -y
apt full-upgrade -y
RED='\033[0;31m'
NEUTRAL='\033[0;0m'
GREEN='\033[0;32m'
if [ $(which ufw |grep ufw -c) = 1 ];
then echo "[INSTALLED] UFW ";
else echo "[NOT_INSTALLED] UFW " & apt install ufw -y;
if [ $(which ufw |grep ufw -c) = 0 ];
then echo "[ERROR] UFW";
else echo "[INSTALLED] UFW";
fi;
fi
if [ $(which cron |grep cron -c) = 1 ];
then echo "[INSTALLED] CRON";
else echo "[NOT_INSTALLED] CRON" & apt install cron -y;
if [ $(which cron |grep cron -c) = 0 ];
then echo "[ERROR] CRON";
else echo "[INSTALLED] CRON";
fi;
fi
if [ $(which nano |grep nano -c) = 1 ];
then echo "[INSTALLED] NANO";
else echo "[NOT_INSTALLED] NANO" & apt install nano -y;
if [ $(which nano |grep nano -c) = 0 ];
then echo "[ERROR] NANO";
else echo "[INSTALLED] NANO";
fi;
fi
if [ $(which locate |grep locate -c) = 1 ];
then echo "[INSTALLED] LOCATE";
else echo "[NOT_INSTALLED LOCATE" & apt install locate -y;
if [ $(which locate |grep locate -c) = 0 ];
then echo "[ERROR] LOCATE";
else echo "[INSTALLED] LOCATE";
fi;
fi
if [ $(which iptables |grep iptables -c) = 1 ];
then echo "[INSTALLED] IPTABLES";
else echo "[NOT_INSTALLED] IPTABLES" & apt install iptables -y;
if [ $(which iptables |grep iptables -c) = 0 ];
then echo "[ERROR] IPTABLES";
else echo "[INSTALLED] IPTABLES";
fi;
fi
if [ $(which nmap |grep nmap -c) = 1 ];
then echo "[INSTALLED] NMAP";
else echo "[NOT_INSTALLED] NMAP" & apt install nmap -y;
if [ $(which nmap |grep nmap -c) = 0 ];
then echo "[ERROR] NMAP";
else echo "[INSTALLED] NMAP";
fi;
fi
if [ $(which git |grep git -c) = 1 ];
then echo "[INSTALLED] GIT";
else echo "[NOT_INSTALLED] GIT" & apt install git -y;
if [ $(which git |grep git -c) = 0 ];
then echo "[ERROR] GIT";
else echo "[INSTALLED] GIT";
fi;
fi
if [ $(which lightdm |grep lightdm -c) = 1 ];
then echo "[INSTALLED] LIGHTDM";
else echo "[NOT_INSTALLED LIGHTDM" & apt install lightdm -y;
if [ $(which lightdm |grep lightdm -c) = 0 ];
then echo "[ERROR] LIGHTDM";
else echo "[INSTALLED] LIGHTDM";
fi;
fi
if [ $(which chkrootkit |grep chkrootkit -c) = 1 ];
then echo "[INSTALLED] CHKROOTKIT";
else echo "[NOT_INSTALLED] CHKROOTKIT" & apt install chkrootkit -y;
if [ $(which chkrootkit |grep chkrootkit -c) = 0 ];
then echo "[ERROR] CHKROOTKIT";
else echo "[INSTALLED] CHKROOTKIT";
fi;
fi
if [ $(which cryptsetup |grep cryptsetup -c) = 1 ];
then echo "[INSTALLED] CRYPT";
else echo "[NOT_INSTALLED] CRYPT" & apt install cryptsetup cryptmount -y;
if [ $(which cryptsetup |grep cryptsetup -c) = 0 ];
then echo "[ERROR] CRYPT";
else echo "[INSTALLED] CRYPT";
fi;
fi
if [ $(which apt-listbugs |grep apt-listbugs -c) = 1 ];
then echo "[INSTALLED] APT:EXT1/2 ";
else echo "[NOT_INSTALLED] APT:EXT1/2 " & apt install apt-listbugs -y;
if [ $(which apt-listbugs |grep apt-listbugs -c) = 0 ];
then echo "[ERROR] APT:EXT1/2";
else echo "[INSTALLED] APT:EXT1/2";
fi;
fi
if [ $(which apt-listchanges |grep apt-listchanges -c) = 1 ];
then echo "[INSTALLED] APT:EXT2/2 ";
else echo "[NOT_INSTALLED] APT:EXT2/2 " & apt install apt-listchanges -y;
if [ $(which apt-listchanges |grep apt-listchanges -c) = 0 ];
then echo "[ERROR] APT:EXT2/2";
else echo "[INSTALLED] APT:EXT2/2";
fi;
fi
if [ $(which needrestart |grep needrestart -c) = 1 ];
then echo "[INSTALLED] DEB:EXT1/3 ";
else echo "[NOT_INSTALLED] DEB:EXT1/3 " & apt install needrestart -y;
if [ $(which needrestart |grep needrestart -c) = 0 ];
then echo "[ERROR] DEB:EXT1/3";
else echo "[INSTALLED] DEB:EXT1/3";
fi;
fi
if [ $(which debsecan |grep debsecan -c) = 1 ];
then echo "[INSTALLED] DEB:EXT2/3 ";
else echo "[NOT_INSTALLED] DEB:EXT2/3 " & apt install debsecan -y;
if [ $(which debsecan |grep debsecan -c) = 0 ];
then echo "[ERROR] DEB:EXT:2/3";
else echo "[INSTALLED] DEB:EXT2/3";
fi;
fi
if [ $(which debsums |grep debsums -c) = 1 ];
then echo "[INSTALLED] DEB:EXT3/3 ";
else echo "[NOT_INSTALLED] DEB:EXT3/3 " & apt install debsums -y;
if [ $(which debsums |grep debsums -c) = 0 ];
then echo "[ERROR] DEB:EXT3/3";
else echo "[INSTALLED] DEB:EXT3/3";
fi;
fi
if [ $(which snort |grep snort -c) = 1 ];
then echo "[INSTALLED] SNORT ";
else echo "[NOT_INSTALLED] SNORT " & apt install snort -y;
if [ $(which snort |grep snort -c) = 0 ];
then echo "[ERROR] SNORT";
else echo "[INSTALLED] SNORT";
fi;
fi
if [ $(which whois |grep whois -c) = 1 ];
then echo "[INSTALLED] WHOIS ";
else echo "[NOT_INSTALLED] WHOIS " & apt install whois -y;
if [ $(which whois |grep whois -c) = 0 ];
then echo "[ERROR] WHOIS";
else echo "[INSTALLED] WHOIS";
fi;
fi
if [ $(which aide |grep aide -c) = 1 ];
then echo "[INSTALLED] AIDE";
else echo "[NOT_INSTALLED] AIDE" & apt install aide -y;
if [ $(which aide |grep aide -c) = 0 ];
then echo "[ERROR] AIDE";
else echo "[INSTALLED] AIDE";
fi;
fi
if [ $(apt list clamav |grep installed -c) = 1 ];
then echo "[INSTALLED] CLAMAV ";
else echo "[NOT_INSTALLED] CLAMAV " & apt install clamav -y;
if [ $(apt list clamav |grep installed -c) = 0 ];
then echo "[ERROR] CLAMAV";
else echo "[INSTALLED] CLAMAV";
fi;
fi
if [ $(apt list clamsmtp |grep installed -c) = 1 ];
then echo "[INSTALLED] CLAMSMTP ";
else echo "[NOT_INSTALLED] CLAMSMTP " & apt install clamsmtp -y;
if [ $(apt list clamsmtp |grep installed -c) = 0 ];
then echo "[ERROR] CLAMSMTP";
else echo "[INSTALLED] CLAMSMTP";
fi;
fi
if [ $(apt list fail2ban |grep installed -c) = 1 ];
then echo "[INSTALLED] FAIL2BAN ";
else echo "[NOT_INSTALLED] FAIL2BAN " & apt install fail2ban -y;
if [ $(apt list fail2ban |grep installed -c) = 0 ];
then echo "[ERROR] FAIL2BAN";
else echo "[INSTALLED] FAIL2BAN";
fi;
fi
if [ $(apt list libpam-tmpdir |grep installed -c) = 1 ];
then echo "[INSTALLED] PAM:EXT1/2 ";
else echo "[NOT_INSTALLED] PAM:EXT1/2 " & apt install libpam-tmpdir -y;
if [ $(apt list libpam-tmpdir |grep installed -c) = 0 ];
then echo "[ERROR] PAM:EXT1/2";
else echo "[INSTALLED] PAM:EXT1/2";
fi;
fi
if [ $(apt list libpam-cracklib |grep installed -c) = 1 ];
then echo "[INSTALLED] PAM:EXT2/2 ";
else echo "[NOT_INSTALLED] PAM:EXT2/2 " & apt install libpam-cracklib -y;
if [ $(apt list libpam-cracklib |grep installed -c) = 0 ];
then echo "[ERROR] PAM:EXT2/2";
else echo "[INSTALLED] PAM:EXT2/2";
fi;
fi
if [ $(apt list build-essential |grep installed -c) = 1 ];
then echo "[INSTALLED] BUILD-ESSENTIAL ";
else echo "[NOT_INSTALLED] BUILD-ESSENTIAL " & apt install build-essential -y;
if [ $(apt list build-essential |grep installed -c) = 0 ];
then echo "[ERROR] BUILD-ESSENTIAL";
else echo "[INSTALLED] BUILD-ESSENTIAL";
fi;
fi
if [ $(apt list inotify-utils |grep installed -c) = 1 ];
then echo "[INSTALLED] INOTIFY-UTILS ";
else echo "[NOT_INSTALLED] INOTIFY-UTILS " & apt install inotify-utils -y;
if [ $(apt list inotify-utils |grep installed -c) = 0 ];
then echo "[ERROR] INOTIFY-UTILS";
else echo "[INSTALLED] INOTIFY-UTILS";
fi;
fi
apt autoremove -y
echo "Running Setup Scripts"
./Stealth-Mode.sh
./UFWC2.sh
./umasks.sh
./users-groups.sh
./User-Auth.sh
if [ $(which apache2 | grep / -c) = 1 ]; then ./Apache.sh ; else echo "Skipping Apache2 Installation" ; fi
./banners.sh
./files.sh
./iptables.sh
./Iptables2.sh
./network.sh
if [ $(which nginx | grep / -c) = 1 ]; then ./nginx.sh ; else echo "Skipping Nginx Installation" ; fi
./services.sh
./ssh.sh
./sudo-su.sh
./ssl.sh
./proftpd.sh
./users-linux.sh
ufw enable
./A:apache2.sh
./A:banners.sh
./A:files.sh
./A:iptables.sh
./A:network.sh
./A:nginx.sh
./A:services.sh
./A:ssh.sh
./A:sudo-su.sh
./A:umasks.sh
./A:users-groups.sh
./postinst
./postrm
./preinst
./prerm
./ipfilter.sh
./ipfw.sh
./SElinux.sh
./Daemonconf.sh
./Clamconf.sh
./Snortconf.sh
./AIDE.sh
./OSSEC.sh
chmod 755 *.sh
mv *.sh /bin/lib/sh/MK3S
cd /bin/lib/sh/MK3S
apt autoremove -y
chmod 551 /bin/lib/sh/MK3S
echo "Autoconfigure Complete"
echo "Here is the remaining scripts that you can use in these directories"
apt install python -y
apt install glade -y
notify-send -i /usr/share/icons/gnome/scalable/places/start-here.svg 'SSL Correctly Installed.'
chkrootkit
mkdir /bin/lib/MK3S/data/Analysis
cd /bin/lib/sh/MK3S/data/Analysis
echo "Done"