-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubdomain_enum.sh
executable file
·57 lines (43 loc) · 1.08 KB
/
subdomain_enum.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
#!/bin/bash
DOMAIN=$1
if [ -z "$DOMAIN" ]; then
echo "Usage: $0 <domain>"
exit 1
fi
# Set paths for the tools
SUBFINDER=$(which subfinder)
ASSETFINDER=$(which assetfinder)
AMASS=$(which amass)
HTTPX=$(which httpx)
# Check if tools are installed
if [ ! -x "$SUBFINDER" ]; then
echo "subfinder could not be found, please install it first."
exit 1
fi
if [ ! -x "$ASSETFINDER" ]; then
echo "assetfinder could not be found, please install it first."
exit 1
fi
if [ ! -x "$AMASS" ]; then
echo "amass could not be found, please install it first."
exit 1
fi
if [ ! -x "$HTTPX" ]; then
echo "httpx could not be found, please install it first."
exit 1
fi
OUTPUT="subdomains.txt"
# Run subdomain enumeration
echo "Running subfinder..."
$SUBFINDER -d $DOMAIN -silent > $OUTPUT
echo "Running assetfinder..."
$ASSETFINDER --subs-only $DOMAIN >> $OUTPUT
echo "Running amass..."
$AMASS enum -passive -d $DOMAIN >> $OUTPUT
# Sort and remove duplicates
sort -u $OUTPUT -o $OUTPUT
# Run HTTPX
echo "Running httpx..."
$HTTPX -l $OUTPUT -o httpx_output.txt
# Display results
cat httpx_output.txt