# owasp-amass/amass architecture

> Architecture diagram of the GitHub repository owasp-amass/amass, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/owasp-amass/amass
- Repository: https://github.com/owasp-amass/amass

## Overview

##### Project Type and Purpose
- Recognize that this is not a classic full-stack web application but an advanced security reconnaissance tool.
- The README emphasizes its role in mapping network attack surfaces by leveraging integrations with numerous APIs, DNS services, certificate discovery methods, and various web scraping techniques.
- The key purpose is to automate the discovery and enumeration of subdomains, IP addresses, and other sensitive external infrastructure details.

##### Analyzing the File Structure
- The top-level directories reveal the project’s layered and modular design. For example:
- The “cmd/amass” folder contains the primary CLI entry point and command handlers.
- “datasrcs” and “resources/scripts” house numerous data source integrations and scripts that drive information gathering.
- “net” (with subdirectories for DNS and HTTP) and “enum” provide specialized modules for network communication and DNS enumeration.
- “intel” and “requests” deal with data processing and HTTP API calls.
- “doc”, “examples”, and “LICENSE” show supporting documentation and examples for users.
- Files such as Dockerfile, .github/workflows, and go.mod indicate continuous integration strategies and dependency management, but the core focus remains modular command execution and data processing.

a. Main Components to Include:
- Command Line Interface (CLI) Module:
- Represented by the “cmd/amass” directory. This is where user inputs are received, and execution begins.
- Data Source Integration Layer:
- Network Communication Modules:
- “net” package for DNS and HTTP communications. Separate components for DNS lookups, HTTP requests, and static content (from “net/http/static”) should be shown.
- Enumeration & Analysis Engine:
- “enum” directory modules (handling different enumeration techniques such as DNS, input processing, monitoring, and data storage).
- Auxiliary Modules:
- “intel” for active intelligence gathering.
- “requests” for API calls and external data fetching.
- “systems” which may contain local system or simplified engine configurations.
- “format” modules to parse and print output.
- External Services and Integrations:
- Resource and Configuration Management:
- “resources” (wordlists, configuration files, and supportive datasets) as a repository for persistent data and rule sets.

b. Relationships and Interactions:
- How the CLI module drives the overall process, invoking the enumeration engine which in turn interacts with both internal libraries (network, datasrcs, enum, intel) and external APIs.
- Dependency flows such as configuration files and wordlists (from resources and examples) being loaded into the enumeration engine to guide scanning and analysis.

c. Architectural Patterns and Design Principles:
- Modular and layered architecture. The segregation into distinct packages (each handling specific tasks) showcases principles like separation of concerns.
- Extensibility of the system through its scripting engine and pluggable data sources.
- Mention how the tool adopts abstraction with defined interfaces between data fetching (requests, datasrcs) and processing (enum, intel) modules.

d. Relevant Technologies and Frameworks:
- Go is the core programming language.
- Docker is used for containerization; CI workflows (GitHub Actions) for testing, linting, and releases.
- Additional dependencies include various Go libraries for networking, file I/O, and testing, which underpin the modular components.

##### Essential Elements
- Component Labels: Name each module (CLI, Data Sources, Network, Enumeration, Intelligence, etc.) clearly.

Follow these instructions to create a comprehensive and accurate visual representation of the project’s system architecture tailored specifically for Amass’s purpose in network mapping and external asset discovery.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    subgraph "Input Module"
        CLI["CLI Module"]:::cli
    end

    %% Data Source Integration Layer
    subgraph "Data Source Integration"
        DS["Datasrcs"]:::datasource
        Scripts["Scripts (API Connectors)"]:::datasource
    end

    %% Network Communication Layer
    subgraph "Network Communication"
        Network["Net Modules"]:::network
    end

    %% Enumeration & Analysis Engine
    subgraph "Enumeration & Analysis"
        Enum["Enumeration Engine"]:::enum
    end

    %% Auxiliary Modules
    subgraph "Auxiliary Modules"
        Intel["Intelligence Module"]:::intel
        Requests["External API & Data Fetching"]:::requests
    end

    %% Output and Configuration Management
    subgraph "Output & Config"
        Output["Output Formatting"]:::format
        Systems["System Config & Local Engine"]:::systems
        Resources["Resources"]:::resources
        Examples["Examples"]:::resources
    end

    %% Relationships
    CLI -->|"starts"| DS
    CLI -->|"initiates"| Enum
    DS -->|"supplies data"| Enum
    Scripts -->|"supplies connectors"| Enum
    Enum -->|"performs lookups"| Network
    Enum -->|"integrates intel"| Intel
    Enum -->|"calls APIs"| Requests
    Enum -->|"formats output"| Output
    Systems -->|"configures"| Enum
    Resources -->|"loads config/wordlists"| Enum
    Examples -->|"provides sample configs"| Enum

    %% Click Events
    click CLI "https://github.com/owasp-amass/amass/blob/master/cmd/amass/main.go"
    click DS "https://github.com/owasp-amass/amass/tree/master/datasrcs"
    click Scripts "https://github.com/owasp-amass/amass/tree/master/resources/scripts"
    click Network "https://github.com/owasp-amass/amass/blob/master/net/network.go"
    click Enum "https://github.com/owasp-amass/amass/blob/master/enum/enum.go"
    click Intel "https://github.com/owasp-amass/amass/blob/master/intel/intel.go"
    click Requests "https://github.com/owasp-amass/amass/blob/master/requests/request.go"
    click Output "https://github.com/owasp-amass/amass/blob/master/format/parse.go"
    click Systems "https://github.com/owasp-amass/amass/blob/master/systems/local.go"
    click Resources "https://github.com/owasp-amass/amass/blob/master/resources/alterations.txt"
    click Examples "https://github.com/owasp-amass/amass/blob/master/examples/config.yaml"

    %% Styles
    classDef cli fill:#AED6F1,stroke:#1A5276,stroke-width:2px;
    classDef datasource fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef network fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef enum fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef intel fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
    classDef requests fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef format fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef systems fill:#A2D9CE,stroke:#16A085,stroke-width:2px;
    classDef resources fill:#F0B27A,stroke:#D35400,stroke-width:2px;
```
