-
Notifications
You must be signed in to change notification settings - Fork 0
/
total-recon.sh
323 lines (289 loc) · 10.5 KB
/
total-recon.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
#!/bin/bash
show_menus() {
clear
echo -e "${GREEN}\
####### ######
# #### ##### ## # # # ###### #### #### # #
# # # # # # # # # # # # # # ## #
# # # # # # # ###### ##### # # # # # #
# # # # ###### # # # # # # # # # #
# # # # # # # # # # # # # # # ##
# #### # # # ###### # # ###### #### #### # #
${SET}"
echo -e "${CYAN}TotalRecon will install all the recon tools you need${SET}"
echo "Tools:"
echo " 0. Install dependencies [GO, Python3, Ruby, Rust, Chromium, etc]"
echo " 1. Fast web fuzzer (ffuf)"
echo " 2. Dirsearch"
echo " 3. Findomain"
echo " 4. Httprobe"
echo " 5. Masscan"
echo " 6. Nmap"
echo " 7. Sublist3r"
echo " 8. WhatWeb"
echo " 9. Subjack"
echo " 10. Amass"
echo " 11. Waybackurls"
echo " 12. Meg"
echo " 13. GitGraber"
echo " 14. getJS"
echo " 15. LinkFinder"
echo " 16. MassDNS"
echo " 17. EyeWitness"
echo -e "\n\n 88. Install all tools"
echo -e " 99. Exit\n"
}
read_option(){
local choice
read -p "Enter choice [ 1 - 99] " choice
case $choice in
0) install_dependencies ;;
1) install_ffuf ;;
2) install_dirsearch ;;
3) install_findomain ;;
4) install_httprobe ;;
5) install_masscan ;;
6) install_nmap ;;
7) install_sublist3r ;;
8) install_whatweb ;;
9) install_subjack ;;
10) install_amass ;;
11) install_waybackurls;;
12) install_meg ;;
13) install_gitGraber ;;
14) install_getjs ;;
15) install_linkfinder ;;
16) install_massdns ;;
17) install_eyewitness ;;
88) install_all ;;
99) exit 0;;
*) echo -e "${RED}Error...${SET}" && sleep 2
esac
}
pause(){
read -p "Press [Enter] key to continue..." fackEnterKey
}
load_colors() {
# https://www.shellhacks.com/bash-colors/
DARKGRAY='\033[1;30m'
RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHTPURPLE='\033[1;35m'
CYAN='\033[0;36m'
WHITE='\033[1;37m'
SET='\033[0m'
}
install_dependencies() {
echo -e "${GREEN}Installing tools' dependencies ${SET}"
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y golang-go build-essential python3 python3-dev wget unzip chromium-browser gcc make libpcap-dev python3-pip ruby-full
sudo ln -s /usr/bin/python3 /usr/bin/python
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
echo -e "${YELLOW}Finished installing tools' dependencies ${SET}\n"
pause
}
install_ffuf() {
# https://github.com/ffuf/ffuf
echo -e "${GREEN}Installing Fast web fuzzer (ffuf) ${SET}"
go get -u github.com/ffuf/ffuf
sudo cp $HOME/go/bin/ffuf /usr/local/bin
echo -e "${YELLOW}Finished installing Fast web fuzzer (ffuf) ${SET}\n"
pause
}
install_findomain() {
# https://github.com/Edu4rdSHL/findomain
echo -e "${GREEN}Installing findomain ${SET}"
git clone https://github.com/Edu4rdSHL/findomain.git $HOME/tools/findomain
cd $HOME/tools/findomain && cargo build --release && sudo cp $HOME/tools/findomain/target/release/findomain /usr/local/bin
sudo rm -r $HOME/tools/findomain
echo -e "${YELLOW}Finished installing findomain ${SET}\n"
pause
}
install_dirsearch() {
echo -e "${GREEN}Installing dirsearch ${SET}"
git clone https://github.com/maurosoria/dirsearch.git $HOME/tools/dirsearch
add_to_path dirsearch
ln -sf $HOME/tools/dirsearch/dirsearch.py $HOME/tools/dirsearch/dirsearch && chmod +x $HOME/tools/dirsearch/dirsearch
echo -e "${YELLOW}Finished installing dirsearch ${SET}\n"
pause
}
install_aquatone() {
# https://github.com/michenriksen/aquatone
echo -e "${GREEN}Installing aquatone ${SET}"
wget https://github.com/michenriksen/aquatone/releases/download/v1.7.0/aquatone_linux_amd64_1.7.0.zip -O $HOME/tools/aquatone.zip
cd $HOME/tools && unzip aquatone.zip -d $HOME/tools/aquatone && sudo cp $HOME/tools/aquatone/aquatone /usr/local/bin
sudo rm -r $HOME/tools/aquatone && rm $HOME/tools/aquatone.zip
echo -e "${YELLOW}Finished installing aquatone ${SET}\n"
pause
}
install_httprobe() {
# https://github.com/tomnomnom/httprobe
echo -e "${GREEN}Installing httprobe ${SET}"
go get -u github.com/tomnomnom/httprobe
sudo cp $HOME/go/bin/httprobe /usr/local/bin
echo -e "${YELLOW}Finished installing httprobe ${SET}\n"
pause
}
install_masscan() {
# https://github.com/robertdavidgraham/masscan
echo -e "${GREEN}Installing masscan ${SET}"
git clone https://github.com/robertdavidgraham/masscan $HOME/tools/masscan
cd $HOME/tools/masscan && make -j && sudo cp $HOME/tools/masscan/bin/masscan /usr/local/bin
sudo rm -r $HOME/tools/masscan
echo -e "${YELLOW}Finished installing masscan ${SET}\n"
pause
}
install_sublist3r() {
# https://github.com/aboul3la/Sublist3r
echo -e "${GREEN}Installing sublist3r ${SET}"
git clone https://github.com/aboul3la/Sublist3r.git $HOME/tools/sublist3r
pip3 install --no-cache-dir --install-option="--prefix=/install" -r $HOME/tools/sublist3r/requirements.txt
add_to_path sublist3r
ln -sf $HOME/tools/sublist3r/sublist3r.py $HOME/tools/sublist3r/sublist3r && chmod +x $HOME/tools/sublist3r/sublist3r
echo -e "${YELLOW}Finished installing sublist3r ${SET}\n"
pause
}
install_whatweb() {
# https://github.com/urbanadventurer/WhatWeb
echo -e "${GREEN}Installing WhatWeb ${SET}"
git clone https://github.com/urbanadventurer/WhatWeb.git $HOME/tools/whatweb
cd $HOME/tools/whatweb && sudo gem install bundler && bundle install
add_to_path whatweb
echo -e "${YELLOW}Finished installing WhatWeb ${SET}\n"
pause
}
install_subjack() {
# https://github.com/haccer/subjack
echo -e "${GREEN}Installing Subjack ${SET}"
go get github.com/haccer/subjack
sudo cp $HOME/go/bin/subjack /usr/local/bin
echo -e "${YELLOW}Finished installing Subjack ${SET}\n"
pause
}
install_amass() {
# https://github.com/OWASP/Amass
echo -e "${GREEN}Installing Amass ${SET}"
go get -u github.com/OWASP/Amass/...
sudo cp $HOME/go/bin/amass /usr/local/bin
echo -e "${YELLOW}Finished installing Amass ${SET}\n"
pause
}
install_nmap() {
# https://github.com/OWASP/Amass
echo -e "${GREEN}Installing Nmap ${SET}"
sudo apt-get install -y nmap
echo -e "${YELLOW}Finished installing Nmap ${SET}\n"
pause
}
install_waybackurls() {
# https://github.com/tomnomnom/waybackurls
echo -e "${GREEN}Installing Waybackurls ${SET}"
go get github.com/tomnomnom/waybackurls
sudo cp $HOME/go/bin/waybackurls /usr/local/bin
echo -e "${YELLOW}Finished installing Waybackurls ${SET}\n"
pause
}
install_meg() {
# https://github.com/tomnomnom/meg
echo -e "${GREEN}Installing Meg ${SET}"
go get github.com/tomnomnom/meg
sudo cp $HOME/go/bin/meg /usr/local/bin
echo -e "${YELLOW}Finished installing Meg ${SET}\n"
pause
}
install_gitGraber() {
# https://github.com/hisxo/gitGraber.git
echo -e "${GREEN}Installing gitGraber ${SET}"
git clone https://github.com/hisxo/gitGraber.git $HOME/tools/gitGraber
cd $HOME/tools/gitGraber && pip3 install -r requirements.txt
echo -e "\n\n${RED}Run this tool from ${HOME}/tools/gitGraber ${SET}\n"
echo -e "${YELLOW}Finished installing gitGraber ${SET}\n"
pause
}
install_getjs() {
# https://github.com/003random/getJS
echo -e "${GREEN}Installing getJS ${SET}"
go get github.com/003random/getJS
sudo cp $HOME/go/bin/getJS /usr/local/bin
echo -e "${YELLOW}Finished installing getJS ${SET}\n"
pause
}
install_linkfinder() {
# https://github.com/GerbenJavado/LinkFinder
echo -e "${GREEN}Installing LinkFinder ${SET}"
git clone https://github.com/GerbenJavado/LinkFinder.git $HOME/tools/LinkFinder
pip3 install --no-cache-dir --install-option="--prefix=/install" -r $HOME/tools/LinkFinder/requirements.txt
add_to_path LinkFinder
ln -sf $HOME/tools/LinkFinder/linkfinder.py $HOME/tools/LinkFinder/linkfinder && chmod +x $HOME/tools/LinkFinder/linkfinder
echo -e "${YELLOW}Finished installing LinkFinder ${SET}\n"
pause
}
install_massdns() {
# https://github.com/blechschmidt/massdns
echo -e "${GREEN}Installing MassDNS ${SET}"
git clone https://github.com/blechschmidt/massdns.git $HOME/tools/massdns
cd $HOME/tools/massdns && sudo make && sudo cp $HOME/tools/massdns/bin/massdns /usr/local/bin
echo -e "${YELLOW}Finished installing MassDNS ${SET}\n"
pause
}
install_eyewitness() {
# https://github.com/FortyNorthSecurity/EyeWitness
echo -e "${GREEN}Installing EyeWitness ${SET}"
git clone https://github.com/FortyNorthSecurity/EyeWitness.git $HOME/tools/eyewitness
cd $HOME/tools/eyewitness/setup && sudo ./setup.sh
echo -e "\n\n${RED}Run this tool from ${HOME}/tools/eyewitness - [./EyeWitness.py -h] ${SET}\n"
echo -e "${YELLOW}Finished installing EyeWitness ${SET}\n"
pause
}
add_to_path() {
if [[ ":$PATH:" == *":$HOME/tools/$1:"* ]] || grep -q "$HOME/tools/$1" $HOME/.bash_profile; then
echo -e "${RED}$1 dir already in path${SET}"
else
PATH_EXPORT=$(sed -n "/export PATH/p" ~/.bash_profile)
if [ -z "$PATH_EXPORT" ]; then
PATH_EXPORT=$PATH:$HOME/tools/$1
echo $PATH_EXPORT
echo "export PATH=${PATH_EXPORT}" >> $HOME/.bash_profile && source $HOME/.bash_profile
else
PATH_EXPORT=$(sed -n "/export PATH/p" ~/.bash_profile):$HOME/tools/$1
echo $PATH_EXPORT
sed -i '/^export PATH/d' $HOME/.bash_profile > $HOME/.bash_profile
echo "export PATH=${PATH_EXPORT}" >> $HOME/.bash_profile && source $HOME/.bash_profile
fi
echo -e "${GREEN}Added $1 to PATH ${SET}"
fi
}
install_all () {
install_ffuf
install_findomain
install_dirsearch
install_aquatone
install_httprobe
install_masscan
install_sublist3r
install_whatweb
install_subjack
install_amass
install_nmap
install_waybackurls
install_meg
install_gitGraber
install_getjs
install_linkfinder
install_massdns
install_eyewitness
pause
}
trap '' SIGINT SIGQUIT SIGTSTP
while true
do
load_colors
show_menus
read_option
done