-
Notifications
You must be signed in to change notification settings - Fork 237
/
Copy pathdependencies.sh
418 lines (289 loc) · 11.2 KB
/
dependencies.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
#!/usr/bin/env bash
function _bye() {
printf ' %s\n\n \e[1;1;31m%s\e[m\n\n\n' \
"Autoinstaller is not available on your system." \
"For more info please see https://github.com/trimstray/htrace.sh/wiki/Requirements."
exit 1
}
function _tread() {
printf ' \e[1;1;30m%s\e[m: \e[1;1;37m%s\e[m\n \e[1;1;30m%s\e[m: \e[1;1;37m%s\e[m\n\n' \
"os_name" "$_os_name" \
"os_id" "$_os_id"
printf ' Please check golang variables or set them before start:\n\n'
printf ' GOROOT: %s\n GOPATH: %s\n\n' \
"$GOROOT" "$GOPATH"
printf ' %s: ' "Please enter (Y) to continue"
read _kvar
if [[ "$_kvar" != "Y" ]] ; then echo ; exit 1 ; fi
echo
}
# We check if we are a root user.
if [[ "$EUID" -ne 0 ]] ; then
printf "EUID is not equal 0 (no root user)\\n"
exit 1
fi
# Machine type.
if [[ "$OSTYPE" == "darwin"* ]] ; then
_os_name="darwin"
_os_version=""
_os_id="darwin"
readonly _dir=$(dirname "$(readlink "$0" || echo "$(echo "$0" | sed -e 's,\\,/,g')")")
elif [[ "$OSTYPE" == "linux-gnu" ]] || [[ "$OSTYPE" == "linux-musl" ]] ; then
readonly _dir=$(dirname "$(readlink -f "$0" || echo "$(echo "$0" | sed -e 's,\\,/,g')")")
if [[ -f /etc/os-release ]] ; then
source /etc/os-release
_os_name="$NAME"
_os_version="$VERSION_ID"
_os_id="$ID"
_os_id_like="$ID_LIKE"
elif type lsb_release >/dev/null 2>&1 ; then
_os_name=$(lsb_release -si)
_os_version=$(lsb_release -sr)
elif [[ -f /etc/lsb-release ]] ; then
source /etc/lsb-release
_os_name="$DISTRIB_ID"
_os_version="$DISTRIB_RELEASE"
elif [[ -f /etc/debian_version ]] ; then
_os_name="Debian"
_os_version=$(cat /etc/debian_version)
elif [[ -f /etc/redhat-release ]] ; then
_os_name=$(awk '{print $1}' /etc/redhat-release)
_os_version=$(awk '{print $4}' /etc/redhat-release)
elif [[ -f /etc/centos-release ]] ; then
_os_name=$(awk '{print $1}' /etc/centos-release)
_os_version=$(awk '{print $4}' /etc/centos-release)
else
_bye
fi
fi
# Global variables.
readonly _tmp="${_dir}/.tmp"
mkdir -p "${_tmp}" && cd "${_tmp}"
printf "%s" "
Before start please read all on the screen!
"
if [[ "$_os_name" == "darwin" ]] || \
[[ "$_os_id" == "darwin" ]] || \
[[ "$_os_id_like" == "darwin" ]] ; then
_tread
# System tools.
brew install coreutils gnu-getopt gnu-sed openssl curl bc jq php72 \
libmaxminddb geoipupdate python rsync
# Install go.
wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz && \
tar -xvf go1.13.5.linux-amd64.tar.gz && \
mv go /usr/lib &&
ln -s /usr/lib/go/bin/go /usr/bin/go
brew install node composer
# For Mozilla-Observatory.
npm install -g observatory-cli
# For Ssllabs API.
brew install ssllabs-scan
# For mixed-content-scan.
composer global require bramus/mixed-content-scan
# For testssl.sh.
brew install testssl
# For Nmap NSE Library.
brew install nmap
git clone https://github.com/scipag/vulscan /opt/scipag_vulscan && \
ln -s /opt/scipag_vulscan /usr/share/nmap/scripts/vulscan
# For WhatWaf.
# git clone https://github.com/ekultek/whatwaf.git /opt/whatwaf
# cd /opt/whatwaf
# chmod +x whatwaf.py
# pip install -r requirements.txt
# ./setup.sh install
# cp ~/.whatwaf/.install/bin/whatwaf /usr/bin/whatwaf
# ./setup.sh uninstall
# pip install -r requirements.txt
# ln -s /opt/whatwaf/whatwaf /usr/bin/whatwaf
# For Wafw00f.
git clone https://github.com/EnableSecurity/wafw00f /opt/wafw00f
cd /opt/wafw00f
# pip install --upgrade pip
# pip install --upgrade setuptools
python setup.py install
# For SubFinder
# go get github.com/subfinder/subfinder && \
go get -v github.com/projectdiscovery/subfinder/cmd/subfinder && \
ln -s "${GOPATH}/bin/subfinder" /usr/bin/subfinder
# For Nghttp2
brew install nghttp2
if [[ -e "/usr/share/GeoIP/GeoLite2-Country.mmdb" ]] ; then
cd /usr/share/GeoIP
wget -c http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
gzip -d GeoLite2-Country.mmdb.gz
fi
geoipupdate
elif [[ "$_os_name" == "debian" ]] || \
[[ "$_os_name" == "ubuntu" ]] || \
[[ "$_os_id" == "debian" ]] || \
[[ "$_os_id" == "ubuntu" ]] || \
[[ "$_os_id_like" == "debian" ]] || \
[[ "$_os_id_like" == "ubuntu" ]] ; then
_tread
# System tools.
apt-get update
# Install go.
wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz && \
tar -xvf go1.13.5.linux-amd64.tar.gz && \
mv go /usr/lib &&
ln -s /usr/lib/go/bin/go /usr/bin/go
apt-get install -y ca-certificates dnsutils gnupg apt-utils unzip openssl \
curl bc jq mmdb-bin libmaxminddb0 libmaxminddb-dev python python-pip rsync
apt-get install -y --reinstall procps
wget -c https://github.com/maxmind/geoipupdate/releases/download/v4.0.3/geoipupdate_4.0.3_linux_amd64.deb &&
dpkg -i geoipupdate_4.0.3_linux_amd64.deb
# For Mozilla-Observatory.
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
npm install -g observatory-cli
# For Ssllabs API.
go get github.com/ssllabs/ssllabs-scan
# It's important - PATH is hardcoded in src/settings.
ln -s /opt/go/bin/ssllabs-scan /usr/bin/ssllabs-scan
# PHP 7.0
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
# alternative:
# add-apt-repository ppa:ondrej/php
apt-get update
# apt-get install -y php7.3-curl php7.3-xml php7.3-cli php7.3-mbstring
apt-get install -y php7.0-curl php7.0-xml php7.0-cli php7.0-mbstring
# For mixed-content-scan.
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer global require bramus/mixed-content-scan
# It's important - PATH is hardcoded in src/settings.
if [[ -d ${HOME}/.composer ]] ; then
ln -s /root/.composer/vendor/bramus/mixed-content-scan/bin/mixed-content-scan \
/usr/bin/mixed-content-scan
elif [[ -d ${HOME}/.config/composer ]] ; then
ln -s /root/.config/composer/vendor/bramus/mixed-content-scan/bin/mixed-content-scan \
/usr/bin/mixed-content-scan
fi
# For testssl.sh.
git clone --depth 1 https://github.com/drwetter/testssl.sh.git /opt/testssl.sh
chmod +x /opt/testssl.sh/testssl.sh
ln -s /opt/testssl.sh/testssl.sh /usr/bin/testssl.sh
# For Nmap NSE Library.
# apt-get install nmap
wget https://nmap.org/dist/nmap-7.70-1.x86_64.rpm
apt -y install alien
alien nmap-7.70-1.x86_64.rpm
dpkg -i nmap_7.70-2_amd64.deb
git clone https://github.com/scipag/vulscan /opt/scipag_vulscan && \
ln -s /opt/scipag_vulscan /usr/share/nmap/scripts/vulscan
# For WhatWaf.
# git clone https://github.com/ekultek/whatwaf.git /opt/whatwaf
# cd /opt/whatwaf
# chmod +x whatwaf.py
# pip install -r requirements.txt
# ./setup.sh install
# cp ~/.whatwaf/.install/bin/whatwaf /usr/bin/whatwaf
# ./setup.sh uninstall
# pip install -r requirements.txt
# ln -s /opt/whatwaf/whatwaf /usr/bin/whatwaf
# For Wafw00f.
git clone https://github.com/EnableSecurity/wafw00f /opt/wafw00f
cd /opt/wafw00f
# pip install --upgrade pip
# pip install --upgrade setuptools
python setup.py install
# For SubFinder
# go get github.com/subfinder/subfinder && \
go get -v github.com/projectdiscovery/subfinder/cmd/subfinder && \
ln -s "${GOPATH}/bin/subfinder" /usr/bin/subfinder
# For Nghttp2
apt-get install nghttp2
if [[ -e "/usr/share/GeoIP/GeoLite2-Country.mmdb" ]] ; then
cd /usr/share/GeoIP
wget -c http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
gzip -d GeoLite2-Country.mmdb.gz
fi
geoipupdate
elif [[ "$_os_name" == "CentOS Linux" ]] || \
[[ "$_os_id" == "centos" ]] || \
[[ "$_os_id_like" == "rhel fedora" ]] ; then
_tread
# Install curl.
rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel7.noarch.rpm && \
yum-config-manager --enable city-fan.org && \
yum update -y curl
# Install go.
wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz && \
tar -xvf go1.13.5.linux-amd64.tar.gz && \
mv go /usr/lib &&
ln -s /usr/lib/go/bin/go /usr/bin/go
yum install -y ca-certificates bind-utils gnupg unzip openssl \
bc jq mmdb2 mmdb2-devel libmaxminddb libmaxminddb-devel python python-pip rsync
# wget -c https://github.com/maxmind/geoipupdate/releases/download/v4.0.3/geoipupdate_4.0.3_linux_amd64.rpm &&
# rpm -Uvh geoipupdate_4.0.3_linux_amd64.rpm
# For Mozilla-Observatory.
wget http://nodejs.org/dist/v0.10.30/node-v0.10.30-linux-x64.tar.gz
tar --strip-components 1 -xzvf node-v* -C /usr/local
npm install -g observatory-cli
# For Ssllabs API.
go get github.com/ssllabs/ssllabs-scan
# It's important - PATH is hardcoded in src/settings.
ln -s /opt/go/bin/ssllabs-scan /usr/bin/ssllabs-scan
# PHP 7.0
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php70
yum install -y php-curl php-xml php-cli php-mbstring
# For mixed-content-scan.
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer global require bramus/mixed-content-scan
# It's important - PATH is hardcoded in src/settings.
if [[ -d ${HOME}/.composer ]] ; then
ln -s /root/.composer/vendor/bramus/mixed-content-scan/bin/mixed-content-scan \
/usr/bin/mixed-content-scan
elif [[ -d ${HOME}/.config/composer ]] ; then
ln -s /root/.config/composer/vendor/bramus/mixed-content-scan/bin/mixed-content-scan \
/usr/bin/mixed-content-scan
fi
# For testssl.sh.
git clone --depth 1 https://github.com/drwetter/testssl.sh.git /opt/testssl.sh
chmod +x /opt/testssl.sh/testssl.sh
ln -s /opt/testssl.sh/testssl.sh /usr/bin/testssl.sh
# For Nmap NSE Library.
# apt-get install nmap
wget https://nmap.org/dist/nmap-7.70-1.x86_64.rpm
rpm -Uvh nmap-7.70-1.x86_64.rpm
git clone https://github.com/scipag/vulscan /opt/scipag_vulscan && \
ln -s /opt/scipag_vulscan /usr/share/nmap/scripts/vulscan
# For WhatWaf.
# git clone https://github.com/ekultek/whatwaf.git /opt/whatwaf
# cd /opt/whatwaf
# chmod +x whatwaf.py
# pip install -r requirements.txt
# ./setup.sh install
# cp ~/.whatwaf/.install/bin/whatwaf /usr/bin/whatwaf
# ./setup.sh uninstall
# pip install -r requirements.txt
# ln -s /opt/whatwaf/whatwaf /usr/bin/whatwaf
# For Wafw00f.
git clone https://github.com/EnableSecurity/wafw00f /opt/wafw00f
cd /opt/wafw00f
# pip install --upgrade pip
# pip install --upgrade setuptools
python setup.py install
# For SubFinder
# go get github.com/subfinder/subfinder && \
go get -v github.com/projectdiscovery/subfinder/cmd/subfinder && \
ln -s "${GOPATH}/bin/subfinder" /usr/bin/subfinder
wget -P /usr/share/GeoIP https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz && \
gunzip /usr/share/GeoIP2/*.mmdb.gz
# For Nghttp2
yum install nghttp2
if [[ -e "/usr/share/GeoIP/GeoLite2-Country.mmdb" ]] ; then
cd /usr/share/GeoIP
wget -c http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
gzip -d GeoLite2-Country.mmdb.gz
fi
# geoipupdate
else
_bye
fi
cd "${_dir}" && rm -fr "${_tmp}"