-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinstall.sh
executable file
·297 lines (294 loc) · 14.5 KB
/
install.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
#!/bin/bash
RED=`tput setaf 1`
GREEN=`tput setaf 2`
YELLOW=`tput setaf 3`
BLUE=`tput setaf 4`
MAGENTA=`tput setaf 5`
CYAN=`tput setaf 6`
NC=`tput sgr0`
wul=`tput smul`
check_exist() {
if command -v "$1" >/dev/null 2>&1; then
return 0
elif [ -d "$1" ] || [ -e "$1" ]; then
return 0
else
return 1
fi
}
dependency_installer(){
if ! check_exist pv; then
apt-get install -y pv &>/dev/null
fi
if ! check_exist ipcalc; then
apt-get install -y ipcalc &>/dev/null
fi
if ! check_exist go; then
echo "${YELLOW}[*] Installing go ${NC}"
./goinstaller.sh
echo "${GREEN}[*] Rerun install.sh${NC}"
fi
if ! check_exist knockknock; then
echo "${YELLOW}[*] Installing knockknock ${NC}"
go install github.com/harleo/knockknock@latest > /dev/null 2>/dev/null | pv -p -t -e -N "Installing Tool: knockknock" >/dev/null
fi
if ! check_exist python3; then
echo "${YELLOW}[*] Installing python3 ${NC}"
apt install python3 -y > /dev/null 2>/dev/null | pv -p -t -e -N "Installing Tool: python3" >/dev/null
fi
if ! check_exist pip; then
echo "${YELLOW}[*] Installing python3-pip ${NC}"
apt install python3-pip -y > /dev/null 2>/dev/null | pv -p -t -e -N "Installing Tool: python3-pip" >/dev/null
fi
if ! check_exist whois; then
echo "${YELLOW}[*] Installing whois ${NC}"
apt install whois -y > /dev/null 2>/dev/null | pv -p -t -e -N "Installing Tool: Whois" >/dev/null
fi
if ! check_exist git; then
echo "${YELLOW}[*] Installing git ${NC}"
apt install git -y 2>/dev/null | pv -p -t -e -N "Installing Tool: git" >/dev/null
fi
if ! check_exist jq; then
echo "${YELLOW}[*] Installing jq ${NC}"
apt install jq -y 2>/dev/null | pv -p -t -e -N "Installing Tool: jq" >/dev/null
fi
if ! check_exist tmux; then
echo "${YELLOW}[*] Installing TMUX ${NC}"
apt install tmux -y 2>/dev/null | pv -p -t -e -N "Installing Tool: TMUX" >/dev/null
fi
if ! check_exist batcat; then
echo "${YELLOW}[*] Installing BatCat ${NC}"
apt install bat -y 2>/dev/null | pv -p -t -e -N "Installing Tool: BatCat" >/dev/null
fi
if ! check_exist dalfox; then
echo "${YELLOW}[*] Installing dalfox ${NC}"
go install github.com/hahwul/dalfox/v2@latest > /dev/null 2>/dev/null | pv -p -t -e -N "Installing Tool: dalfox" >/dev/null
fi
if ! check_exist lolcat; then
echo "${YELLOW}[*] Installing lolcat ${NC}"
apt install lolcat -y 2>/dev/null | pv -p -t -e -N "Installing Tool: lolcat" >/dev/null
[ -e /usr/games/lolcat ] && mv /usr/games/lolcat /usr/local/bin/
fi
if ! check_exist nmap; then
echo "${YELLOW}[*] Installing nmap ${NC}"
apt install nmap -y 2>/dev/null | pv -p -t -e -N "Installing Tool: nmap" >/dev/null
fi
if ! check_exist asnmap; then
echo "${YELLOW}[*] Installing ASNmap ${NC}"
go install github.com/projectdiscovery/asnmap/cmd/asnmap@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: ASNmap" >/dev/null
fi
if ! check_exist mapcidr; then
echo "${YELLOW}[*] Installing mapCIDR ${NC}"
go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: mapCIDR" >/dev/null
fi
if ! check_exist xsltproc; then
echo "${YELLOW}[*] Installing xsltproc ${NC}"
apt install xsltproc -y 2>/dev/null | pv -p -t -e -N "Installing Tool: xsltproc" >/dev/null
fi
if ! check_exist dirsearch; then
echo "${YELLOW}[*] Installing dirsearch ${NC}"
apt install dirsearch -y 2>/dev/null | pv -p -t -e -N "Installing Tool: dirsearch" >/dev/null
fi
if ! check_exist ffuf; then
echo "${YELLOW}[*] Installing FFUF ${NC}"
go install github.com/ffuf/ffuf/v2@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: FFUF" >/dev/null
fi
if ! check_exist csvcut; then
echo "${YELLOW}[*] Installing csvkit ${NC}"
apt install csvkit -y 2>/dev/null | pv -p -t -e -N "Installing Tool: csvkit" >/dev/null
fi
if ! check_exist subfinder; then
echo "${YELLOW}[*] Installing Subfinder ${NC}"
go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: subfinder" >/dev/null
fi
if ! check_exist gau; then
echo "${YELLOW}[*] Installing gau${NC}"
go install github.com/lc/gau/v2/cmd/gau@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: gau" >/dev/null
fi
if ! check_exist waybackurls; then
echo "${YELLOW}[*] Installing waybackurls ${NC}"
go install github.com/tomnomnom/waybackurls@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: waybackurls" >/dev/null
fi
if ! check_exist httpx; then
echo "${YELLOW}[*] Installing httpx ${NC}"
rm "$(which httpx)" 2>/dev/null
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: httpx" >/dev/null
fi
if ! check_exist tlsx; then
echo "${YELLOW}[*] Installing TLSx ${NC}"
go install github.com/projectdiscovery/tlsx/cmd/tlsx@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: TLSx" >/dev/null
fi
if ! check_exist alterx; then
echo "${YELLOW}[*] Installing AlterX ${NC}"
go install github.com/projectdiscovery/alterx/cmd/alterx@latest > /dev/null 2>&1 | pv -p -t -e -N "Installing Tool: AlterX"
fi
if ! check_exist dnsx; then
echo "${YELLOW}[*] Installing DNSx ${NC}"
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest > /dev/null 2>&1 | pv -p -t -e -N "Installing Tool: DNSx"
fi
if ! check_exist anew; then
echo "${YELLOW}[*] Installing anew ${NC}"
go install github.com/tomnomnom/anew@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: anew" >/dev/null
fi
if ! check_exist gf; then
echo "${YELLOW}[*] Installing gf ${NC}"
go install github.com/tomnomnom/gf@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: gf" >/dev/null
git clone https://github.com/1ndianl33t/Gf-Patterns ~/.gf > /dev/null 2>&1
fi
if ! check_exist qsinject; then
echo "${YELLOW}[*] Installing qsinject ${NC}"
go install github.com/ameenmaali/qsinject@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: qsinject" >/dev/null
fi
if ! check_exist qsreplace; then
echo "${YELLOW}[*] Installing qsreplace ${NC}"
go install github.com/tomnomnom/qsreplace@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: qsreplace" >/dev/null
fi
if ! check_exist subjack; then
echo "${YELLOW}[*] Installing subjack ${NC}"
go install github.com/haccer/subjack@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: subjack" >/dev/null
fi
if ! check_exist webanalyze; then
echo "${YELLOW}[*] Installing webanalyze ${NC}"
go install github.com/rverton/webanalyze/cmd/webanalyze@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: webanalyze" >/dev/null
fi
if ! check_exist nuclei; then
echo "${YELLOW}[*] Installing nuclei ${NC}"
go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: nuclei" >/dev/null
nuclei -update
fi
if ! check_exist dmut; then
echo "${YELLOW}[*] Installing dmut ${NC}"
go install github.com/bp0lr/dmut@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: dmut" >/dev/null
dmut --update-files &>/dev/null
fi
if ! check_exist nuclei; then
echo "${YELLOW}[*] Installing nuclei ${NC}"
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: nuclei"
nuclei -update &>/dev/null
nuclei -ut &>/dev/null
fi
if ! check_exist naabu; then
echo "${YELLOW}[*] Installing naabu ${NC}"
# go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: Naabu" &>/dev/null
# If Naabu is not getting installed by below command, download the compiled binary from official naabu github release page.
go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: naabu" >/dev/null
#rm "$(which naabu)" 2>/dev/null
#wget https://github.com/projectdiscovery/naabu/releases/download/v2.1.0/naabu_2.1.0_linux_amd64.zip -P ./MISC/naabu &>/dev/null
if ! check_exist unzip; then
apt install unzip -y &>/dev/null
fi
#unzip ./MISC/naabu/naabu_2.1.0_linux_amd64.zip -d ./MISC/naabu/ &>/dev/null
#mv ./MISC/naabu/naabu /usr/local/bin &>/dev/null
sudo apt install libpcap0.8-dev libuv1-dev -y &>/dev/null
fi
if ! check_exist interlace; then
echo "${YELLOW}[*] Installing Interlace ${NC}"
[ ! -e ./MISC/Interlace/ ] && git clone https://github.com/codingo/Interlace.git ./MISC/Interlace/ 2>/dev/null | pv -p -t -e -N "Installing Tool: Interlace" &>/dev/null
[ ! -e ./MISC/Interlace/ ] && pip3 install -r ./MISC/Interlace/requirements.txt --break-system-packages > /dev/null 2>&1
apt install python3-netaddr python3-tqdm -y > /dev/null 2>&1
cd ./MISC/Interlace/ && python3 setup.py install > /dev/null 2>&1
cd -
fi
if ! check_exist ansi2html; then
echo "${YELLOW}[*] Installing ansi2html ${NC}"
pip3 install ansi2html --break-system-packages &>/dev/null
sudo apt install colorized-logs &>/dev/null
fi
if ! check_exist shodan; then
echo "${YELLOW}[*] Installing Shodan ${NC}"
pip3 install shodan --break-system-packages > /dev/null 2>&1
fi
if ! check_exist subjs; then
echo "${YELLOW}[*] Installing Subjs ${NC}"
go install -v github.com/lc/subjs@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: subjs" &>/dev/null
fi
if ! check_exist katana; then
echo "${YELLOW}[*] Installing Katana ${NC}"
go install github.com/projectdiscovery/katana/cmd/katana@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: katana" &>/dev/null
fi
if ! check_exist uncover; then
echo "${YELLOW}[*] Installing Uncover ${NC}"
go install -v github.com/projectdiscovery/uncover/cmd/uncover@latest 2>/dev/null | pv -p -t -e -N "Installing Tool: Uncover" &>/dev/null
fi
if ! check_exist ccze; then
echo "${YELLOW}[*] Installing CCZE ${NC}"
#apt install ccze -y 2>/dev/null | pv -p -t -e -N "Installing Tool: ccze" &>/dev/null
cp ./MISC/ccze /usr/local/bin/ && chmod +x /usr/local/bin/ccze
fi
if ! check_exist ./MISC/LinkFinder; then
git clone https://github.com/GerbenJavado/LinkFinder.git ./MISC/LinkFinder &>/dev/null
pip3 install -r ./MISC/LinkFinder/requirements.txt --break-system-packages &>/dev/null
python3 ./MISC/LinkFinder/setup.py install &>/dev/null
fi
if ! check_exist ./MISC/SecretFinder; then
echo "${YELLOW}[*] Installing SecretFinder ${NC}"
git clone https://github.com/m4ll0k/SecretFinder.git ./MISC/SecretFinder &>/dev/null
pip3 install -r ./MISC/SecretFinder/requirements.txt --break-system-packages &>/dev/null
fi
if ! check_exist ./MISC/waymore; then
echo "${YELLOW}[*] Installing WayMore ${NC}"
pip3 install pyyaml tldextract --break-system-packages &>/dev/null
git clone https://github.com/xnl-h4ck3r/waymore.git ./MISC/waymore &>/dev/null
python3 ./MISC/waymore/setup.py install &>/dev/null
apt install python3-termcolor -y &>/dev/null
fi
if ! check_exist trufflehog; then
echo "${YELLOW}[*] Installing Trufflehog ${NC}"
wget https://github.com/trufflesecurity/trufflehog/releases/download/v3.31.2/trufflehog_3.31.2_linux_amd64.tar.gz -P /tmp/ &>/dev/null
[ ! -e /usr/local/bin/trufflehog ] && tar -xvf /tmp/trufflehog* -C /usr/local/bin/ &>/dev/null
[ ! -e /usr/local/bin/trufflehog ] && chmod +x /usr/local/bin/trufflehog*
fi
if ! check_exist ./MISC/xnLinkFinder; then
echo "${YELLOW}[*] Installing xnLinkFinder ${NC}"
git clone https://github.com/xnl-h4ck3r/xnLinkFinder.git ./MISC/xnLinkFinder &>/dev/null
python3 ./MISC/xnLinkFinder/setup.py install &>/dev/null
fi
if ! check_exist ./MISC/fuzzing-templates; then
echo "${YELLOW}[*] Installing xnLinkFinder ${NC}"
git clone https://github.com/projectdiscovery/fuzzing-templates.git ./MISC/fuzzing-templates &>/dev/null
fi
check_exist "/usr/share/dirb/wordlists/dicc.txt" || wget -q https://raw.githubusercontent.com/maurosoria/dirsearch/master/db/dicc.txt -P /usr/share/dirb/wordlists/
check_exist "./MISC/fingerprints.json" || wget -q https://raw.githubusercontent.com/haccer/subjack/master/fingerprints.json -P ./MISC/
check_exist "./MISC/technologies.json" || wget -q https://raw.githubusercontent.com/rverton/webanalyze/master/technologies.json -P ./MISC/
check_exist "$HOME/.gf/excludeExt.json" || cp ./MISC/excludeExt.json "$HOME/.gf/"
}
required_tools=("pv" "go" "python3" "ccze" "uncover" "tmux" "git" "pip" "knockknock" "subfinder" "ipcalc" "asnmap" "naabu" "dnsx" "httpx" "csvcut" "dmut" "dirsearch" "ffuf" "shodan" "nuclei" "nmap" "ansi2html" "xsltproc" "trufflehog" "anew" "interlace" "subjs" "katana" "alterx" "dalfox")
required_directories=(
"./MISC/LinkFinder"
"./MISC/SecretFinder"
"./MISC/waymore"
"./MISC/xnLinkFinder"
"./MISC/fuzzing-templates"
"./MISC/fingerprints.json"
"./MISC/technologies.json"
"$HOME/.gf/excludeExt.json"
"/usr/share/dirb/wordlists/dicc.txt"
)
missing_tools=()
for tool in "${required_tools[@]}"; do
if ! check_exist "$tool"; then
missing_tools+=("$tool")
echo "Dependency ${RED}$tool${NC} not found..."
else
echo "Installed ${GREEN}$tool${NC}"
fi
done
for directory in "${required_directories[@]}"; do
if ! check_exist "$directory"; then
echo "${YELLOW}[*] Required Directory ${NC}$directory${YELLOW} does not exist.${NC}"
missing_tools+=("$directory")
echo "Dependency ${RED}$directory${NC} not found..."
else
echo "Installed ${GREEN}$directory${NC}"
fi
done
if [ ${#missing_tools[@]} -ne 0 ]; then
echo -e ""
echo -e "${RED}[-]The following tools are not installed:${NC} ${missing_tools[*]}"
dependency_installer
echo -e "${MAGENTA}\n[-]Re-Run the Installation script to check what else pending...$0 \n${NC}"
exit 1
else
echo -e "${CYAN}${wul}\nAll Good - JOD\n${NC}"
exec "$SHELL" && exit
fi