forked from x1mdev/ReconPi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·424 lines (385 loc) · 13.6 KB
/
install.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
419
420
421
422
423
424
#!/bin/bash
: '
@name ReconPi install.sh
@author Martijn B <Twitter: @x1m_martijn>
@link https://github.com/x1mdev/ReconPi
'
: 'Set the main variables'
YELLOW="\033[133m"
GREEN="\033[032m"
RESET="\033[0m"
VERSION="2.0"
: 'Display the logo'
displayLogo() {
clear
echo -e "
__________ __________.__
\______ \ ____ ____ ____ ____\______ \__|
| _// __ \_/ ___\/ _ \ / \| ___/ |
| | \ ___/\ \__( <_> ) | \ | | |
|____|_ /\___ >\___ >____/|___| /____| |__|
\/ \/ \/ \/
v$VERSION - by $YELLOW@x1m_martijn$RESET
"
}
: 'Basic requirements'
basicRequirements() {
echo -e "[$GREEN+$RESET] This script will install the required dependencies to run recon.sh, please stand by.."
echo -e "[$GREEN+$RESET] It will take a while, go grab a cup of coffee :)"
cd "$HOME" || return
sleep 1
echo -e "[$GREEN+$RESET] Getting the basics.."
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo apt-get update -y
sudo apt-get install git -y
git clone https://github.com/x1mdev/ReconPi.git
sudo apt-get install -y --reinstall build-essential
sudo apt install -y python3-pip
sudo apt-get install -y dnsutils
sudo apt install -y lua5.1 alsa-utils libpq5
sudo apt-get autoremove -y
sudo apt clean
echo -e "[$GREEN+$RESET] Stopping Docker service.."
sudo systemctl disable docker.service
sudo systemctl disable docker.socket
echo -e "[$GREEN+$RESET] Creating directories.."
mkdir -p "$HOME"/tools
mkdir -p "$HOME"/go
mkdir -p "$HOME"/go/src
mkdir -p "$HOME"/go/bin
mkdir -p "$HOME"/go/pkg
sudo chmod u+w .
echo -e "[$GREEN+$RESET] Done."
}
: 'Golang initials'
golangInstall() {
echo -e "[$GREEN+$RESET] Installing and setting up Go.."
if [[ $(go version | grep -o '1.13') == 1.13 ]]; then
echo -e "[$GREEN+$RESET] Go is already installed, skipping installation"
else
cd "$HOME"/tools || return
git clone https://github.com/udhos/update-golang
cd "$HOME"/tools/update-golang || return
sudo bash update-golang.sh
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Adding recon alias & Golang to "$HOME"/.bashrc.."
sleep 1
configfile="$HOME"/.bashrc
if grep -q /go/bin/ "$configfile"; then
echo -e "[$GREEN+$RESET] .bashrc contains the correct lines."
else
echo export GOPATH='$HOME'/go >>"$HOME"/.bashrc
echo export GOROOT=/usr/local/go >>"$HOME"/.bashrc
echo export PATH='$PATH:$HOME'/go/bin/ >>"$HOME"/.bashrc
echo export PATH='$PATH:$GOROOT'/bin >>"$HOME"/.bashrc
echo export PATH='$PATH:$HOME'/.local/bin >>"$HOME"/.bashrc
echo "alias recon=$HOME/ReconPi/recon.sh" >>"$HOME"/.bashrc
echo export LANGUAGE=en_US.UTF-8 >>"$HOME"/.bashrc
echo export LANG=en_US.UTF-8 >>"$HOME"/.bashrc
echo export LC_ALL=en_US.UTF-8 >>"$HOME"/.bashrc
fi
bash /etc/profile.d/golang_path.sh
source "$HOME"/.bashrc
cd "$HOME" || return
echo -e "[$GREEN+$RESET] Golang has been configured."
}
: 'Golang tools'
golangTools() {
echo -e "[$GREEN+$RESET] Installing subfinder.."
if [ -e "$HOME"/go/bin/subfinder ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/projectdiscovery/subfinder/cmd/subfinder
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing subjack.."
if [ -e "$HOME"/go/bin/subjack ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get github.com/haccer/subjack
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing aquatone.."
if [ -e "$HOME"/go/bin/aquatone ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/michenriksen/aquatone
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing httprobe.."
if [ -e "$HOME"/go/bin/httprobe ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/httprobe
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing assetfinder.."
if [ -e "$HOME"/go/bin/assetfinder ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/assetfinder
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing meg.."
if [ -e "$HOME"/go/bin/meg ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/meg
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing tojson.."
if [ -e "$HOME"/go/bin/tojson ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/hacks/tojson
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing unfurl.."
if [ -e "$HOME"/go/bin/unfurl ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/unfurl
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing anew.."
if [ -e "$HOME"/go/bin/anew ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/anew
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing waybackurls.."
if [ -e "$HOME"/go/bin/waybackurls ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get github.com/tomnomnom/waybackurls
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing qsreplace.."
if [ -e "$HOME"/go/bin/qsreplace ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/tomnomnom/qsreplace
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing ffuf (Fast web fuzzer).."
if [ -e "$HOME"/go/bin/ffuf ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/ffuf/ffuf
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing gobuster.."
if [ -e "$HOME"/go/bin/gobuster ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get github.com/OJ/gobuster
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing Amass.."
if [ -e "$HOME"/go/bin/amass ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get github.com/OWASP/Amass
export GO111MODULE=on
cd "$HOME"/go/src/github.com/OWASP/Amass || return
go install ./...
export GO111MODULE=off
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing getJS.."
if [ -e "$HOME"/go/bin/getJS ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
go get -u github.com/003random/getJS
echo -e "[$GREEN+$RESET] Done."
fi
}
: 'Additional tools'
additionalTools() {
echo -e "[$GREEN+$RESET] Installing massdns.."
if [ -e /usr/local/bin/massdns ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/blechschmidt/massdns.git
cd "$HOME"/tools/massdns || return
echo -e "[$GREEN+$RESET] Running make command for massdns.."
make -j
sudo cp "$HOME"/tools/massdns/bin/massdns /usr/local/bin/
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing jq.."
sudo apt install -y jq
echo -e "[$GREEN+$RESET] Done."
echo -e "[$GREEN+$RESET] Installing Chromium browser.."
sudo apt install -y chromium-browser
echo -e "[$GREEN+$RESET] Done."
echo -e "[$GREEN+$RESET] Installing masscan.."
if [ -e /usr/local/bin/masscan ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/robertdavidgraham/masscan
cd "$HOME"/tools/masscan || return
make -j
sudo cp bin/masscan /usr/local/bin/masscan
sudo apt install libpcap-dev -y
cd "$HOME"/tools/ || return
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing Corsy (CORS Misconfiguration Scanner).."
if [ -e "$HOME"/tools/Corsy/corsy.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/s0md3v/Corsy.git
cd "$HOME"/tools/Corsy || return
sudo pip3 install -r requirements.txt
cd "$HOME"/tools/ || return
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing dirsearch.."
if [ -e "$HOME"/tools/dirsearch/dirsearch.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/maurosoria/dirsearch.git
cd "$HOME"/tools/ || return
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing XSStrike (XSS Scanner).."
if [ -e "$HOME"/tools/XSStrike/xsstrike.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/s0md3v/XSStrike.git
cd "$HOME"/tools/XSStrike || return
pip3 install -r requirements.txt --user
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing Arjun (HTTP parameter discovery suite).."
if [ -e "$HOME"/tools/Arjun/arjun.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/s0md3v/Arjun.git
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing Diggy (Extract Endpoints).."
if [ -e "$HOME"/tools/Diggy/diggy.sh ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/s0md3v/Diggy.git
cd "$HOME"/tools/Diggy || return
sudo bash install.sh
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing Dnsgen .."
if [ -e "$HOME"/tools/dnsgen/setup.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/ProjectAnte/dnsgen
cd "$HOME"/tools/dnsgen || return
pip3 install -r requirements.txt --user
sudo python3 setup.py install
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing sublert.."
if [ -e "$HOME"/tools/sublert/sublert.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
git clone https://github.com/yassineaboukir/sublert.git
cd "$HOME"/tools/sublert || return
sudo apt-get install -y libpq-dev dnspython psycopg2 tld termcolor
pip3 install -r requirements.txt --user
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing LinkFinder.."
# needs check
if [ -e "$HOME"/tools/LinkFinder/linkfinder.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/GerbenJavado/LinkFinder.git
cd "$HOME"/tools/LinkFinder || return
pip3 install -r requirements.txt --user
sudo python3 setup.py install
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing bass.."
# needs check
if [ -e "$HOME"/tools/bass/bass.py ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/Abss0x7tbh/bass.git
cd "$HOME"/tools/bass || return
sudo pip3 install tldextract
pip3 install -r requirements.txt --user
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing interlace.."
if [ -e /usr/local/bin/interlace ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/codingo/Interlace.git
cd "$HOME"/tools/Interlace || return
sudo python3 setup.py install
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing nmap.."
if [ -e /usr/bin/nmap ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
sudo apt-get install -y nmap
echo -e "[$GREEN+$RESET] Done."
fi
echo -e "[$GREEN+$RESET] Installing SecLists.."
if [ -e "$HOME"/tools/Seclists/Discovery ]; then
echo -e "[$GREEN+$RESET] Already installed."
else
cd "$HOME"/tools/ || return
git clone https://github.com/danielmiessler/SecLists.git
echo -e "[$GREEN+$RESET] Done."
fi
}
: 'Dashboard setup'
setupDashboard() {
echo -e "[$GREEN+$RESET] Installing Nginx.."
sudo apt-get install -y nginx
sudo nginx -t
echo -e "[$GREEN+$RESET] Done."
cd /var/www/html/ || return
sudo chmod -R 755 .
# setup index.html??
}
: 'Finalize'
finalizeSetup() {
echo -e "[$GREEN+$RESET] Finishing up.."
displayLogo
cd "$HOME" || return
echo "reconpi" > hostname
sudo mv hostname /etc/hostname
touch motd
displayLogo >>motd
sudo mv "$HOME"/motd /etc/motd
cd "$HOME" || return
echo -e "[$GREEN+$RESET] Installation script finished! System will reboot to finalize installation."
sleep 1
sudo reboot
}
: 'Execute the main functions'
displayLogo
basicRequirements
golangInstall
golangTools
additionalTools
setupDashboard
finalizeSetup