-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
340 lines (316 loc) · 10.4 KB
/
deploy.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
#!/bin/bash
echo -ne '
-------------------------------------------------
----------------------ABOUT----------------------
-------------------------------------------------
Offensive security deployment script to establish
a base tool set and file structure for efficiency
on penetration testing and red teaming engagements.
-------------------------------------------------
This script is written for debian-based systems
and is meant to be a general, high-level deployment
script to establish a base set of tooling which can
then be expanded upon according to specific
engagement/mission needs.
-------------------------------------------------
The script installs general utilities/QoL tools,
offsec tooling, compilers, and other useful tools
-------------------------------------------------
The script is written using principles of OOP in
order to be versatile and modular. Setup,
environment, and general tooling are required
for the other functions to work.
-------------------------------------------------
-----------------JEREMY LARATRO-----------------
-------------------------------------------------
'
parse(){
if [ $# -eq 0 ]; then
help
return 1
fi
while getopts ainwplrch opt; do
case $opt in
a) all="SET";;
i) web_tools="SET";;
n) network_tools="SET";;
w) windows_tools="SET";;
p) post_exploitation_tools="SET";;
l) wordlists="SET";;
c) cloud="SET";;
r) reverse_engineering_tools="SET";;
s) rf_sdr_tools="SET";;
h) help="SET";;
?) echo "Unknown option: -$OPTARG"; help; return 1;;
esac
done
# Check if the flags are set
if [ "$all" = "SET" ]; then
echo -ne "
All categories selected\n"
setup
file_struct
environment
general_tools
web_tools
windows_tools
network_tools
wordlists
reverse_engineering_tools
post_exploitation_tools
cloud
rf_sdr_tools
fi
if [ "$web_tools" = "SET" ]; then
echo -ne "
Web tools flag is set\n"
setup
file_struct
environment
general_tools
web_tools
fi
if [ "$network_tools" = "SET" ]; then
echo -ne "
Network tools selected\n"
setup
file_struct
environment
general_tools
network_tools
fi
if [ "$windows_tools" = "SET" ]; then
echo -ne "
Windows tools selected\n"
setup
file_struct
environment
general_tools
windows_tools
fi
if [ "$cloud" = "SET" ]; then
echo -ne "Cloud tools selected\n"
setup
file_struct
environment
cloud
fi
if [ "$post_exploitation_tools" = "SET" ]; then
echo -ne "Post-exploitation tools selected\n"
setup
file_struct
environment
general_tools
post_exploitation_tools
fi
if [ "$wordlists" = "SET" ]; then
echo -ne "
Wordlists flag selected\n"
setup
file_struct
environment
general_tools
wordlists
fi
if [ "$reverse_engineering_tools" = "SET" ]; then
echo -ne "
Reverse engineering tools selected\n"
setup
file_struct
environment
general_tools
reverse_engineering_tools
fi
if [ "$rf_sdr_tools" = "SET" ]; then
echo -ne "
RF-SDR tools selected\n"
setup
file_struct
environment
general_tools
rf_sdr_tools
fi
if [ "$help" = "SET" ]; then
echo -ne "
Help selected\n"
help
fi
}
#--------------------------
# Help
#--------------------------
help(){
echo '
-------------------------------------------------
--------------------Switches---------------------
-------------------------------------------------
web tools: -i --web
network tools: -n --network
windows tools: -w --windows
post-exploitation tools: -p --post
wordlists: -l --wordlists
cloud: -c --cloud
reverse engineering tools: -r --reverse
rf-sdr tools: -s --rf-sdr
-------------------------------------------------
'
echo "
-------------------------------------------------
-----------------Function Calls------------------
-------------------------------------------------
--------------------Required---------------------
-------------------------------------------------
-- setup
-- file_struct
-- environment
-- general_tools
-------------------------------------------------
--------------------Optional---------------------
-------------------------------------------------
-- web_tools
-- windows_tools
-- wordlists
-- reverse_engineering_tools
-- post_exploitation_tools
-- cloud
-- rf_sdr_tools
-------------------------------------------------
"
}
#--------------------------
# Setup
#--------------------------
setup() {
for i in $(seq 1 10); do echo -n "---"; sleep 0.05; done; echo -ne "\nCreating a directory/file structure for organization\n"; for i in $(seq 1 10); do echo -n "---"; sleep 0.05; done;
mkdir ~/Documents/tools
mkdir ~/Documents/scripts
mkdir ~/Documents/labs
mkdir ~/Documents/wordlists
mkdir ~/Documents/screenshots
}
#--------------------------
# Exports
#--------------------------
file_struct(){
for i in $(seq 1 10); do echo -n "---"; sleep 0.05; done; echo -ne "\nExporting directories for easy access\n"; for i in $(seq 1 10); do echo -n "---"; sleep 0.05; done;
export tools=~/Documents/tools
export scripts=~/Documents/scripts
export labs=~/Documents/labs
export wordlists=~/Documents/wordlists
}
#--------------------------
# Environment
#--------------------------
environment() {
echo -ne 'Using Python:' $(ls /usr/bin/python* | grep python | head -1)
export current_category='environment utilities'
loop
sudo apt install zsh sudo sh-autosuggestions zsh-syntax-highlighting
echo '-----------------------------'
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
curl https://pyenv.run | bash
echo $0;
if [[ $0 == *bash* ]]; then
echo 'tools=~/Documents/tools' >> ~/.bashrc
echo 'scripts=~/Documents/scripts' >> ~/.bashrc
echo 'labs=~/Documents/labs' >> ~/.bashrc
echo 'wordlists=~/Documents/wordlists' >> ~/.bashrc
sudo echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
sudo echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
sudo echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
elif [[ $0 == *zsh* ]]; then
echo 'tools=~/Documents/tools' >> ~/.zshrc
echo 'scripts=~/Documents/scripts' >> ~/.zshrc
echo 'labs=~/Documents/labs' >> ~/.zshrc
echo 'wordlists=~/Documents/wordlists' >> ~/.zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc
else
echo "Manual config for pyenv may be necessary"
fi
}
# --------------------------------
# General
#--------------------------
general_tools(){
export current_category='general tools, utilities, and compilers'
loop
sudo apt update
sudo apt install docker.io golang-go geany aptitude ruby gcc g++ clang rust-all cmake flameshot python-is-python3 perl p7zip-full
python3 -m pip install pipx
}
#--------------------------
# Kali APT Key and Repo
#--------------------------
kali_keychain(){
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com ED444FF07D8D0BF6
echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" | sudo tee /etc/apt/sources.list.d/kali.list
sudo apt update
}
#--------------------------
# Web
#--------------------------
web_tools() {
export current_category='web tools'
loop
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
go install github.com/OJ/gobuster/v3@latest
go install github.com/jaeles-project/gospider@latest
go install github.com/ffuf/ffuf/v2@latest
gem install wpscan --user-install
cd $tools && mkdir web; cd web && git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git; cd sqlmap/
sudo ln -s $(pwd)/sqlmap.py /usr/local/bin/sqlmap
cd $tools/web
git clone https://github.com/urbanadventurer/WhatWeb.git; cd WhatWeb/
sudo ln -s $(pwd)/whatweb /usr/local/bin/whatweb
cd $tools/web
git clone https://github.com/darkoperator/dnsrecon.git
wget https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
}
#--------------------------
# Windows EXE Tools
#--------------------------
windows_tools(){
export current_category='windows tools'
loop
cd $tools && mkdir windows ; cd $tools/windows
git clone https://github.com/lgandx/Responder ; cd $tools/Responder ; pip install -r requirements.txt
sudo ln -s $(pwd)/Responder.py /usr/local/bin/responder
cd $tools/windows
wget https://github.com/RedTeamPentesting/pretender/releases/download/v1.2.0/pretender_Linux_x86_64.tar.gz ; tar -xzvf pretender_Linux_x86_64.tar.gz
chmod +x pretender
sudo ln -s $(pwd)/pretender /usr/local/bin/pretender
cd $tools/windows
pip install impacket ldapdomaindump pyopenssl pycryptodomex crosslinked
gem install evil-winrm --user-install
cd $tools/windows
wget https://github.com/ropnop/kerbrute/releases/download/v1.0.3/kerbrute_linux_amd64 -O kerbrute
chmod +x kerbrute
sudo ln -s $(pwd)/kerbrute /usr/local/bin/kerbrute
go install github.com/jpillora/chisel@latest
git clone https://github.com/dirkjanm/krbrelayx.git
git clone https://github.com/cnotin/SplunkWhisperer2.git
git clone https://github.com/andrew-d/static-binaries.git
git clone https://github.com/topotam/PetitPotam.git
git clone https://github.com/wh0amitz/PetitPotato.git
git clone https://github.com/peass-ng/PEASS-ng.git
git clone https://github.com/k4sth4/Juicy-Potato.git
git clone https://github.com/Leo4j/Invoke-ADEnum.git
pip install impacket ldapdomaindump pyopenssl pycryptodomex crosslinked
gem install evil-winrm --user-install
}
#--------------------------
# RF-SDR Tools
#--------------------------
rf_sdr_tools(){
export current_category='rf-sdr tools'
loop
sudo apt install gnuradio hackrf rtl-sdr gqrx-sdr urh bladerf osmosdr airspy soapysdr-tools kalibrate-rtl qspectrumanalyzer inspectrum kalibrate-hackrf srslte
cd $tools && mkdir rf-sdr
git clone https://github.com/f4exb/sdrangel.git $tools/rf-sdr/sdrangel
git clone https://github.com/daniestevez/gr-satellites.git $tools/rf-sdr/gr-satellites
}
parse "$@"