Subdominator Documentation

repository·main·Indexed 21 days ago

https://github.com/revoltsecurities/subdominator

A high-performance passive subdomain enumeration engine (version 3.0.2) designed for asset discovery and reconnaissance. It leverages 73 OSINT sources to map attack surfaces, featuring recursive enumeration, disk-backed SQLite caching, and an interactive audit shell. Supports multiple output formats including plain text, JSONL, and HTML reports, and can be deployed via Python 3.13+ or Docker.

Tokens
10.1K
Snippets
36
Records
52
Agent score
72%

What's inside subdominator

  1. Manage Subdominator database and storage

    main

    Findings are automatically saved to a SQLite database at ~/.local/share/subdominator/subdominator.db on every run.

    • Custom path: Use --db-path <path> to specify a different location.
    • Disable database: Use --no-db to skip saving findings for a specific run.
    • Interactive access: Use the --shell command to enter an interactive mode to query and export data from the database.

    Note on crtsh: The crtsh provider uses a direct PostgreSQL connection to query the public crt.sh certificate transparency database via asyncpg. This is a read-only query to the external server and does not affect Subdominator's local SQLite storage.

    # Run without saving to the local database
    subdominator -d example.com --no-db
    
    # Use a custom database path
    subdominator -d example.com --db-path ./my_findings.db
  2. Understand Subdominator providers and authentication

    main

    Subdominator uses 73 different sources (providers) to find subdomains. Providers are categorized by their authentication requirements:

    • Free: No authentication needed (e.g., crtsh, hackertarget, shodanx).
    • Optional API key: Works without a key, but provides more results if one is supplied (e.g., alienvault, reconeer).
    • Requires API key: Requires a valid key to function (e.g., shodan, censys, securitytrails).

    Important Notes:

    • Disabled by default: Sources marked with † (like github or waybackarchive) are disabled due to being slow or heavily rate-limited. To include them, use --all or --include-resource <name> (aliased as -ir <name>).
    • Key Aliases:
      • coderog, rapidfinder, and rapidscan all share the rapidapi key.
      • whoisxml is aliased to whoisxmlapi.
      • zoomeyeapi is aliased to zoomeye.
    • Complex Auth: Some providers require specific formats, such as id:secret (Censys), username:password (domainsproject), or host:key (intelx, zoomeyeapi).
  3. Install Subdominator

    main

    Subdominator requires Python 3.13+. You can install it using uv (recommended for speed), pip, or by cloning the source repository.

    To enable HTML report generation, install the reports extra.

    Recommended (uv):

    uv tool install subdominator

    Traditional (pip):

    pip install --upgrade subdominator

    With HTML report support:

    pip install "subdominator[reports]"
    # or
    uv tool install "subdominator[reports]"

    From source:

    git clone https://github.com/RevoltSecurities/Subdominator.git
    cd Subdominator
    uv sync
    uv tool install subdominator
  4. Install HTML report dependencies

    main

    To use the HTML report generation feature in subdominator, you must install the optional reports extra, which includes jinja2.

    pip install subdominator[reports]
  5. Run Subdominator using Docker

    main

    Pre-built images are available on the GitHub Container Registry (GHCR).

    # Pull and scan a domain
    docker run --rm -it ghcr.io/revoltsecurities/subdominator:latest -d example.com
    
    # Save output to the current host directory
    docker run --rm -it \
      -v $(pwd):/output \
      ghcr.io/revoltsecurities/subdominator:latest \
      -d example.com -o /output/results.txt
    
    # Use a custom provider configuration file
    docker run --rm -it \
      -v /path/to/config:/config \
      ghcr.io/revoltsecurities/subdominator:latest \
      -cp /config/provider-config.yaml -d example.com
  6. Set up Subdominator for development

    main

    To contribute to Subdominator, clone the repository and use uv for environment management.

    # Clone and setup environment
    git clone https://github.com/RevoltSecurities/Subdominator.git
    cd Subdominator
    uv sync --group dev
    
    # Run tests
    python -m pytest tests/ -v
    
    # Build distribution
    uv build
  7. Use Subdominator for subdomain enumeration

    main

    Subdominator is a high-performance passive subdomain enumeration engine. It can scan a single domain or a list of domains in bulk.

    Common Usage Patterns:

    Single domain scan:

    subdominator -d example.com

    Recursive enumeration (depth 2):

    subdominator -d example.com -rd 2

    Bulk scan from a file with per-domain output:

    subdominator -dL domains.txt -oD ./output/

    Using specific resources:

    # Include only specific sources
    subdominator -d example.com -ir shodan,censys,securitytrails
    
    # Exclude specific sources
    subdominator -d example.com -er commoncrawl,waybackarchive
    
    # Use all 73 resources (including slow/rate-limited ones)
    subdominator -d example.com --all

    Custom Google dork:

    subdominator -d example.com -ir google -dk site:example.com -inurl:www
    subdominator -d example.com
  8. Use the Subdominator Interactive Audit Shell

    main

    Launch the interactive shell with --shell or -sh to query and manage historical findings stored in the local SQLite database.

    subdominator --shell

    Available Shell Commands:

    CommandDescription
    domainsList all stored root domains with finding counts
    domain <root>Show stats summary for a stored domain
    findings <root>Show all stored findings for a domain
    runs [root]Show recent stored runs
    add <root> <file>Import and merge findings from a text file
    export <root> <path> [txt|json|html]Export findings to a file
    delete <root>Delete a domain and all its findings
    resourcesList resource catalog with auth markers
    configShow active config and database paths
    updateUpdate Subdominator to the latest version
    exit / quitExit the shell

    Resource Auth Markers (from resources command):

    • * — API key required
    • ~ — API key optional
    • - — No auth needed
    subdominator --shell
  9. Configure Subdominator output formats

    main

    Subdominator supports several output formats depending on your workflow:

    • Plain text (default): One subdomain per line. Use -o results.txt to save.
    • JSONL stream (-j): Newline-delimited JSON, one finding per line. Ideal for piping into jq or grep.
    • HTML report (-oh report.html): A standalone HTML report. Requires the jinja2 dependency (pip install "subdominator[reports]").
    • Summary (-ss or -srs): --show-summary prints an overview table (total findings, resource counts, duration). --show-resource-stats adds a per-resource breakdown.
    • JSON report (-rj report.json): A structured JSON summary of the run, including resource execution metadata.
    # Save as JSONL for pipeline processing
    subdominator -d example.com -j
    
    # Generate an HTML report (requires [reports] extra)
    subdominator -d example.com -oh report.html
  10. How Subdominator handles historical findings

    main

    When the --save-db flag is used, Subdominator persists findings to a local database. On subsequent runs for the same domain, the engine retrieves historical_findings from the database and merges them with the current scan results.

    This allows the tool to distinguish between:

    1. Fresh findings: Subdomains discovered in the current run that were not in the database.
    2. Historical findings: Subdomains already known from previous runs.
    3. New since past data: A metric showing how many subdomains were newly discovered compared to the existing historical set.
  11. Configure Subdominator via Environment Variables

    main

    You can drive Subdominator settings using environment variables with the SUBDOMINATOR_ prefix. CLI flags take precedence over environment variables.

    Environment variableEquivalent flagEffect
    SUBDOMINATOR_SSL_VERIFY=false--insecure / -kDisable SSL certificate verification
    SUBDOMINATOR_PROXY=http://host:port--proxy / -pRoute all HTTP requests through this proxy
    SUBDOMINATOR_TIMEOUT=30--timeout / -tOverride default request timeout
    SUBDOMINATOR_CONCURRENCY=16--concurrency / -cOverride default concurrency

    Note: Standard proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) are also respected automatically.