-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpentest_tools_arch.sh
executable file
·440 lines (400 loc) · 12.8 KB
/
pentest_tools_arch.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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
#!/bin/bash
# Functions
FLAG=$((0))
help_module () {
# Help module
echo " ____ _ ____ ___ ____ ____ _____ _ _ _____ _____ ____ _____"
echo "| __ ) / \ / ___|_ _/ ___| | _ \| ____| \ | |_ _| ____/ ___|_ _|"
echo "| _ \ / _ \ \___ \| | | | |_) | _| | \| | | | | _| \___ \ | | "
echo "| |_) / ___ \ ___) | | |___ | __/| |___| |\ | | | | |___ ___) || | "
echo "|____/_/ \_\____/___\____| |_| |_____|_| \_| |_| |_____|____/ |_| "
echo
echo " _____ ___ ___ _ ____ "
echo "|_ _/ _ \ / _ \| | / ___| "
echo " | || | | | | | | | \___ \ "
echo " | || |_| | |_| | |___ ___) |"
echo " |_| \___/ \___/|_____|____/ "
echo " Arch edition"
echo
echo
echo "Usage: ./pentest_tools_arch [ARGS]"
echo " invoking the command without [ARGS] installs the essentials."
echo " Will be prompted if want optional tools"
echo "[ARGS]"
echo " --help Displays this help message"
echo " --setoolkit Installs setoolkit only"
echo " --metasploit Installs metasploit framework only"
echo " --evillimiter Installs evillimiter (https://github.com/bitbrute/evillimiter)"
echo " --wifi Installs the wireless tools"
echo " --wordlists Installs the wordlists in the /opt directory"
echo
echo "For more information about the tools being installed, check out the github page:"
echo " https://github.com/0xcabrex/Pentest-tools "
echo
}
install_msfconsole () {
# Installing metasploit:
if [ $(which msfconsole 2>/dev/null) -e '/usr/bin/msfconsole' ]
then
echo
echo
echo -e "\e[1;33m-[WARNING]\e[0m Metasploit already present.. Skipping."
else
echo
echo
echo -e "\e[1;32m+[OK]\e[0m Installing metasploit module.."
echo -e "\e[1;32m+[OK]\e[0m Installing dependencies.."
yes | sudo pacman -S postgresql-libs ruby ruby-bundler ruby-pg inetutils
mkdir -p /dev/shm/metasploit
mkdir -p /dev/shm/aur_tmp
cd /dev/shm/aur_tmp
git clone https://aur.archlinux.org/metasploit-git.git
echo "Done cloning, changing directory and building package"
sleep 3
cd metasploit-git
yes | makepkg -sri
rm -r /dev/shm/metasploit
echo -e "\e[1;32m+[OK]\e[0m Installed metasploit"
FLAG=$(($FLAG + 1))
fi
}
install_setoolkit () {
# Installing SEToolkit:
if [ $(which setoolkit) == '/usr/local/bin/setoolkit' ]
then
echo
echo
echo -e "\e[1;33m-[WARNING]\e[0m SEToolkit already present.. Skipping."
else
clear
echo -e "\e[1;32m+[OK]\e[0m Installing setoolkit.."
git clone https://github.com/trustedsec/social-engineer-toolkit.git /dev/shm/setoolkit
if [ $(which python3) == 'usr/bin/python3' ]
then
sudo python3 -m pip install -r /dev/shm/setoolkit/requirements.txt
sudo python3 /dev/shm/setoolkit/setup.py
else
yes | sudo pacman -S python3 python-pip
sudo python3 -m pip install -r /dev/shm/setoolkit/requirements.txt
sudo python3 /dev/shm/setoolkit/setup.py
fi
sudo rm -r /dev/shm/setoolkit
echo -e "\e[1;32m+[OK]\e[0m Installed setoolkit successfully"
FLAG=$(($FLAG + 1))
fi
}
install_evillimiter () {
# Installing Evillimiter:
if [ $(which evillimiter) -e '/usr/local/bin/evillimiter' ]
then
echo
echo
echo -e "\e[1;33m-[WARNING]\e[0m Evillimiter already present.. Skipping."
else
echo
echo
echo -e "\e[1;32m+[OK]\e[0m Installing Evillimiter.."
git clone https://github.com/bitbrute/evillimiter.git /dev/shm/evillimiter
if [ $(which python3) == '/usr/bin/python3' ]
then
sudo python3 /dev/shm/evillimiter/setup.py install
sudo rm -r /dev/shm/evillimiter
else
sudo echo -e "\e[1;31m-[FATAL]\e[0m Python not found, installing.."
yes | sudo pacman -S python3 python-pip
sudo python3 /dev/shm/evillimiter/setup.py install
sudo rm -r /dev/shm/evillimiter
fi
echo -e "\e[1;32m+[OK]\e[0m Installed Evillimiter successfully"
FLAG=$(($FLAG + 1))
fi
}
install_wifi_tools () {
# Installing the Wifi tools:
if [ $(which wireshark) == '/usr/bin/wireshark' -a $(which arp-scan) == '/usr/sbin/arp-scan' -a $(which macchanger) == '/usr/bin/macchanger' -a $(which kismet) == '/usr/bin/kismet' -a $(which speedtest-cli) == '/usr/bin/speedtest-cli' -a $(which aircrack-ng) == '/usr/bin/aircrack-ng' ]
then
echo
echo
echo -e "\e[1;33m-[WARNING]\e[0m wireshark, arp-scan, macchanger, kismet, speedtest-cli, aircrack-ng are all installed, Skipping"
else
echo
echo
echo -e "\e[1;32m+[OK]\e[0m Installing wireless tools.."
echo
yes | sudo pacman -S arp-scan macchanger kismet speedtest-cli aircrack-ng
echo
install_evillimiter
echo
# Installing wireshark using aur:
echo -e "\e[1;32m+[OK]\e[0m Making aur_tmp directory.."
mkdir -p /dev/shm/aur_tmp
git clone https://aur.archlinux.org/wireshark-gtk2.git /dev/shm/aur_tmp
cd wireshark-gtk2
yes | sudo pacman -S libmaxminddb
yes | makepkg -sri
FLAG=$(($FLAG + 1))
fi
}
cleanup () {
# Autoclean and autoremove
echo
echo
echo -e "\e[1;32m+[OK]\e[0m Cleaning up.."
sleep 1
echo
yes | sudo pacman -Rscn $(sudo pacman -Qtdq) 2>/dev/null
rm -rf /dev/shm/*
}
install_wordlists () {
# Making common wordlist for gobuster in /opt/wordlist:
echo
echo
if [ -d '/opt' ]
then
echo -e "\e[1;32m+[OK]\e[0m Getting common wordlists for gobuster.. "
echo
echo
sudo mkdir -p /opt/wordlist
sudo mkdir -p /opt/wordlist/dirb
if [ -f "/opt/wordlist/dirb/big.txt" -a -f "/opt/wordlist/dirb/common.txt" -a -f "/opt/wordlist/dirb/small.txt" ]
then
echo "The wordlists have already been installed in the /opt/wordlist/dirb/ directory"
else
sudo wget https://raw.githubusercontent.com/v0re/dirb/master/wordlists/big.txt -O /opt/wordlist/dirb/big.txt
sudo wget https://raw.githubusercontent.com/v0re/dirb/master/wordlists/common.txt -O /opt/wordlist/dirb/common.txt
sudo wget https://raw.githubusercontent.com/v0re/dirb/master/wordlists/small.txt -O /opt/wordlist/dirb/small.txt
FLAG=$(($FLAG + 1))
fi
# Downloading rockyou.txt.gz and extracting it:
echo
echo
echo -e "\e[1;32m+[OK]\e[0m Getting Rockyou.txt.."
echo
echo
if [ -f "/opt/wordlist/rockyou.txt" ]
then
echo -e "Rockyou.txt already exists in /opt/wordlist/ directory"
else
if [ -f "/opt/wordlist/rockyou.txt.gz" ]
then
echo -e "Rockyou.txt.gz already exists in /opt/wordlist/ directory, not Downloading.."
else
sudo wget "https://github.com/praetorian-code/Hob0Rules/blob/master/wordlists/rockyou.txt.gz?raw=true" -O /opt/wordlist/rockyou.txt.gz
fi
sudo gunzip -c /opt/wordlist/rockyou.txt.gz | sudo tee /opt/wordlist/rockyou.txt >/dev/null
sudo rm /opt/wordlist/rockyou.txt.gz
FLAG=$(($FLAG + 1))
fi
else
echo -e "\e[1;31m-[FATAL]\e[0m /opt directory does not exist, please create it manually to install wordlists"
fi
}
# Program
# Breakpoint for reference
if [ $(cat /etc/issue | grep -ic "arch") -ge 1 ]
then
if [ ! -f /usr/bin/which ]
then
sudo pacman -S base-devel
fi
if [ "$1" = '--help' ]
then
help_module
exit
elif [ "$1" = '--setoolkit' ]
then
if [ "$EUID" == 0 ]
then
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Running as root is not adviced, password will be asked when needed"
exit
fi
install_setoolkit
elif [ "$1" = '--metasploit' ]
then
if [ "$EUID" == 0 ]
then
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Running as root is not adviced, password will be asked when needed"
exit
fi
install_msfconsole
elif [ "$1" = '--evillimiter' ]
then
if [ "$EUID" == 0 ]
then
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Running as root is not adviced, password will be asked when needed"
exit
fi
install_evillimiter
elif [ "$1" = '--wordlists' ]
then
if [ "$EUID" == 0 ]
then
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Running as root is not adviced, password will be asked when needed"
exit
fi
install_wordlists
elif [ "$1" = '--wifi' ]
then
if [ "$EUID" == 0 ]
then
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Running as root is not adviced, password will be asked when needed"
exit
fi
install_wifi_tools
elif [ "$1" = '' ]
then
if [ "$EUID" == 0 ]
then
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Running as root is not adviced, password will be asked when needed"
exit
fi
read -p "Do you want to install all tools?(y/n/c): " ANSWER
if [ $ANSWER == 'y' ]
then
echo
echo
echo -e "\e[1;32m+[OK]\e[0m Optional tools will be installed "
echo -e "\e[1;32m+[OK]\e[0m commencing upgrade.."
echo
echo
sleep 1
yes | sudo pacman -Syu
#$(which terminator) == "/usr/bin/terminator" -a
if [ $(which arp-scan) == "/usr/bin/arp-scan" -a $(which wireshark) == "/usr/bin/wireshark" -a $(which macchanger) == "/usr/bin/macchanger" -a $(which speedtest-cli) == "/usr/bin/speedtest-cli" -a $(which hexedit) == "/usr/bin/hexedit" -a $(which objdump) == "/usr/bin/objdump" -a $(which java) == '/usr/bin/java' -a $(which proxychains) == '/usr/bin/proxychains' -a $(which aircrack-ng) == '/usr/bin/aircrack-ng' -a $(which kismet) == '/usr/bin/kismet' ]
then
echo -e "\e[1;33m+[WARNING]\e[0m arp-scan, wireshark, macchanger, speedtest-cli, hexedit, binutils-i586-linux-gnu, default-jdk, proxychains, aircrack-ng, kismet, are already installed"
else
echo -e "\e[1;32m+[OK]\e[0m Installing all tools.."
sleep 1
clear
# echo -e "\e[1;32m+[OK]\e[0m Installing terminator..."
# apt install terminator -y
# clear
echo -e "\e[1;32m+[OK]\e[0m Installing arp-scan..."
yes | sudo pacman -S arp-scan
clear
echo -e "\e[1;32m+[OK]\e[0m Installing tor..."
yes | sudo pacman -S tor
clear
echo -e "\e[1;32m+[OK]\e[0m Installing wireshark..."
yes | sudo pacman -S wireshark
clear
echo -e "\e[1;32m+[OK]\e[0m Installing macchanger..."
yes | sudo pacman -S macchanger
clear
echo -e "\e[1;32m+[OK]\e[0m Installing speedtest-cli..."
yes | sudo pacman -S speedtest-cli
clear
echo -e "\e[1;32m+[OK]\e[0m Installing hexedit..."
yes | sudo pacman -S hexedit
clear
echo -e "\e[1;32m+[OK]\e[0m Installing binutils-i586-linux-gnu..."
yes | sudo pacman -S binutils
clear
echo -e "\e[1;32m+[OK]\e[0m Installing default-jdk..."
yes | sudo pacman -S openjdk
clear
echo -e "\e[1;32m+[OK]\e[0m Installing proxychains..."
yes | sudo pacman -S proxychains-ng
clear
echo -e "\e[1;32m+[OK]\e[0m Installing aircrack-ng..."
yes | sudo pacman -S aircrack-ng
clear
echo -e "\e[1;32m+[OK]\e[0m Installing kismet..."
yes | sudo pacman -S kismet
install_msfconsole
install_setoolkit
install_evillimiter
install_wordlists
FLAG=$(($FLAG + 1))
fi
elif [ $ANSWER == 'n' ]
then
echo
echo -e "\e[1;32m+[OK]\e[0m Optional tools will NOT be installed "
echo -e "\e[1;32m+[OK]\e[0m commencing upgrade.."
sleep 1
echo
echo
yes | sudo pacman -Syu
echo
if [ $(which wget) == '/usr/bin/wget' -a $(which curl) == '/usr/bin/curl' -a $(which nmap) == '/usr/bin/nmap' -a $(which sqlmap) == '/usr/bin/sqlmap' -a $(which git) == '/usr/bin/git' -a $(which nikto) == '/usr/bin/nikto' -a $(which gobuster) == '/usr/bin/gobuster' -a $(which hydra) == '/usr/bin/hydra' ]
then
echo -e "\e[1;33m+[WARNING]\e[0m wget, curl, nmap, sqlmap, git, python3-pip, nikto, gobuster, hydra, have been already instaled"
else
echo -e "\e[1;32m+[OK]\e[0m Installing basic tools.."
sleep 1
clear
echo -e "\e[1;32m+[OK]\e[0m Installing wget...."
yes | sudo pacman -S wget
clear
echo -e "\e[1;32m+[OK]\e[0m Installing curl...."
yes | sudo pacman -S curl
clear
echo -e "\e[1;32m+[OK]\e[0m Installing nmap...."
yes | sudo pacman -S nmap
clear
echo -e "\e[1;32m+[OK]\e[0m Installing sqlmap...."
yes | sudo pacman -S sqlmap
clear
echo -e "\e[1;32m+[OK]\e[0m Installing git...."
yes | sudo pacman -S git
clear
echo -e "\e[1;32m+[OK]\e[0m Installing python3-pip...."
yes | sudo pacman -S python-pip
clear
echo -e "\e[1;32m+[OK]\e[0m Installing nikto...."
yes | sudo pacman -S nikto
clear
echo -e "\e[1;32m+[OK]\e[0m Installing gobuster...."
mkdir -p /dev/shm/aur_tmp
cd /dev/shm/aur_tmp
git clone https://aur.archlinux.org/gobuster-git.git
cd gobuster
yes | makepkg -sri
clear
echo -e "\e[1;32m+[OK]\e[0m Installing hydra...."
yes | sudo pacman -S hydra
FLAG=$(($FLAG + 1))
clear
install_wordlists
fi
elif [ $ANSWER == 'c' ]
then
echo "OK"
exit
else
echo -e "\e[1;31m-[ERROR]\e[0m Please enter y or n"
exit
fi
else
help_module
echo -e "\e[1;31m-[ERROR]\e[0m Invalid argument $1"
exit
fi
else
echo
echo -e "\e[1;31m-[ERROR]\e[0m This script can only run on arch systems. Aborting"
fi
# Breakpoint for reference
if [ $FLAG == 0 ]
then
echo
echo
echo -e "\e[1;33mNo changes were done to your system.\e[0m"
echo
exit
else
cleanup
echo
echo
echo -e "\e[1;32mAll tools have been installed successfully!\e[0m"
echo
exit
fi