-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vps-init.sh
82 lines (65 loc) · 2.41 KB
/
vps-init.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
#!/bin/bash
DOMAINS=(PLACEHOLDER_DOMAINS);
DORECON=0;
INSTALL_PYTHON_TOOLS=0;
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S");
REPORTS_FOLDER="/root/recon/reports/$TIMESTAMP";
GOLANG_DL="go1.15.linux-amd64.tar.gz";
export GO111MODULE=on;
export GOROOT=/usr/local/go;
export GOPATH=/root/go;
export GOBIN=$GOPATH/bin;
export GOCACHE=/root/.cache/go-build;
export HOME=/root;
export PATH=$PATH:$GOROOT/bin;
export PATH=$PATH:$GOBIN;
echo 'export GO111MODULE=on' >> /root/.bashrc;
echo 'export GOROOT=/usr/local/go' >> /root/.bashrc;
echo 'export GOPATH=/root/go' >> /root/.bashrc;
echo 'export GOBIN=$GOPATH/bin' >> /root/.bashrc;
echo 'export PATH=$PATH:$GOROOT/bin' >> /root/.bashrc;
echo 'export PATH=$PATH:$GOBIN' >> /root/.bashrc;
# install Go
cd /root;
curl -LO "https://golang.org/dl/$GOLANG_DL";
tar -C /usr/local/ -xzf $GOLANG_DL;
rm $GOLANG_DL;
# install tools
go get -u github.com/tomnomnom/assetfinder;
go get -u -v github.com/tomnomnom/httprobe;
go get -u -v github.com/projectdiscovery/httpx/cmd/httpx;
go get -u -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei;
go get -v github.com/projectdiscovery/subfinder/cmd/subfinder;
go get -v github.com/OWASP/Amass/v3/...;
go get -v github.com/ffuf/ffuf;
go get -v github.com/hakluke/hakrawler;
# nuclei install templates
nuclei -update-templates;
if [[ "$INSTALL_PYTHON_TOOLS" -eq 1 ]];
then
mkdir -p "/root/recon/tools";
git clone https://github.com/maurosoria/dirsearch.git /root/recon/tools/dirsearch;
fi
if [[ "$DORECON" -eq 1 ]];
then
mkdir -p $REPORTS_FOLDER;
for domain in "${DOMAINS[@]}"
do
OUT_FOLDER="$REPORTS_FOLDER/$domain"
mkdir -p "$OUT_FOLDER";
subfinder -d $domain -o "$OUT_FOLDER/subfinder.txt";
sort -u -o "$OUT_FOLDER/subfinder.txt" "$OUT_FOLDER/subfinder.txt"
amass enum -brute -d $domain -o "$OUT_FOLDER/amass.txt";
sort -u -o "$OUT_FOLDER/amass.txt" "$OUT_FOLDER/amass.txt"
cat "$OUT_FOLDER/subfinder.txt" "$OUT_FOLDER/amass.txt" | \
sort -u | \
httpx -silent | \
nuclei \
-silent -c 100 -retries 3 -json \
-o "$OUT_FOLDER/nuclei.txt" \
-t cves/ -t dns/ -t files/ -t generic-detections -t panels/ \
-t security-misconfiguration -t subdomain-takeover \
-t technologies/ -t tokens/ -t vulnerabilities/ ;
done
fi
echo "All done!";