Amass: Complete Guide to Subdomain Enumeration and Attack Surface Mapping Using Kali Linux

amass: Subdomain enumeration tool

amass is OWASP’s flagship in-depth attack surface mapping and asset discovery tool, written in Go. It is widely regarded as one of the most powerful subdomain enumeration and network mapping tools available, combining active techniques (DNS brute forcing, zone transfers, permutation scanning) with passive techniques (querying dozens of third-party data sources like Certificate Transparency logs, Shodan, VirusTotal, and SecurityTrails). Amass also builds a graph database of relationships between discovered assets, allowing testers to visualize how subdomains, IP addresses, ASNs, and organizations interconnect.

Installation

Amass is pre-installed on Kali Linux. Manual installation options:

# Kali/Debian
sudo apt update && sudo apt install amass -y

# Via Go (any platform with Go installed)
go install -v github.com/owasp-amass/amass/v4/...@master

# Via Snap
sudo snap install amass

# Docker
docker pull caffix/amass

Verify installation:

amass -version

Syntax

amass [SUBCOMMAND] [OPTIONS]

Amass operates via subcommands: enum, intel, viz, track, db.

Command-Line Options

amass enum (the primary subdomain enumeration subcommand):

FlagDescription
-d DOMAINTarget domain(s) to enumerate
-df FILEFile containing a list of domains
-passivePassive-only mode (no active DNS resolution, fastest, stealthiest)
-activeEnable active techniques including certificate grabbing and DNS zone checks
-bruteEnable brute-force subdomain guessing using a wordlist
-w FILEWordlist file to use for brute forcing
-min-for-recursive NUMMinimum discoveries before recursive brute forcing kicks in
-o FILEOutput discovered names to a text file
-json FILEOutput results in JSON format
-srcShow the data source that found each result
-ipShow IP addresses along with discovered names
-config FILEUse a custom configuration file (for API keys, data source settings)
-r SERVERSpecify custom resolvers to use
-timeout MINSet a maximum runtime for the enumeration in minutes
-exclude SOURCEExclude specific data sources from the scan
-include SOURCERestrict the scan to only specific data sources
-listList all available data sources

amass intel:

FlagDescription
-org NAMEDiscover domains associated with an organization name
-asn NUMDiscover domains/netblocks associated with an ASN
-cidr CIDRDiscover domains within a given CIDR range
-whoisUse reverse WHOIS to find additional related domains

amass viz:

FlagDescription
-d3Generate an interactive D3.js HTML visualization
-gexfExport graph data in GEXF format (for Gephi)
-dotExport in Graphviz DOT format

Basic Usage

amass enum -d example.com

Expected output:

www.example.com
mail.example.com
ftp.example.com
dev.example.com
OWASP Amass v4.2.0
[+] 4 names discovered - cert: 2, dns: 1, scrape: 1

Practical Examples

Example 1 — Passive-only enumeration (fast, stealthy)

amass enum -passive -d example.com
www.example.com
mail.example.com
api.example.com

Example 2 — Active enumeration with brute forcing

amass enum -active -brute -w /usr/share/wordlists/amass/subdomains-top1mil-5000.txt -d example.com
www.example.com
staging.example.com
internal.example.com
[+] 15 names discovered

Example 3 — Show IP addresses alongside discovered subdomains

amass enum -d example.com -ip
www.example.com [93.184.216.34]
mail.example.com [93.184.216.35]

Example 4 — Show which data source found each result

amass enum -d example.com -src
crtsh: dev.example.com
virustotal: api.example.com
censys: staging.example.com

Example 5 — Output results to a JSON file for later processing

amass enum -d example.com -json amass_results.json
[+] Results written to amass_results.json

Example 6 — Intel mode: discover domains by organization name

amass intel -org "Example Corp"
example.com
example-corp.net
examplecorp.io

Example 7 — Intel mode: discover domains within an ASN

amass intel -asn 15169
google.com
googleapis.com
gstatic.com

Example 8 — Multiple domains from a file

cat domains.txt
# example.com
# example.org

amass enum -df domains.txt -o all_subdomains.txt
www.example.com
www.example.org
mail.example.org

Example 9 — Generate a visual HTML graph of discovered assets

amass viz -d3 -d example.com
[+] amass_d3.html created — open in a browser to explore the asset graph

Example 10 — Limit scan runtime for large domains

amass enum -d example.com -timeout 15
[*] Enumeration will stop after 15 minutes...
[+] 42 names discovered

Common Use Cases

Automation with Bash

Automated recon pipeline: Amass enumeration feeding into a live-host check:

#!/bin/bash
# amass_pipeline.sh
DOMAIN=$1
amass enum -passive -d "$DOMAIN" -o "${DOMAIN}_subs.txt"

echo "[*] Checking for live hosts..."
while IFS= read -r sub; do
    if curl -s -o /dev/null -w "%{http_code}" "https://$sub" | grep -qE "^[23]"; then
        echo "[LIVE] https://$sub"
    fi
done < "${DOMAIN}_subs.txt"

Scheduled asset-monitoring via cron (daily diff of newly discovered subdomains):

#!/bin/bash
# amass_monitor.sh
DOMAIN=$1
DATE=$(date +%F)
amass enum -passive -d "$DOMAIN" -o "amass_${DATE}.txt"

PREV=$(ls -t amass_*.txt 2>/dev/null | sed -n 2p)
if [ -n "$PREV" ]; then
    echo "[*] New subdomains since last scan:"
    comm -13 <(sort "$PREV") <(sort "amass_${DATE}.txt")
fi

Tips and Best Practices

Troubleshooting

ProblemCauseFix
Very few results in passive modeMissing API keys for premium data sourcesConfigure config.ini with valid API keys for VirusTotal, SecurityTrails, Censys, etc.
Scan runs extremely long / never finishesActive brute forcing against a domain with wildcard DNS or very large wordlistAdd -timeout, reduce wordlist size, or switch back to -passive
-brute produces many false positivesWildcard DNS resolution on target domainAmass has built-in wildcard detection, but verify manually with dig on suspicious results
Rate-limited by a data sourceFree-tier API limits exceededAdd paid/authenticated API keys, or exclude that source with -exclude
amass viz HTML graph is empty/brokenNo prior enum results stored in the local Amass graph databaseRun amass enum first (Amass persists prior scan data automatically) before running viz

References

Exit mobile version