-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_pentest_tools
executable file
·296 lines (262 loc) · 13.7 KB
/
install_pentest_tools
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
#!/usr/bin/env bash
# TODO
# https://github.com/hakluke
# https://github.com/lc
# https://github.com/projectdiscovery
# https://github.com/tomnomnom
# https://github.com/six2dez/reconftw/blob/main/install.sh
# https://thibaud-robin.fr/articles/docker-kali
# https://github.com/s-h-3-l-l/katoolin3
# https://twitter.com/ScriptKKiddie/status/1428080120997294083
#SETUP
if [[ $1 == '-u' ]]; then
WGETOPTS="-N" # only download if version is newer
else
WGETOPTS="--no-clobber" #only download if file does not exist
fi
source "$HOME"/.bash_functions
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
#END SETUP
DEB_PKGS=(
2to3
cewl
checksec
dnsenum
dnsrecon
dsniff
edb-debugger
fcrackzip
fping
hashcat
hydra
john
masscan
ncat
net-tools
netcat-traditional
nikto
nmap
python2
python3-impacket
rlwrap
smbclient
smbmap
socat
sqlmap
sshpass
sshuttle
wfuzz
)
echo "Installation apt"
sudo apt-get -y install "${DEB_PKGS[@]}" >/dev/null
if ! dpkg-query -W -f='${Status}' metasploit-framework >/dev/null; then
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb >/tmp/msfinstall &&
chmod 755 /tmp/msfinstall &&
/tmp/msfinstall
fi
if [[ ! -d /opt/john-jumbo ]]; then
sudo apt-get install -y libbz2-dev libpcap-dev >/dev/null
sudo git clone --depth 1 https://github.com/magnumripper/JohnTheRipper /opt/john-jumbo
sudo chown -R "$USER" /opt/john-jumbo
gita add /opt/john-jumbo
cd /opt/john-jumbo/src && sudo ./configure && sudo make -s clean && sudo make -sj4
if [[ $1 == '-u' ]]; then
gita pull /opt/john-jumbo
cd /opt/john-jumbo/src && sudo ./configure && sudo make -s clean && sudo make -sj4
fi
fi
if ! dpkg-query -W -f='${Status}' stegseek >/dev/null; then
wget -q "$(curl -sL https://api.github.com/repos/RickdeJager/stegseek/releases/latest | jq -r '.assets[].browser_download_url')" \
-O /tmp/stegseek.deb && sudo apt-get install -y /tmp/stegseek.deb >/dev/null
fi
sudo gem install wpscan evil-winrm --no-doc --no-document >/dev/null
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/cwinfosec/revshellgen/master/revshellgen.py -O /usr/local/bin/revshellgen.py &&
sudo chmod +x /usr/local/bin/revshellgen.py
sudo mkdir -p /opt/wordlists && sudo chown "$USER" /opt/wordlists
sudo chgrp sudo /opt && sudo chmod g+rwx /opt
if [[ ! -d /opt/wordlists/SecLists ]]; then
echo "Clone SecLists"
git clone -q --depth 1 https://github.com/danielmiessler/SecLists.git /opt/wordlists/SecLists
gita add /opt/wordlists/SecLists
fi
if [[ ! -f /opt/wordlists/rockyou.txt || $1 == '-u' ]]; then
echo "Download Rockyou"
wget "$WGETOPTS" -q https://download.weakpass.com/wordlists/90/rockyou.txt.gz -O /opt/wordlists/rockyou.txt.gz && gunzip -q -f /opt/wordlists/rockyou.txt.gz
fi
echo "Download HoboRules"
wget "$WGETOPTS" -q https://raw.githubusercontent.com/praetorian-inc/Hob0Rules/master/hob064.rule -O /opt/wordlists/hob064.rule
sudo mkdir -p /opt/revshells && sudo chown "$USER" /opt/revshells
if [[ ! -d /opt/revshells/nishang ]]; then
echo "Clone nishang"
git clone -q --depth 1 https://github.com/samratashok/nishang /opt/revshells/nishang
gita add /opt/revshells/nishang
fi
if [[ ! -d /opt/revshells/tennc ]]; then
echo "Clone tennc webshells"
git clone -q --depth 1 https://github.com/tennc/webshell /opt/revshells/tennc
gita add /opt/revshells/tennc
fi
if [[ ! -d /opt/revshells/ivan-sincek-powershell-tcp ]]; then
echo "Clone Ivan Sincek powershells"
git clone -q --depth 1 https://github.com/ivan-sincek/powershell-reverse-tcp /opt/revshells/ivan-sincek-powershell-tcp
gita add /opt/revshells/ivan-sincek-powershell-tcp
fi
if [[ ! -d /opt/revshells/ivan-sincek-php-reverse-shell ]]; then
echo "Clone Ivan Sincek webshells"
git clone -q --depth 1 https://github.com/ivan-sincek/php-reverse-shell /opt/revshells/ivan-sincek-php-reverse-shell
gita add /opt/revshells/ivan-sincek-php-reverse-shell
fi
if [[ ! -d /opt/revshells/phpbash ]]; then
echo "Clone phpbash"
git clone -q --depth 1 https://github.com/Arrexel/phpbash /opt/revshells/phpbash
gita add /opt/revshells/phpbash
fi
echo "Clone PentestMonkey RevShell"
wget "$WGETOPTS" -q https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php -O /opt/revshells/pentestmonkey-revshell.php
if [[ ! -d /opt/weevely3 ]]; then
echo "Clone weevely"
git clone --depth 1 https://github.com/epinna/weevely3 /opt/weevely3
gita add /opt/weevely3
cd /opt/weevely3 && pip3 install -r requirements.txt --upgrade
sudo ln -s /opt/weevely3/weevely.py /usr/local/bin/.
fi
if [[ ! -d /opt/exploitdb ]]; then
echo "installing searchsploit"
git clone --depth 1 https://github.com/offensive-security/exploitdb.git /opt/exploitdb
gita add /opt/exploitdb
sudo ln -sf /opt/exploitdb/searchsploit /usr/local/bin/.
fi
if [[ ! -d /opt/Responder ]]; then
echo "installing Responder"
git clone -q --depth 1 https://github.com/lgandx/Responder /opt/Responder
gita add /opt/Responder
fi
if [[ ! -d /opt/massdns ]]; then
echo "Installing MassDns"
git clone -q --depth 1 https://github.com/blechschmidt/massdns.git /opt/massdns
gita add /opt/massdns
make -C /opt/massdns/ >/dev/null
sudo ln -sf /opt/massdns/bin/massdns /usr/local/bin/.
if [[ $1 == '-u' ]]; then
gita pull /opt/massdns
make -C /opt/massdns/ >/dev/null
fi
fi
echo "Installation go get"
PKGS_GO=(
github.com/ffuf/ffuf
github.com/ropnop/kerbrute
github.com/OJ/gobuster/v3
github.com/hakluke/hakrawler
)
echo "Installation go get"
for PKG in "${PKGS_GO[@]}"; do
/usr/bin/go install "$PKG"@latest
done
PIPX_PKGS=(
arjun
blint
bloodhound
ciphey
crackmapexec
dnsgen
git-dumper
impacket
lsassy
mitmproxy
name-that-hash
pwncat
pwntools
pypykatz
search-that-hash
sublist3r
)
echo "Installation logiciels pipx: " "${PIPX_PKGS[@]}"
for PKG in "${PIPX_PKGS[@]}"; do
if [[ ! -d "$HOME/.local/pipx/venvs/$PKG" ]]; then
pipx install "$PKG" >/dev/null
fi
done
echo "Installation pkgs cargo"
wget -nv https://github.com/epi052/feroxbuster/releases/latest/download/x86_64-linux-feroxbuster.tar.gz -O /tmp/feroxbuster.tgz
tar xzf /tmp/feroxbuster.tgz -C "$HOME"/dra/bin
VERSION=$(lastversion https://github.com/lycheeverse/lychee)
wget https://github.com/lycheeverse/lychee/releases/latest/download/lychee-"$VERSION"-x86_64-unknown-linux-musl.tar.gz -O /tmp/lychee.tgz
tar xzf /tmp/lychee.tgz -C "$HOME"/dra/bin
chmod u+x "$HOME"/dra/bin/*
VERSION=$(lastversion https://github.com/RustScan/RustScan)
wget -q https://github.com/RustScan/RustScan/releases/download/"$VERSION"/rustscan_"$VERSION"_amd64.deb -O /tmp/rustscan.deb
sudo apt-get install -y /tmp/rustscan.deb >/dev/null
NIX_PKGS=(
enum4linux
enum4linux-ng
)
for PKG in "${NIX_PKGS[@]}"; do
if [[ ! -L "$HOME/.nix-profile/bin/$PKG" ]]; then
echo "Installation pkg nix $PKG"
"$HOME"/.nix-profile/bin/nix-env --quiet -i "$PKG" >/dev/null
fi
done
#/opt/binaries
ROOTDIR="/opt/binaries"
LINUXDIR="$ROOTDIR/linux"
WINDOWSDIR="$ROOTDIR/windows"
sudo mkdir -p "$LINUXDIR" "$WINDOWSDIR"
echo "Starting retrieving Linux resources /opt/binaries/linux"
cd "$LINUXDIR" || exit 1
sudo wget "$WGETOPTS" -q "$(github_get_latest_dwd jpillora/chisel linux_amd64)" -O /tmp/chisel_linux_amd64.gz && sudo gunzip -q -k -c /tmp/chisel_linux_amd64.gz >/tmp/chisel64 && sudo mv /tmp/chisel64 .
sudo wget "$WGETOPTS" -q "$(github_get_latest_dwd jpillora/chisel linux_386)" -O /tmp/chisel_linux_386.gz && sudo gunzip -q -k -c /tmp/chisel_linux_386.gz >/tmp/chisel32 && sudo mv /tmp/chisel32 .
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh -O linpeas.sh
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/jondonas/linux-exploit-suggester-2/master/linux-exploit-suggester-2.pl -O linux-exploit-suggester-2.pl
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh -O linux-exploit-suggester.sh
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/sleventyeleven/linuxprivchecker/master/linuxprivchecker.py -O linuxprivchecker.py
sudo wget "$WGETOPTS" -q https://github.com/ernw/static-toolbox/releases/download/nmap-v7.91SVN/nmap-7.91SVN-x86_64-portable.tar.gz
sudo wget "$WGETOPTS" -q https://github.com/ernw/static-toolbox/releases/download/nmap-v7.91SVN/nmap-7.91SVN-x86-portable.tar.gz
sudo wget "$WGETOPTS" -q https://github.com/ernw/static-toolbox/releases/download/socat-v1.7.4.1/socat-1.7.4.1-x86_64 -O socat64
sudo wget "$WGETOPTS" -q https://github.com/ernw/static-toolbox/releases/download/socat-v1.7.4.1/socat-1.7.4.1-x86 -O socat32
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/master/lse.sh -O lse.sh
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/Anon-Exploiter/SUID3NUM/master/suid3num.py -O suid3num.py
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/TH3xACE/SUDO_KILLER/master/extract.sh -O sudo-extractor.sh
sudo wget "$WGETOPTS" -q https://github.com/DominicBreuker/pspy/releases/download/v1.2.0/pspy32s -O pspy32s
sudo wget "$WGETOPTS" -q https://github.com/DominicBreuker/pspy/releases/download/v1.2.0/pspy64s -O pspy64s
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/stealthcopter/deepce/main/deepce.sh -O deepce.sh
sudo chmod a+x "$LINUXDIR"/*
echo "Starting retrieving Windows resources /opt/binaries/windows"
cd "$WINDOWSDIR" || exit 1
sudo wget "$WGETOPTS" -q https://sourceforge.net/projects/unix-utils/files/socat/1.7.3.2/socat-1.7.3.2-1-x86_64.zip/download -O /tmp/socat-1.7.3.2-1-x86_64.zip && sudo unzip -qjo /tmp/socat-1.7.3.2-1-x86_64.zip socat-1.7.3.2-1-x86_64/socat.exe && sudo mv socat.exe socat64.exe
sudo wget "$WGETOPTS" -q https://sourceforge.net/projects/unix-utils/files/socat/1.7.3.2/socat-1.7.3.2-1-i686.zip/download -O /tmp/socat-1.7.3.2-1-i686.zip && sudo unzip -qjo /tmp/socat-1.7.3.2-1-i686.zip socat-1.7.3.2-1-i686/socat.exe && sudo mv socat.exe socat32.exe
sudo wget "$WGETOPTS" -q "$(github_get_latest_dwd jpillora/chisel windows_386)" -O /tmp/chisel_windows_386.gz && sudo gunzip -q -k -c /tmp/chisel_windows_386.gz >/tmp/chisel32.exe && sudo mv /tmp/chisel32.exe .
sudo wget "$WGETOPTS" -q "$(github_get_latest_dwd jpillora/chisel windows)" -O /tmp/chisel_windows_amd64.gz && sudo gunzip -q -k -c /tmp/chisel_windows_amd64.gz >/tmp/chisel64.exe && sudo mv /tmp/chisel64.exe .
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEAS.bat -O winPEAS.bat
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEASany.exe -O winPEASany.exe
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEASany_ofs.exe -O winPEASany_ofs.exe
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEASx64.exe -O winPEASx64.exe
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEASx64_ofs.exe -O winPEASx64_ofs.exe
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEASx86.exe -O winPEASx86.exe
sudo wget "$WGETOPTS" -q https://github.com/carlospolop/PEASS-ng/releases/download/20220306/winPEASx86_ofs.exe -O winPEASx86_ofs.exe
sudo wget "$WGETOPTS" -q https://nmap.org/dist/ncat-portable-5.59BETA1.zip -O /tmp/ncat-portable-5.59BETA1.zip && sudo unzip -qjo /tmp/ncat-portable-5.59BETA1.zip ncat-portable-5.59BETA1/ncat.exe
sudo wget "$WGETOPTS" -q "$(github_get_latest_dwd gentilkiwi/mimikatz mimikatz_trunk.zip)" -O /tmp/mimikatz_trunk.zip && sudo unzip -qu /tmp/mimikatz_trunk.zip -d mimikatz
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/carlospolop/privilege-escalation-awesome-scripts-suite/master/winPEAS/winPEASbat/winPEAS.bat -O winPEAS.bat
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/MScholtes/TechNet-Gallery/master/Powershell%20Webserver/Start-WebServer.ps1 -O Start-WebServer.ps1
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1 -O Invoke-Mimikatz.ps1
sudo wget "$WGETOPTS" -q https://download.sysinternals.com/files/AccessChk.zip -O /tmp/AccessChk.zip && sudo unzip -qo /tmp/AccessChk.zip accesschk*
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/samratashok/ADModule/master/Import-ActiveDirectory.ps1 -O Import-ActiveDirectory.ps1
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1 -O PowerView.ps1
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Collectors/SharpHound.exe -O SharpHound.exe
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Collectors/SharpHound.ps1 -O SharpHound.ps1
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/itm4n/PrivescCheck/master/PrivescCheck.ps1 -O PrivescCheck.ps1
sudo wget "$WGETOPTS" -q https://github.com/r3motecontrol/Ghostpack-CompiledBinaries/raw/master/Rubeus.exe -O Rubeus.exe
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1 -O powercat.ps1
sudo wget "$WGETOPTS" -q https://raw.githubusercontent.com/trustedsec/unicorn/master/unicorn.py -O unicorn.py
sudo wget "$WGETOPTS" -q https://the.earth.li/~sgtatham/putty/latest/w32/plink.exe -O plinkw32.exe
sudo wget "$WGETOPTS" -q https://the.earth.li/~sgtatham/putty/latest/w64/plink.exe -O plinkw64.exe
sudo wget "$WGETOPTS" -q https://github.com/int0x33/nc.exe/raw/master/nc64.exe -O nc64.exe
sudo wget "$WGETOPTS" -q https://github.com/int0x33/nc.exe/raw/master/nc.exe -O nc.exe
sudo wget "$WGETOPTS" -q "$(github_get_latest_dwd hlldz/dazzleUP dazzleUP.x64.exe)"
if [[ ! -d 'SharpCollection' ]]; then
sudo git clone --quiet --depth 1 https://github.com/Flangvik/SharpCollection
if [[ $1 == '-u' ]]; then
cd SharpCollection && sudo git pull --quiet
fi
fi