-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathignition.sh
More file actions
322 lines (259 loc) · 8.37 KB
/
Copy pathignition.sh
File metadata and controls
322 lines (259 loc) · 8.37 KB
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
#!/bin/bash
# Ignition Script - Kali Linux Configuration
# Automates system prep, package installation, shell customization, and more.
set -e # Exit immediately if a command exits with a non-zero status.
# --- Global Variables ---
USER="kali"
HOME="/home/${USER}"
# --- Colours for Output ---
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
YELLOW="\033[0;33m"
NC="\033[0m" # No Colour
# --- Logging Badges ---
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
# --- Check for sudo ---
if [ "$EUID" -ne 0 ]; then
log_error "Please run as root (sudo ./ignition.sh)"
exit 1
fi
# --- Banner ---
banner() {
echo ""
echo "Kali Linux Configuration Script"
echo ""
}
## --- Package Installs ---
# --- System Prep & Utility Packages ---
system_prep() {
log_info "System Preparation & Package Installation..."
log_info "Updating package lists..."
apt update
log_info "Installing utility packages (grc, colorize, bat)..."
apt install -y grc colorize bat
log_success "Task Complete: Utility packages installed."
}
# --- GRC Configuration Setup ---
grc_config() {
log_info "grc configuration setup..."
log_info "Creating required directory..."
TARGET_DIR="${HOME}/.grc"
mkdir -p "$TARGET_DIR"
log_info "Copying configurations..."
# base grc config
cat "configs/grc/grc.conf" >> "$TARGET_DIR/grc.conf"
# ffuf config
cp "configs/grc/conf.ffuf" "$TARGET_DIR/"
log_success "Task Complete: grc configuration complete."
}
# --- Git Install ---
git_install() {
log_info "Installing Git..."
if command -v git &> /dev/null; then
log_warn "Git is already installed. Skipping..."
else
apt install -y git
log_success "Task Complete: Git installed."
fi
}
# --- Eza Install ---
eza_install() {
if command -v eza &> /dev/null; then
log_warn "eza is already installed. Skipping..."
return
fi
log_info "Installing eza dependencies and setting up repository..."
apt install -y gpg sudo
mkdir -p /etc/apt/keyrings
if [ ! -f /etc/apt/keyrings/gierens.gpg ]; then
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
fi
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | tee /etc/apt/sources.list.d/gierens.list
chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
apt update
apt install -y eza
log_success "Task Complete: Eza installed."
}
# --- Oh My Zsh Install ---
omz_install() {
log_info "Oh My Zsh Installation..."
# Check if ZSH is installed
if ! command -v zsh &> /dev/null; then
apt install -y zsh
fi
# Check if OMZ is already installed
if [ -d "${HOME}/.oh-my-zsh" ]; then
log_warn "Oh My Zsh is already installed. Skipping..."
else
# Unattended install
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
log_success "Task Complete: Oh-My-Zsh installed."
}
# --- Zsh Plugins ---
zsh_plugins() {
log_info "Installing Zsh Plugins..."
ZSH_CUSTOM=${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}
# zsh-autosuggestions
if [ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
else
log_warn "zsh-autosuggestions already exists. Skipping clone."
fi
# zsh-syntax-highlighting
if [ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
else
log_warn "zsh-syntax-highlighting already exists. Skipping clone."
fi
log_success "Task Complete: Zsh plugins installed."
}
# --- Zsh Configuration ---
zshrc_config() {
log_info "Configuring .zshrc..."
CONFIG_ZSHRC="$(dirname "$0")/configs/.zshrc"
if [ ! -f "$CONFIG_ZSHRC" ]; then
log_error "Configuration file not found: $CONFIG_ZSHRC"
exit 1
fi
# Back up existing .zshrc
if [ -f "${HOME}/.zshrc" ]; then
cp --force "${HOME}/.zshrc" "${HOME}/.zshrc.bak.$(date +%F-%T)"
log_info "Backed up existing .zshrc"
fi
cp --force "$CONFIG_ZSHRC" "${HOME}/.zshrc"
log_success "Task Complete: .zshrc copied from configs."
}
# --- TMUX Configuration ---
tmux_config() {
log_info "Configuring .tmux.conf..."
CONFIG_TMUX="$(dirname "$0")/configs/.tmux.conf"
if [ ! -f "$CONFIG_TMUX" ]; then
log_error "Configuration file not found: $CONFIG_TMUX"
exit 1
fi
cp --force "$CONFIG_TMUX" "${HOME}/.tmux.conf"
log_success "Task Complete: .tmux.conf copied from configs."
}
# --- TMUX PLugins ---
tmux_plugins() {
log_info "Installing tmux plugins..."
# Install Tmux Package Manager
if [ ! -d "${HOME}/.tmux/plugins/tpm" ]; then
git clone https://github.com/tmux-plugins/tpm "$HOME/.tmux/plugins/tpm"
log_success "tpm plugin installed."
else
log_warn "tpm already installed. Skipping..."
fi
log_info "Fetching plugins..."
# Start a detached session to ensure the server stays alive
tmux new-session -d -s "temp_install"
# Run the TPM installer
"${HOME}/.tmux/plugins/tpm/bin/install_plugins"
# Source the config file
tmux source-file "${HOME}/.tmux.conf"
# Kill the temp session
tmux kill-session -t "temp_install"
log_success "All tmux plugins installed and sourced."
}
# --- Shell Setup ---
shell_setup() {
log_info "Changing default shell to zsh..."
chsh -s $(which zsh)
log_success "Task Complete: Default shell changed to zsh."
}
# --- OpenVPN Install ---
openvpn_install() {
log_info "Installing OpenVPN..."
if command -v openvpn &> /dev/null; then
log_warn "OpenVPN is already installed. Skipping..."
else
apt install -y openvpn
log_success "Task Complete: OpenVPN installed."
fi
}
# --- Flameshot Install ---
flameshot_install() {
log_info "Installing Flameshot..."
if command -v flameshot &> /dev/null; then
log_warn "Flameshot is already installed. Skipping..."
else
apt install -y flameshot
log_success "Task Complete: Flameshot installed."
fi
}
## --- Wordlist Downloads ---
# --- Rockyou Download ---
rockyou_download() {
log_info "Downloading Rockyou..."
if [ -f "/usr/share/wordlists/rockyou.txt" ]; then
log_warn "Rockyou is already downloaded. Skipping..."
elif [ -f "/usr/share/wordlists/rockyou.txt.gz" ]; then
log_warn "Rockyou is already downloaded. Unzipping..."
gunzip "/usr/share/wordlists/rockyou.txt.gz"
log_success "Task Complete: Rockyou unzipped."
else
wget -O "/usr/share/wordlists/rockyou.txt.gz" https://weakpass.com/download/90/rockyou.txt.gz
log_success "Task Complete: Rockyou downloaded."
gunzip "/usr/share/wordlists/rockyou.txt.gz"
log_success "Task Complete: Rockyou unzipped."
fi
}
# --- SecLists Download ---
seclists_download() {
log_info "Downloading SecLists..."
if [ -d "/usr/share/wordlists/SecLists" ]; then
log_warn "SecLists is already downloaded. Skipping..."
else
git clone https://github.com/danielmiessler/SecLists.git /usr/share/wordlists/SecLists
log_success "Task Complete: SecLists downloaded."
fi
}
# --- Complete Banner ---
end_banner() {
log_success "INSTALLATION COMPLETE!"
log_info "Killing tmux server... "
log_warn "3"
sleep 1
log_warn "2"
sleep 1
log_warn "1"
sleep 1
tmux kill-server
log_info "Closing terminal... "
log_warn "3"
sleep 1
log_warn "2"
sleep 1
log_warn "1"
sleep 1
exit
}
# --- Main Execution ---
main() {
# --- Banner ---
banner
# --- Package Installs ---
system_prep
grc_config
git_install
eza_install
omz_install
zsh_plugins
zshrc_config
tmux_config
tmux_plugins
shell_setup
openvpn_install
flameshot_install
# --- Wordlist Downloads ---
rockyou_download
seclists_download
# --- Complete Banner ---
end_banner
}
main