-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathgotools-install.sh
More file actions
197 lines (155 loc) · 8.56 KB
/
gotools-install.sh
File metadata and controls
197 lines (155 loc) · 8.56 KB
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
#!/bin/bash
######################################################################
# Requirements:
# -------------------------------------------------------------------
# go
######################################################################
SECONDS=0
# COLORS
red='\033[0;31m'
blue='\033[0;34m'
green='\033[0;32m'
yellow='\033[0;33m'
purple='\033[0;35m'
reset='\033[0m'
function banner(){
echo -e " ____ ____ _____ _ __ _ "
echo -e " / _/___ / __/___ / ___/___ ____ | | / /___ ___________(_)___ _____"
echo -e " / // __ \/ /_/ __ \\__ \/ _ \/ ___/ | | /| / / __ \`/ ___/ ___/ / __ \/ ___/"
echo -e " _/ // / / / __/ /_/ /__/ / __/ /__ | |/ |/ / /_/ / / / / / / /_/ / / "
echo -e "/___/_/ /_/_/ \____/____/\___/\___/ |__/|__/\__,_/_/ /_/ /_/\____/_/ "
echo -e " "
echo -e " github.com/InfoSecWarrior by @ArmourInfosec "
echo -e "\n"
}
function INFO_PRINT(){
echo -e ${blue} [" "INFO" "] ${reset}
}
function WARNING_PRINT(){
echo -e ${yellow} [WARNING] ${reset}
}
function ERROR_PRINT(){
echo -e ${red} [ ERROR ] ${reset}
}
function COMMAND_PRINT(){
echo -e ${green} [COMMAND] ${reset}
}
function NOTIFY_PRINT(){
echo -e ${purple} [NOTIFY ] ${reset}
}
# Check if a binary is installed
function CHECK_BINARY() {
# Check if the binary is installed
if which "$1" &>/dev/null; then
# Binary is installed
# Declare a global variable indicating that the binary is installed
declare -g "${1^^}_INSTALLED"=true
else
# Binary is not installed
# Declare a global variable indicating that the binary is not installed
declare -g "${1^^}_INSTALLED"=false
# Print an error message
echo "$1 is not installed. "
exit
fi
}
banner
######################################################################
# Check REQUIRED BINARYS install or Not
# -------------------------------------------------------------------
# Declare an array of required binary names
REQUIRED_BINARYS=(go)
# For each required binary
for binary in "${REQUIRED_BINARYS[@]}"; do
# Check if the binary is installed
CHECK_BINARY "$binary"
done
echo -e "$(INFO_PRINT) Good! Go installed! "
declare -A all_gotools
# Project Discovery Tools
all_gotools["nuclei"]="go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest &> /dev/null"
all_gotools["subfinder"]="go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest &> /dev/null"
all_gotools["httpx"]="go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest &> /dev/null"
all_gotools["naabu"]="go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest &> /dev/null"
all_gotools["notify"]="go install -v github.com/projectdiscovery/notify/cmd/notify@latest &> /dev/null"
all_gotools["dnsx"]="go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest &> /dev/null"
all_gotools["interactsh-client"]="go install -v github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest &> /dev/null"
all_gotools["mapcidr"]="go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest &> /dev/null"
all_gotools["tlsx"]="go install -v github.com/projectdiscovery/tlsx/cmd/tlsx@latest &> /dev/null"
all_gotools["katana"]="go install -v github.com/projectdiscovery/katana/cmd/katana@latest &> /dev/null"
all_gotools["cdncheck"]="go install -v github.com/projectdiscovery/cdncheck/cmd/cdncheck@latest &> /dev/null"
all_gotools["asnmap"]="go install -v github.com/projectdiscovery/asnmap/cmd/asnmap@latest &> /dev/null"
all_gotools["uncover"]="go install -v github.com/projectdiscovery/uncover/cmd/uncover@latest &> /dev/null"
all_gotools["pdtm"]="go install -v github.com/projectdiscovery/pdtm/cmd/pdtm@latest &> /dev/null"
# OWASP Amass
all_gotools["amass"]="go install -v github.com/owasp-amass/amass/v4/...@master &> /dev/null"
#Tom Hudson Tools
all_gotools["gf"]="go install -v github.com/tomnomnom/gf@latest &> /dev/null"
all_gotools["qsreplace"]="go install -v github.com/tomnomnom/qsreplace@latest &> /dev/null"
all_gotools["waybackurls"]="go install -v github.com/tomnomnom/waybackurls@latest &> /dev/null"
all_gotools["anew"]="go install -v github.com/tomnomnom/anew@latest &> /dev/null"
all_gotools["unfurl"]="go install -v github.com/tomnomnom/unfurl@latest &> /dev/null"
all_gotools["inscope"]="go install -v github.com/tomnomnom/hacks/inscope@latest &> /dev/null"
all_gotools["httprobe"]="go install -v github.com/tomnomnom/httprobe@latest &> /dev/null"
all_gotools["assetfinder"]="go install -v github.com/tomnomnom/assetfinder@latest &> /dev/null"
all_gotools["meg"]="go install github.com/tomnomnom/meg@latest &> /dev/null"
# Gwendal Le Coguic Tools
all_gotools["github-subdomains"]="go install -v github.com/gwen001/github-subdomains@latest &> /dev/null"
all_gotools["github-endpoints"]="go install -v github.com/gwen001/github-endpoints@latest &> /dev/null"
# Josué Encinar Tools
all_gotools["analyticsrelationships"]="go install -v github.com/Josue87/analyticsrelationships@latest &> /dev/null"
all_gotools["gotator"]="go install -v github.com/Josue87/gotator@latest &> /dev/null"
all_gotools["roboxtractor"]="go install -v github.com/Josue87/roboxtractor@latest &> /dev/null"
all_gotools["puredns"]="go install -v github.com/d3mondev/puredns/v2@latest &> /dev/null"
all_gotools["gauplus"]="go install github.com/bp0lr/gauplus@latest &> /dev/null"
all_gotools["dnstake"]="go install -v github.com/pwnesia/dnstake/cmd/dnstake@latest &> /dev/null"
all_gotools["hakrawler"]="go install -v github.com/hakluke/hakrawler@latest &> /dev/null"
all_gotools["hakrevdns"]="go install github.com/hakluke/hakrevdns@latest &> /dev/null"
all_gotools["hakcheckurl"]="go install github.com/hakluke/hakcheckurl@latest &> /dev/null"
all_gotools["ffuf"]="go install -v github.com/ffuf/ffuf@latest &> /dev/null"
all_gotools["gau"]="go install -v github.com/lc/gau/v2/cmd/gau@latest &> /dev/null"
all_gotools["subjs"]="go install -v github.com/lc/subjs@latest &> /dev/null"
all_gotools["Gxss"]="go install -v github.com/KathanP19/Gxss@latest &> /dev/null"
all_gotools["gospider"]="go install -v github.com/jaeles-project/gospider@latest &> /dev/null"
all_gotools["gowitness"]="go install -v github.com/sensepost/gowitness@latest &> /dev/null"
all_gotools["crlfuzz"]="go install -v github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest &> /dev/null"
all_gotools["dalfox"]="go install -v github.com/hahwul/dalfox/v2@latest &> /dev/null"
all_gotools["ipcdn"]="go install -v github.com/six2dez/ipcdn@latest &> /dev/null"
all_gotools["gitdorks_go"]="go install -v github.com/damit5/gitdorks_go@latest &> /dev/null"
all_gotools["smap"]="go install -v github.com/s0md3v/smap/cmd/smap@latest &> /dev/null"
all_gotools["dsieve"]="go install -v github.com/trickest/dsieve@master &> /dev/null"
all_gotools["rush"]="go install -v github.com/shenwei356/rush@latest &> /dev/null"
all_gotools["enumerepo"]="go install -v github.com/trickest/enumerepo@latest &> /dev/null"
all_gotools["Web-Cache-Vulnerability-Scanner"]="go install -v github.com/Hackmanit/Web-Cache-Vulnerability-Scanner@latest &> /dev/null"
all_gotools["cent"]="go install -v github.com/xm1k3/cent@latest &> /dev/null"
all_gotools["mksub"]="go install github.com/trickest/mksub@latest &> /dev/null"
all_gotools["headi"]="go install github.com/mlcsec/headi@latest &> /dev/null"
all_gotools["shortscan"]="go install github.com/bitquark/shortscan/cmd/shortscan@latest &> /dev/null"
echo -e "$(INFO_PRINT) Installing Go tools (${#all_gotools[@]})"
declare -A not_install_gotools
i=0
for gotool in "${!all_gotools[@]}"; do
i=$((i + 1))
eval ${all_gotools[$gotool]}
exit_status=$?
if [ $exit_status -eq 0 ]
then
echo -e "$(INFO_PRINT) $gotool installed (${i}/${#all_gotools[@]})"
else
echo -e "$(ERROR_PRINT) Unable to install $gotool, try manually (${i}/${#all_gotools[@]})"
not_install_gotools["$gotool"]="$gotool"
fi
done
if [ ${#not_install_gotools[@]} -ne 0 ]; then
echo -e "$(ERROR_PRINT) Unable to install following go tools (${#not_install_gotools[@]}), try manually."
i=0
for not_install_gotool in "${!not_install_gotools[@]}"; do
i=$((i + 1))
echo -e "$(ERROR_PRINT) $not_install_gotool (${i}/${#not_install_gotools[@]})"
done
fi
#copy all go binary into /usr/local/bin
echo -e "$(INFO_PRINT) Copy all Go Tools into ${yellow}/usr/local/bin"
sudo cp $HOME/go/bin/* /usr/local/bin
duration=$SECONDS
echo -e "$(INFO_PRINT) Elapsed Time: $(($duration / 60)) minutes and $(($duration % 60)) seconds."