-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobusto.sh
executable file
·48 lines (38 loc) · 902 Bytes
/
robusto.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
#!/usr/bin/env sh
BASEPATH=`dirname $0`
# Convert the script's path to absolute path.
BASEPATH=$(cd -- "$BASEPATH" && pwd)
DOMAIN=$1
update_scanner() {
# Install/update binaries.
GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei
# Update Nuclei templates.
nuclei -ut -silent
}
scan() {
cat "${1:-/dev/stdin}" |\
nuclei -silent -nc -tags takeover > results.txt
}
# Run our found_hook to allow integrations
trigger_results_hook() {
found_hook_path="${BASEPATH}/hooks/_found_hook"
# Check if we have a hook file
if [ -f "$found_hook_path" ]; then
# Run the hook script
(${found_hook_path})
fi
}
main () {
update_scanner
scan
# Return results
if [ -s ${BASEPATH}/results.txt ]; then
echo "[+] Found subdomains to takeover"
trigger_results_hook
exit 2
else
echo "[-] No subdomains to takeover"
exit 0
fi
}
main