-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-tools.sh
executable file
·224 lines (185 loc) · 4.15 KB
/
install-tools.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
#!/bin/bash
#install-tools.sh
DOTFILES_DIR="$HOME/dotfiles"
# TOFIX : better usage of "bin" vs "src"
INSTALL_DIR="/usr/local/bin"
SOURCE_DIR="/usr/local/src"
INSTALL_LOCAL="$HOME/.local/bin"
echo "Do you want to install tools ?"
read -p "Continue? [Y/n]" -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "Abort!"
exit 1
fi
install_vim(){
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall
}
install_terminator(){
sudo apt install -y terminator
}
install_virtualenvwrapper(){
pip install virtualenvwrapper
}
install_pwntools(){
sudo apt-get install python2.7 python-pip python-dev git libssl-dev libffi-dev build-essential
pip install --upgrade pwntools
}
install_light(){
cd $INSTALL_DIR
sudo apt install help2man
sudo git clone https://github.com/haikarainen/light
chmod go+x light
cd light
sudo make && sudo make install
}
install_ipython(){
pip install ipython
}
install_basic(){
echo "Installing basic tools"
sudo apt update && sudo apt install -y vim nano tmux screen tree gawk git htop build-essential curl
install_virtualenvwrapper
install_vim
install_ipython
}
install_z(){
echo "Installing z"
cd $INSTALL_DIR
sudo git clone https://github.com/rupa/z
}
install_pwngdb(){
echo "Installing pwndbg"
#ensure gdb is present
sudo apt install -y gdb
cd $INSTALL_LOCAL
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh
}
install_i3(){
echo "Installing i3"
sudo apt install -y i3 i3blocks
sudo ln -sf $DOTFILES_DIR/i3blocks.conf /etc/i3blocks.conf
}
install_go(){
GOVERSION="1.10.3"
GOOS=$(uname -s)
GOARCH="amd64"
mkdir -p $HOME/go/bin $HOME/go/src $HOME/go/pkg
cd $INSTALL_DIR
sudo wget https://dl.google.com/go/go$GOVERSION.$GOOS-$GOARCH.tar.gz
sudo tar -C /usr/local -xzf go$GOVERSION.$GOOS-$GOARCH.tar.gz
#Install dep
# blabla I know the pipe sh thing.
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
}
install_rust(){
curl https://sh.rustup.rs -sSf | sh
}
install_exa(){
sudo apt install cmake
cd $INSTALL_LOCAL
git clone https://github.com/ogham/exa
cd exa
make
sudo make install
}
install_neofetch(){
sudo apt install -y neofetch
}
install_feh(){
sudo apt install -y feh
}
install_docker(){
#blabla know what you'r doing
cd $INSTALL_DIR
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
}
install_gestures(){
sudo apt install -y libinput-tools
cd $INSTALL_DIR
sudo git clone https://github.com/bulletmark/libinput-gestures.git
cd libinput-gestures
sudo make install
}
install_graphical_env(){
install_i3
install_terminator
install_feh
install_neofetch
install_gestures
install_light
}
install_rkhunter(){
sudo apt install -y rkhunter
rkhunter --update
sudo cp $DOTFILES_DIR/rkhunter/rkhunter.service /etc/systemd/system/
sudo cp $DOTFILES_DIR/rkhunter/rkhunter.timer /etc/systemd/system/
}
install_fail2ban(){
sudo apt install -y fail2ban
sudo cp $DOTFILES_DIR/fail2ban/rules.conf /etc/fail2ban/jail.d/rules.conf
sudo fail2ban-client start
sudo fail2ban-client reload
}
install_firewall(){
sudo apt install -y ufw
sudo ufw enable
# better explicit than implicit
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw logging on
}
hardening(){
install_firewall
install_rkhunter
install_fail2ban
}
install_r2(){
cd $SOURCE_DIR
git clone https://github.com/radare/radare2
cd radare2/
sudo sys/install.sh
r2pm install r2dec
}
install_infosec(){
install_r2
install_pwngdb
install_pwntools
}
# just in case, got time to ctrl + c
sleep 3
install_basic
install_docker
install_go
install_z
echo "Do you want to install graphical environment (I3, terminal, gesture, background...)?"
read -p "Continue? [Y/n]" -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Ok"
install_graphical_env
fi
# this is kinda crappy yep.
echo "Do you want to install infosec tools?"
read -p "Continue? [Y/n]" -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Ok"
install_infosec
fi
# this is kinda crappy yep.
echo "Do you want to launch the pseudo-hardening of the system ?"
read -p "Continue? [Y/n]" -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Ok"
hardening
fi