-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall.sh
executable file
·174 lines (123 loc) · 3.81 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
#!/usr/bin/env bash
# Formating
blue="\e[34m"
bold="\e[1m"
cyan="\e[36m"
green="\e[32m"
red="\e[31m"
yellow="\e[33m"
reset="\e[0m"
underline="\e[4m"
echo -e ${bold}${blue}"
_ _ _ _
___ _ _| |__ __| | ___ _ __ ___ __ _(_)_ __ ___ ___| |__
/ __| | | | '_ \ / _\` |/ _ \| '_ \` _ \ / _\` | | '_ \/ __| / __| '_ \
\__ \ |_| | |_) | (_| | (_) | | | | | | (_| | | | | \__ ${red}_${blue}\__ \ | | |
|___/\__,_|_.__/ \__,_|\___/|_| |_| |_|\__,_|_|_| |_|___${red}(_)${blue}___/_| |_| ${yellow}v1.0.0${blue}
Installation script..."${reset}
if [ "${SUDO_USER:-$USER}" != "${USER}" ]
then
echo -e "\n${blue}[${red}-${blue}]${reset} failed!...ps.sh called with sudo!\n"
exit 1
fi
CMD_PREFIX=
if [ ${UID} -gt 0 ] && [ -x "$(command -v sudo)" ]
then
CMD_PREFIX="sudo"
elif [ ${UID} -gt 0 ] && [ ! -x "$(command -v sudo)" ]
then
echo -e "\n${blue}[${red}-${blue}]${reset} failed!...\`sudo\` command not found!\n"
exit 1
fi
DOWNLOAD_CMD=
if command -v >&- curl
then
DOWNLOAD_CMD="curl -sL"
elif command -v >&- wget
then
DOWNLOAD_CMD="wget --quiet --show-progres --continue --output-document=-"
else
echo "\n${blue}[${red}-${blue}]${reset} Could not find wget/cURL\n" >&2
exit 1
fi
script_directory="${HOME}/.local/bin"
if [ ! -d ${script_directory} ]
then
mkdir -p ${script_directory}
fi
tools=(
curl
)
missing_tools=()
for tool in "${tools[@]}"
do
if [ ! -x "$(command -v ${tool})" ]
then
missing_tools+=(${tool})
fi
done
if [ ${#missing_tools[@]} -gt 0 ]
then
echo -e "[+] ${missing_tools[@]}\n"
eval ${CMD_PREFIX} apt-get -qq -y install ${missing_tools[@]}
fi
if [ ! -x "$(command -v go)" ] && [ ! -x "$(command -v /usr/local/go/bin/go)" ]
then
version=1.17.6
echo -e "\n[+] go${version}\n"
eval ${DOWNLOAD_CMD} https://golang.org/dl/go${version}.linux-amd64.tar.gz -o /tmp/go${version}.linux-amd64.tar.gz
eval ${CMD_PREFIX} tar -xzf /tmp/go${version}.linux-amd64.tar.gz -C /usr/local
fi
(grep -q "export PATH=\$PATH:/usr/local/go/bin" ~/.profile) || {
echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.profile
}
(grep -q "export PATH=\$PATH:${HOME}/go/bin" ~/.profile) || {
echo "export PATH=\$PATH:${HOME}/go/bin" >> ~/.profile
}
source ~/.profile
echo -e "\n[+] amass\n"
go install github.com/OWASP/Amass/v3/...@latest
echo -e "\n[+] anew\n"
go install github.com/tomnomnom/anew@latest
echo -e "\n[+] cero\n"
go install github.com/glebarez/cero@latest
echo -e "\n[+] crobat\n"
go install github.com/cgboal/sonarsearch/cmd/crobat@latest
echo -e "\n[+] findomain\n"
binary_path="/usr/local/bin/findomain"
eval ${CMD_PREFIX} bash <<EOF
eval ${DOWNLOAD_CMD} https://github.com/Edu4rdSHL/findomain/releases/latest/download/findomain-linux > ${binary_path}
chmod a+x ${binary_path}
EOF
echo -e "\n[+] gotator\n"
go install github.com/Josue87/gotator@latest
echo -e "\n[+] hakrevdns\n"
go install github.com/hakluke/hakrevdns@latest
echo -e "\n[+] httpx\n"
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
echo -e "\n[+] massdns\n"
if [ ! -x "$(command -v massdns)" ]
then
git clone https://github.com/blechschmidt/massdns.git /tmp/massdns
cd /tmp/massdns
make
eval ${CMD_PREFIX} mv bin/massdns /usr/bin/
cd -
rm -rf /tmp/massdns
fi
echo -e "\n[+] puredns\n"
go install github.com/d3mondev/puredns/v2@latest
echo -e "\n[+] rush\n"
go install github.com/shenwei356/rush@latest
echo -e "\n[+] hqsubfind3r\n"
go install github.com/hueristiq/hqsubfind3r/cmd/hqsubfind3r@latest
echo -e "\n[+] subfinder\n"
go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
echo -e "\n[+] subdomains.sh\n"
script_path="${script_directory}/subdomains.sh"
if [ -e "${script_path}" ]
then
rm ${script_path}
fi
eval ${DOWNLOAD_CMD} https://raw.githubusercontent.com/hueristiq/subdomains.sh/main/subdomains.sh > ${script_path}
chmod u+x ${script_path}