OWASP Amass

repository·main·Indexed 12 days ago

https://github.com/owasp-amass/amass

An open-source tool for attack surface mapping and external asset discovery using active reconnaissance and information gathering. It features a subcommand-based CLI for enumeration, subdomain discovery, and visualization, as well as a v1 API for session management and asset creation. Supports complex configurations via .ini and YAML files, including data source credentials and graph database integration.

Tokens
8K
Snippets
35
Records
46
Agent score
96%

What's inside OWASP Amass

  1. Overview of OWASP Amass

    main
    OWASP Amass is a tool designed for network mapping of attack surfaces and external asset discovery. It achieves this by utilizing open source information gathering and active reconnaissance techniques.
  2. Analyze and present discovered subdomains

    main

    The subs command is used to analyze and present discovered subdomains and associated data from the Amass graph database. It allows you to filter by domain, view IP addresses (IPv4/IPv6), and generate ASN (Autonomous System Number) summaries.

    Key capabilities include:

    • Listing discovered names.
    • Showing associated IP addresses.
    • Providing an ASN table summary.
    • Outputting results to a file or terminal.
    • Using a configuration file or directory to define scope and database location.
  3. How Amass Enumeration works

    main

    The enumeration workflow follows a specific lifecycle to interface with the Amass engine:

    1. Configuration: Loads settings from the provided YAML --config file and overrides them with command-line arguments.
    2. Engine Connection: Establishes a connection to the collection engine via the --engine URL (defaulting to http://127.0.0.1:4000).
    3. Session Creation: Creates a new session on the engine server, which returns a unique session token.
    4. Asset Creation: Converts the defined scope (domains, CIDRs, ASNs, etc.) into assets and uploads them to the engine.
    5. Bulk Transfer: If a large number of known names are provided, they are transferred to the engine using bulk operations.
    6. Execution & Monitoring: The client subscribes to engine log messages and monitors progress via SessionStats. The process continues until completion, a timeout is reached, or an interrupt is received.
    7. Cleanup: The session is terminated on the engine server once the workflow finishes or is interrupted.
  4. Configure logging for the Amass engine

    main

    The Amass engine determines its logging destination based on the provided flags and environment:

    1. Explicit Log Directory: If the --log-dir flag is provided, the engine creates a file logger in that directory using a filename format of amass_engine_YYYY-MM-DDTHH:MM:SS.log.
    2. Syslog: If no directory is specified, the engine attempts to use a Syslog logger.
    3. Default Output Directory: If Syslog is unavailable, the engine falls back to the directory defined by the config.OutputDirectory setting, creating a file logger there.
    4. Stdout: If all other methods fail, the engine defaults to a text-based logger writing to os.Stdout.
  5. Convert legacy INI configuration to YAML with oam_i2y

    main

    The oam_i2y component is a utility designed to migrate legacy Amass INI configuration files into the modern YAML format. It parses an existing INI file and generates two separate YAML files: a main configuration file and a data sources file.

    To use this tool, you must provide the path to your existing INI file using the -ini flag. You can optionally specify the output filenames for the resulting YAML files.

    # Basic usage (uses default filenames oam_config.yaml and oam_datasources.yaml)
    ./oam_i2y -ini path/to/your_config.ini
    
    # Custom output filenames
    ./oam_i2y -ini path/to/your_config.ini -cf custom_config.yaml -df custom_datasources.yaml
  6. Analyze OAM data to generate graph visualizations

    main

    The viz command analyzes Open Asset Management (OAM) data to generate graph visualizations in various formats. You must specify at least one output format and at least one root domain.

    Usage Pattern: -d3|-dot|-gexf [options] -d domain

    Core Requirements:

    • You must select at least one output format: -d3, -dot, or -gexf.
    • You must provide at least one domain using -d or via a domain file using -df.
    # Example: Generate a D3 HTML visualization for a domain
    amass viz -d3 -d example.com
    
    # Example: Generate DOT and GEXF files for multiple domains using a file
    amass viz -dot -gexf -df domains.txt -o ./output_dir
  7. Use the Amass CLI

    main

    Amass is a command-line tool for attack surface mapping and asset discovery. It operates using a subcommand-based architecture. The general syntax is:

    amass [options] [subcommand] [subcommand-options]

    Global Flags

    • -h, --help: Show the program usage message and available subcommands.
    • --version: Print the Amass version number.

    Available Subcommands

    Each subcommand performs a specific part of the discovery workflow:

    • assoc: Association-based discovery.
    • engine: Manage the Amass engine.
    • enum: Perform enumeration (requires the engine to be running).
    • subs: Subdomain discovery.
    • track: Track changes in the asset landscape.
    • viz: Visualization of discovered assets.
    amass [assoc|engine|enum|subs|track|viz] [options]
  8. Use the track command to identify newly discovered assets

    main

    The track command analyzes Open Asset Model (OAM) data stored in a graph database to identify assets that have been newly discovered for specific domains. It can filter results based on a timestamp to focus on recent changes.

    Usage Pattern: track [options] [-since 'MM/DD HH:MM:SS YYYY TZ'] -d domain

    Time Format: When using the -since flag, use the format: 01/02 15:04:05 2006 MST (e.g., 04/06 12:00:00 2026 UTC).

    # Example: Track new assets for example.com discovered since April 6th, 2026
    track -d example.com -since '04/06 00:00:00 2026 UTC'
  9. Configure Amass using an .ini file

    main

    Amass uses .ini files to manage complex configurations such as scope, data sources, credentials, and graph databases. The Config.LoadSettings(path string) method parses these files. The parser is case-insensitive and supports shadowed keys (where multiple keys with the same name can be provided to create a list).

    Key operational modes can be set in the default section using the mode key:

    • passive: Only access data sources for names and return results.
    • active: Enables active enumeration techniques like zone transfers.
    // Example of how the configuration is loaded in code
    err := config.LoadSettings("config.ini")