-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
111 lines (93 loc) · 3.18 KB
/
startup.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
#!/bin/sh
# TODO: install pip?, rm gnome-software?, install golang?, install wallpapers?, install docker?, install zmap?, install hcxtools?, install bettercap?, install eaphammer?, install gowitness?, install man-spider?, install bloodhound?, install PCredz?, install EavesARP?, install CrackMapExec?, install Impacket?
# TODO: initializing metasploit database?
# TODO: unzipping RockYou
# TODO: BurpSuite Pro?
# TODO: Firefox Add-Ons?
# TODO: https://github.com/blacklanternsecurity/kali-setup-script/blob/master/kali-setup-script.sh
message() {
tput setaf 2
echo "-=-=-=-=-=[ $1 ]=-=-=-=-=-"
tput sgr0
}
reset() {
rm -f "$HOME/.Xmodmap"
sudo rm -f '/usr/local/bin/hx'
rm -rf "${XDG_CONFIG_HOME:-$HOME/.config}/helix"
}
error() {
stty echo
tput setaf 1
echo '-=-=-=-=-=[ Error ]=-=-=-=-=-'
tput sgr0
reset
exit 1
}
sudo -v || {
echo 'Incorrect password.'
exit 1
}
trap error 1 2 3 6
reset
message 'Changing passwords'
echo 'New password: \c'
stty -echo
read -r password
stty echo
echo
echo "root:$password" | sudo chpasswd
echo "kali:$password" | sudo chpasswd
# sudo adduser "$username"
# sudo usermod -aG sudo "$username"
# sudo usermod -L kali
message 'Installing Guest Additions'
sudo mount '/dev/cdrom' '/media/kali'
sudo '/media/cdrom/VBoxLinuxAdditions.run'
message 'Updating'
export DEBIAN_FRONTEND='noninteractive'
sudo apt update -qqy
sudo apt upgrade -qqy
sudo apt autoremove -qqy
sudo apt dist-upgrade -qqy
message 'Installing kernel headers'
sudo apt install "linux-headers-$(uname -r)"
message 'Installing drivers'
sudo apt install realtek-rtl88xxau-dkms -qqy
message 'Adding keymaps'
grep -q '^bindkey '\''^?'\''' "$HOME/.zshrc" || sed -i '/backward-kill-line/a bindkey '\''^?'\'' backward-kill-word # ctrl + delete' "$HOME/.zshrc"
echo 'keycode 66 = Escape' > "$HOME/.Xmodmap"
xmodmap "$HOME/.Xmodmap"
message 'Creating build directory'
playground="$(mktemp -d)"
message 'Installing Nerd Font'
fonts="$HOME/.local/share/fonts"
wget -qO "$playground/FiraCode.zip" 'https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip'
mkdir -p "$fonts" && unzip -od "$fonts" "$playground/FiraCode.zip"
fc-cache -fv
message 'Installing editor'
while true; do
printf "1) Neovim\n2) Helix\n\nSelect: "
read -r choice
case "$choice" in
1)
sudo apt install 'neovim'
git clone 'https://github.com/LazyVim/starter' "${XDG_CONFIG_HOME:-$HOME/.config}/nvim"
rm -rf "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/.git"
;;
2)
version='24.07-x86_64-linux'
wget -qO "$playground/helix.tar.xz" "https://github.com/helix-editor/helix/releases/latest/download/helix-$version.tar.xz"
tar -xf "$playground/helix.tar.xz" -C "$playground"
sudo mv "$playground/helix-$version/hx" '/usr/local/bin'
mv -f "$playground/helix-$version/runtime" "${XDG_CONFIG_HOME:-$HOME/.config}/helix"
wget -qO "${XDG_CONFIG_HOME:-$HOME/.config}/helix/config.toml" 'https://raw.githubusercontent.com/ignamartinoli/kali/master/config.toml'
;;
*)
continue
;;
esac
break
done
message 'Setting wallpaper'
xfconf-query -c 'xfce4-desktop' -p '/backdrop/screen0/monitorVirtual1/workspace0/last-image' -s '/usr/share/backgrounds/kali-16x9/kali-metal-dark.png'
message 'Setup finished'