-
-
Notifications
You must be signed in to change notification settings - Fork 124
/
setup.sh
executable file
·173 lines (149 loc) · 5.74 KB
/
setup.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
#!/bin/bash
## Automated Bug Bounty recon script dependency installer
## By Cas van Cooten
if [ "$EUID" -ne 0 ]
then
echo "[-] Installation requires elevated privileges, please run as root"
echo "[*] Running 'sudo $0' will install for current user"
echo "[*] Running 'sudo su; $0' will install for root user"
exit 1
fi
if [[ "$OSTYPE" != "linux-gnu" ]] || [[ "$(uname -m)" != "x86_64" ]]
then
echo "[-] Installation requires 64-bit Linux"
exit 1
fi
for arg in "$@"
do
case $arg in
-h|--help)
echo "BugBountyHunter Dependency Installer"
echo " "
echo "$0 [options]"
echo " "
echo "options:"
echo "-h, --help show brief help"
echo "-t, --toolsdir tools directory, defaults to '/opt'"
echo ""
echo "Note: If you choose a non-default tools directory, please adapt the default in the BugBountyAutomator.sh file or pass the -t flag to ensure it finds the right tools."
echo ""
echo "example:"
echo "$0 -t /opt"
exit 0
;;
-t|--toolsdir)
toolsDir="$2"
shift
shift
;;
esac
done
if [ -z "$toolsDir" ]
then
toolsDir="/opt"
fi
echo "[*] INSTALLING DEPENDENCIES IN \"$toolsDir\"..."
echo "[!] NOTE: INSTALLATION HAS BEEN TESTED ON UBUNTU ONLY. RESULTS MAY VARY FOR OTHER DISTRIBUTIONS."
baseDir=$PWD
username="$(logname 2>/dev/null || echo root)"
homeDir=$(eval echo "~$username")
mkdir -p "$toolsDir"
cd "$toolsDir" || { echo "Something went wrong"; exit 1; }
# Various apt packages
echo "[*] Running apt update and installing apt-based packages, this may take a while..."
apt-get update >/dev/null
apt-get install -y xvfb dnsutils nmap python3.9 python2 python3-pip curl wget unzip git libfreetype6 libfontconfig1 >/dev/null
rm -rf /var/lib/apt/lists/*
# Chrome (for aquatone)
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt update -qq
apt install ./google-chrome-stable_current_amd64.deb -y >/dev/null
rm google-chrome-stable_current_amd64.deb
# Golang
go version &> /dev/null
if [ $? -ne 0 ]; then
echo "[*] Installing Golang..."
wget -q https://golang.org/dl/go1.20.4.linux-amd64.tar.gz
tar -xvf go1.20.4.linux-amd64.tar.gz -C /usr/local >/dev/null
rm -rf ./go1.20.4.linux-amd64.tar.gz >/dev/null
export GOROOT="/usr/local/go"
export GOPATH="$homeDir/go"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin:${PATH}"
else
echo "[*] Skipping Golang install, already installed."
echo "[!] Note: This may cause errors. If it does, check your Golang version and settings."
fi
# Go packages
echo "[*] Installing various Go packages..."
export GO111MODULE="on"
go install github.com/lc/gau@latest &>/dev/null
go install github.com/tomnomnom/gf@latest &>/dev/null
go install github.com/jaeles-project/gospider@latest &>/dev/null
go install github.com/tomnomnom/qsreplace@latest &>/dev/null
go install github.com/haccer/subjack@latest &>/dev/null
go install github.com/ffuf/ffuf/v2@latest &>/dev/null
go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest &>/dev/null
# Nuclei-templates
nuclei -update-templates -update-template-dir $toolsDir/nuclei-templates &>/dev/null
# PhantomJS (removed from Kali packages)
echo "[*] Installing PhantomJS..."
wget -q https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2 >/dev/null
rm phantomjs-2.1.1-linux-x86_64.tar.bz2
cp $toolsDir/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
# Aquatone
echo "[*] Installing Aquatone"
wget -q https://github.com/michenriksen/aquatone/releases/download/v1.7.0/aquatone_linux_amd64_1.7.0.zip
unzip -j aquatone_linux_amd64_1.7.0.zip -d /usr/bin/ aquatone >/dev/null
rm aquatone_linux_amd64_1.7.0.zip
# Subjack fingerprints file
echo "[*] Installing Subjack fingerprints..."
mkdir "$toolsDir/subjack"
wget -q https://raw.githubusercontent.com/haccer/subjack/master/fingerprints.json -O $toolsDir/subjack/fingerprints.json
# Temporary files wordlist
echo "[*] Installing ffuf wordlist..."
mkdir "$toolsDir/wordlists"
wget -q https://raw.githubusercontent.com/Bo0oM/fuzz.txt/master/fuzz.txt -O $toolsDir/wordlists/tempfiles.txt
# HTTPX
echo "[*] Installing HTTPX..."
wget -q https://github.com/projectdiscovery/httpx/releases/download/v1.3.1/httpx_1.3.1_linux_amd64.zip
unzip -j httpx_1.3.1_linux_amd64.zip -d /usr/bin/ httpx >/dev/null
rm httpx_1.3.1_linux_amd64.zip
# Amass
echo "[*] Installing Amass..."
wget -q https://github.com/owasp-amass/amass/releases/download/v3.23.2/amass_Linux_amd64.zip
unzip -q amass_Linux_amd64.zip
mv amass_Linux_amd64 amass
rm amass_Linux_amd64.zip
cp $toolsDir/amass/amass /usr/bin/amass
# Gf-patterns
echo "[*] Installing Gf-patterns..."
git clone -q https://github.com/1ndianl33t/Gf-Patterns
mkdir "$homeDir"/.gf
cp "$toolsDir"/Gf-Patterns/*.json "$homeDir"/.gf
# nrich
echo "[*] Installing nrich..."
wget -q https://gitlab.com/api/v4/projects/33695681/packages/generic/nrich/latest/nrich_latest_amd64.deb
dpkg -i nrich_latest_amd64.deb &>/dev/null
rm nrich_latest_amd64.deb
# Persist configured environment variables via global profile.d script
echo "[*] Setting environment variables..."
if [ -f "$homeDir"/.bashrc ]
then
{ echo "export GOROOT=/usr/local/go";
echo "export GOPATH=$homeDir/go";
echo 'export PATH=$PATH:$GOPATH/bin:$GOROOT/bin';
echo "export GO111MODULE=on"; } >> "$homeDir"/.bashrc
fi
if [ -f "$homeDir"/.zshrc ]
then
{ echo "export GOROOT=/usr/local/go";
echo "export GOPATH=$homeDir/go";
echo 'export PATH=$PATH:$GOPATH/bin:$GOROOT/bin';
echo "export GO111MODULE=on"; } >> "$homeDir"/.zshrc
fi
# Cleanup
apt remove unzip -y &>/dev/null
cd "$baseDir" || { echo "Something went wrong"; exit 1; }
echo "[*] SETUP FINISHED."
exit 0