-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_basic.sh
318 lines (263 loc) · 7.98 KB
/
run_basic.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
#!/bin/bash
#INICIO DO GERA LOG DE TUDO
LOGFILE="/root/vps_config.log"
exec > >(tee -a $LOGFILE) 2>&1
#FIM DO GERA LOG DE TUDO ################################################
#VALIDA VERSAO DO LINUX
LINUXRELEASE=$(lsb_release -d | awk '{print $2,$3}')
if [[ $LINUXRELEASE =~ "Ubuntu 23." ]]; then
PIPCOMMAND="pip install --break-system-packages"
else
PIPCOMMAND="pip install"
fi
#INICIO DE INSTALACAO DE PRE-REQUISITOS #################################
setupEnvironment() {
#Cores
#========================================
#https://www.shellhacks.com/bash-colors/
RED='\e[31m'
GREEN='\e[32m'
CYAN='\e[36m'
PURPLE='\e[35m'
YELLOW='\e[33m'
NC='\e[0m' # No Color
#========================================
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
LOCALPATH=$(pwd)
TOOLSPATH="/opt/tools"
WLPATH="/opt/wordlists"
DIRBINPATH="/usr/local/bin"
#Diretorio de ferramentas
mkdir /opt/tools
#Diretorios de wordlists
mkdir /opt/wordlists
#Configurando timezone
timedatectl set-timezone America/Sao_Paulo
}
setupOSRequirements (){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
#Installing packages
apt update
apt dist-upgrade -y
apt install -y \
brutespray \
ca-certificates \
curl \
default-jre \
dos2unix \
fonts-powerline \
git \
gnupg2 \
golang \
gpg \
grepcidr \
gzip \
htop \
inetutils-ping \
john \
jq \
libpcap-dev \
locate \
masscan \
net-tools \
nmap \
p7zip \
prips \
python3-pip \
python-is-python3 \
ruby-dev \
snap \
sqlmap \
tmux \
vim \
vim-nox \
zip \
zsh
}
# setupGolang () {
# GODIR=/usr/local
# echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
# #Installing newer GO
# #https://miek.nl/2020/july/17/script-to-upgrade-to-latest-go-version/
# local LATEST=$(curl -s 'https://go.dev/dl/?mode=json' | jq -r '.[0].version')
# local INSTALLED=$(go version | awk '{ print $3 }')
# if ! command -v go ; then
# echo -e "${RED}Installing Go version ${LATEST}"
# local GOLANG=https://dl.google.com/go/${LATEST}.linux-amd64.tar.gz
# local TAR=$(basename $GOLANG)
# ( cd ${GODIR}
# echo Downloading and extracting: $GOLANG
# wget -q $GOLANG && tar xvfz ${TAR}
# )
# else
# if [[ ${INSTALLED} == ${LATEST} ]]; then
# echo Go is up to date, running ${LATEST} >&2
# exit 0
# fi
# echo Upgrading Go from ${INSTALLED} to ${LATEST} >&2
# local GOLANG=https://dl.google.com/go/${LATEST}.linux-amd64.tar.gz
# local TAR=$(basename $GOLANG)
# ( cd ${GODIR}
# echo Downloading and extracting: $GOLANG >&2
# wget -q $GOLANG && rm -rf go && tar xvfz ${TAR}
# )
# fi
# export PATH=$PATH:/usr/local/go/bin
# export GOPATH=/root/go
# export GOCACHE=/root/go/cache
# go version
# # Adiciona ao .bashrc e o .zshrc ao export
# echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.bashrc
# echo 'export GOPATH=/root/go' >> /root/.bashrc
# echo 'export GOCACHE=/root/go/cache' >> /root/.bashrc
# echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.zshrc
# echo 'export GOPATH=/root/go' >> /root/.zshrc
# echo 'export GOCACHE=/root/go/cache' >> /root/.zshrc
#}
#FIM DE INSTALACAO DE PRE-REQUISITOS #################################
#INICIO DE INSTALAÇÃO DE FERRAMENTAS #################################
Anew(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/tomnomnom/anew@latest
}
ffuf(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/ffuf/ffuf@latest
}
GoogleChrome(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install ./google-chrome-stable_current_amd64.deb -y
}
Gowitness(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/sensepost/gowitness@latest
}
Httprobe(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/tomnomnom/httprobe@latest
}
Httpx(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
}
JSScanner(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
cd ${TOOLSPATH}
git clone https://github.com/0x240x23elu/JSScanner.git
cd JSScanner
$PIPCOMMAND -r requirements.txt
chmod +x JSScanner.py
ln -s ${TOOLSPATH}/JSScanner/JSScanner.py ${DIRBINPATH}/jsscanner
}
JsubFinder(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install github.com/ThreatUnkown/jsubfinder@latest
wget https://raw.githubusercontent.com/ThreatUnkown/jsubfinder/master/.jsf_signatures.yaml && mv .jsf_signatures.yaml ~/.jsf_signatures.yaml
}
Metasploit(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
cd /tmp
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/metasploit-framework.gpg.key | sudo apt-key add -
sudo sh -c 'echo "deb http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid main" > /etc/apt/sources.list.d/metasploit-framework.list'
sudo apt update
sudo apt install -y metasploit-framework
msfupdate
}
Naabu(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest
}
Notify(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/projectdiscovery/notify/cmd/notify@latest
}
Nuclei(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
~/go/bin/nuclei -update-templates
}
sslscan(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
apt install sslscan
}
Telegram-Send(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
$PIPCOMMAND telegram-send
}
TurboSearch(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
$PIPCOMMAND --upgrade turbosearch
}
wafw00f(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
cd ${TOOLSPATH}
git clone https://github.com/EnableSecurity/wafw00f
cd wafw00f
python3 setup.py install
}
WPScan(){
echo -e "${RED}[+]${FUNCNAME[0]}${NC}"
gem install wpscan
}
#FIM DE INSTALAÇÃO DE FERRAMENTAS #################################
#INICIO DE CONFIGURACOES FINAIS #################################
PosInstalacao(){
if [ -d "/root/go/bin" ]; then
echo -e "${RED}[+]Moving files from /root/go/bin to ${DIRBINPATH}${NC}"
mv /root/go/bin/* ${DIRBINPATH}
elif [ -d "/go/bin" ]; then
echo -e "${RED}[+]Moving files from /go/bin to ${DIRBINPATH}${NC}"
mv /go/bin/* ${DIRBINPATH}
elif [ -d "/home/$SUDO_USER/go/bin" ]; then
echo -e "${RED}[+]Moving files from /home/$SUDO_USER/go/bin to ${DIRBINPATH}${NC}"
mv /home/$SUDO_USER/go/bin/* ${DIRBINPATH}
else
echo -e "${RED}[+]Moving go binary not executed. Nothing to do.${NC}"
fi
## Resolvendo problema da chave depreciada
cd /tmp
wget http://apt.metasploit.com/metasploit-framework.gpg.key
gpg --no-default-keyring --keyring ./metasploit-framework_keyring.gpg --import metasploit-framework.gpg.key
gpg --no-default-keyring --keyring ./metasploit-framework_keyring.gpg --export > ./metasploit-framework.gpg
mv ./metasploit-framework.gpg /etc/apt/trusted.gpg.d/
echo -e "${GREEN}[+] DONE${NC}"
}
#FIM DE CONFIGURACOES FINAIS #################################
callRequirements(){
setupEnvironment
setupOSRequirements
#setupGolang
}
callInstallTools(){
Anew
ffuf
GoogleChrome
Gowitness
Httprobe
Httpx
JSScanner
JsubFinder
Metasploit
Naabu
Notify
Nuclei
sslscan
Telegram-Send
TurboSearch
wafw00f
WPScan
}
callPosInstalacao(){
PosInstalacao
}
#Root or Sudoer verifying.
if [[ $(id -u) != 0 ]]; then
echo -e "\n[!] Script precisa ser executado como sudoer ou root!"
exit 0
else
callRequirements
#callInstallTools
#callPosInstalacao
fi