コンテンツにスキップ

Amass

Amass is the OWASP project’s powerful tool for discovering the attack surface of your target organization through subdomain enumeration, passive reconnaissance, and active DNS queries. It integrates with dozens of OSINT data sources and can perform deep ASN enumeration and organization discovery.

apt-get update
apt-get install -y amass
snap install amass
brew install amass
go install -v github.com/owasp-amass/amass/v4/cmd/amass@latest
docker pull ghcr.io/owasp-amass/amass:latest
docker run -v "$(pwd):/work" ghcr.io/owasp-amass/amass:latest enum -d example.com -o /work/results.txt

Download the latest release from https://github.com/owasp-amass/amass/releases and extract the binary.

SubcommandPurpose
enumMain enumeration command for subdomain discovery
intelOSINT and organization intelligence gathering
dbDatabase operations to query cached results
dnsDNS resolution verification and lookups
trackTrack changes and track differences between enumeration runs

Passive enumeration queries OSINT data sources without sending traffic to the target’s DNS servers. No DNS brute-forcing is performed.

amass enum -passive -d example.com
amass enum -passive -d example.com -o results.txt
amass enum -passive -d example.com -d example.org -d example.net

Amass queries dozens of passive data sources including:

  • Certificate Transparency logs (Crt.sh, Google CT logs)
  • DNS records and zone file repositories
  • Search engines (Bing)
  • OSINT databases (Shodan, Censys)
  • DNS history services (SecurityTrails)
  • Archive sites and historical records
# List available data sources
amass enum -list

# Use specific sources
amass enum -passive -d example.com -src "Certspotter,Crtsh,Shodan"

Active enumeration performs DNS resolution and queries against the target’s infrastructure. This sends traffic to the target’s DNS servers.

amass enum -active -d example.com
# Zone transfers are attempted automatically during active enumeration
amass enum -active -d example.com
# Grab certificates during active reconnaissance
amass enum -active -d example.com
amass enum -active -d example.com -timeout 30

Brute force DNS enumeration tests potential subdomain names against the target’s nameservers.

amass enum -brute -d example.com
amass enum -brute -d example.com -w /path/to/wordlist.txt
# Apply mutations to wordlist entries
amass enum -brute -d example.com -w /path/to/wordlist.txt -wm
# Minimum length of 3, maximum length of 25 characters
amass enum -brute -d example.com -min-for-recursive 3 -max-dns-names 25
# Maximum concurrent DNS queries (default: 10000)
amass enum -brute -d example.com -max-dns-queries 5000

# Set timeout for DNS responses
amass enum -brute -d example.com -timeout 15
amass enum -brute -d example.com -ns 8.8.8.8 -ns 1.1.1.1

The intel subcommand gathers organizational intelligence through WHOIS, ASN discovery, and reverse lookups.

amass intel -d example.com
# Find all domains registered to an organization
amass intel -d example.com -whois
# Enumerate all domains for an organization
amass intel -org "Example Corporation"
# Find ASNs associated with the domain
amass intel -d example.com -asn

# Enumerate all domains in an ASN
amass intel -asn 12345
amass intel -d example.com -whois -asn -o intel_results.txt

The dns subcommand verifies DNS resolution and performs DNS-specific operations.

amass dns -d example.com
amass dns -d sub.example.com
amass dns -d example.com -ns 8.8.8.8 -ns 1.1.1.1
amass dns -d example.com -o dns_records.txt

Track changes between enumeration runs to identify newly discovered subdomains.

amass track -d example.com
# Compare against previous enumeration stored in database
amass track -d example.com
amass track -d example.com -show

Query and manage results stored in Amass’s local database from previous enumerations.

amass db -show -d example.com
amass db -show -d example.com -names
amass db -show -d example.com -ip
amass db -show -d example.com -summary
amass db -show -d example.com -o exported_results.txt

By default, the database is stored in the user’s home directory at ~/.config/amass/.

Create a config.yaml file to persist settings and API credentials for data sources.

# Data source API keys
datasources:
  credentials:
    - name: shodan
      keys:
        - "YOUR_SHODAN_API_KEY"
    - name: censys
      keys:
        - "YOUR_CENSYS_API_KEY"
    - name: securitytrails
      keys:
        - "YOUR_SECURITYTRAILS_API_KEY"

# Scope definition
scope:
  domains:
    - example.com
    - example.org

# Brute forcing settings
brute_forcing:
  enabled: true
  wordlist: /path/to/wordlist.txt
  minimum_for_recursive: 3

# DNS alterations and mutations
alterations:
  enabled: true
  flip_words: true
  flip_numbers: true
  add_words: true
  add_numbers: true

# Performance settings
max_dns_queries: 10000
amass enum -config /path/to/config.yaml

Amass supports integration with multiple OSINT data sources via API keys. Configure these in your config file or environment.

datasources:
  credentials:
    - name: shodan
      keys:
        - "YOUR_SHODAN_API_KEY"
datasources:
  credentials:
    - name: censys
      keys:
        - "YOUR_CENSYS_API_KEY"
datasources:
  credentials:
    - name: securitytrails
      keys:
        - "YOUR_SECURITYTRAILS_API_KEY"
datasources:
  credentials:
    - name: virustotal
      keys:
        - "YOUR_VIRUSTOTAL_API_KEY"
datasources:
  credentials:
    - name: passivetotal
      keys:
        - "YOUR_PASSIVETOTAL_API_KEY"
datasources:
  credentials:
    - name: shodan
      keys:
        - "API_KEY_1"
        - "API_KEY_2"
        - "API_KEY_3"

Control how Amass outputs and saves discovered results.

amass enum -passive -d example.com -o results.txt
amass enum -passive -d example.com -json -o results.json
amass enum -passive -d example.com -dir ./output/
# Saves results in all available formats
amass enum -passive -d example.com -oA results
amass enum -passive -d example.com -v
amass enum -passive -d example.com -vv

Amass supports custom data source scripts written in Lua for extending functionality.

Place custom scripts in ~/.config/amass/scripts/.

name = "CustomSource"
type = "api"

function vertical(ctx, domain)
  -- Your custom enumeration logic here
  return {}
end
amass enum -passive -d example.com

Custom scripts are automatically loaded and executed alongside built-in data sources.

Define and control the scope of your enumeration to include or exclude specific targets.

amass enum -passive -d example.com -include-unresolvable
amass enum -passive -d example.com -ip 192.168.0.0/16
amass enum -passive -d example.com -cidr 10.0.0.0/8
amass enum -passive -d example.com -bl example-test.com -bl test-env.com
# Create a file with one domain per line
amass enum -passive -d example.com -blf /path/to/blacklist.txt
amass enum -passive -d example.com -include example.com -include app.example.com

Tune Amass performance based on network conditions and target infrastructure.

# Limit concurrent DNS queries (default: 10000)
amass enum -brute -d example.com -max-dns-queries 5000
# Timeout in seconds for DNS responses
amass enum -brute -d example.com -timeout 30
# Control concurrent requests during active enumeration
amass enum -active -d example.com
# Use fewer concurrent operations
amass enum -passive -d example.com -max-dns-queries 500
# Run multiple instances with different wordlist portions
amass enum -brute -d example.com -w wordlist_part1.txt
amass enum -brute -d example.com -w wordlist_part2.txt
# Test with custom nameservers
amass enum -passive -d example.com -ns 8.8.8.8

Check that your API keys are correctly set in the config file and have appropriate permissions. Run Amass with verbose output to see which sources are failing.

If you encounter rate limiting, reduce the number of concurrent queries and increase timeouts:

amass enum -brute -d example.com -max-dns-queries 1000 -timeout 30

For large-scale enumerations, reduce data source use or split the enumeration across multiple runs.

Clear the database and start fresh:

rm -rf ~/.config/amass/
amass enum -passive -d example.com
  1. Start with Passive Enumeration: Always begin with passive techniques to avoid detection. Add active DNS queries only when needed for validation.

  2. Use Configuration Files: Store API credentials and scope definitions in a configuration file to maintain consistency across runs and avoid command-line credential exposure.

  3. Combine Multiple Data Sources: Leverage multiple OSINT sources (Shodan, Censys, SecurityTrails) to maximize coverage. Each source often reveals different subdomains.

  4. Track Changes Over Time: Use the track subcommand to identify newly discovered subdomains and monitor your attack surface changes.

  5. Implement Scope Management: Use blacklists and whitelists to focus enumeration on relevant targets and avoid noise from unrelated domains.

  6. Validate Actively: After passive enumeration, use active DNS resolution to confirm that discovered subdomains actually resolve to IP addresses.

  7. Export for Further Analysis: Export results in JSON format for parsing and further processing with other tools or scripts.

  8. Monitor Rate Limits: Be aware of API rate limits from data sources. Use API keys when available to increase quotas.

  9. Schedule Regular Enumerations: Run periodic enumerations to detect newly registered subdomains and changes in your attack surface.

  10. Combine with Other Tools: Use Amass output as input for vulnerability scanning, port scanning, or further reconnaissance with tools like Nmap.

ToolPurpose
SubfinderFast passive subdomain enumeration using multiple sources
SecurityTrailsOnline OSINT database for domain and subdomain history
DNSReconDNS reconnaissance and enumeration tool
FierceDNS scanning tool for discovering non-contiguous IP space
Sublist3rSubdomain enumeration using multiple search engines
NmapNetwork mapping and port scanning
ShodanSearch engine for internet-connected devices
CensysSearch engine for internet scanning and certificate data