# owasp/nettacker architecture

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

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

## Overview

##### Project type and purpose
- OWASP Nettacker is a Python-based, multi-threaded/multi-process automated penetration-testing scanner.
- It provides:
- A CLI entrypoint (nettacker.py/main.py)
- A REST API service
- A WebUI (static HTML/JS/CSS)
- A plugin/module system for scans (scan, brute, vuln)
- Pluggable DB backends (SQLite/MySQL/PostgreSQL)
- Docker/docker-compose deployment

##### File structure
- Top-level artifacts:
- Dockerfile + docker-compose.yml + Makefile → container orchestration
- nettacker.py & main.py → CLI bootstrap
- pyproject.toml → Python packaging/deps
- .data/ → persistent volume (sqlite, results)
- README, docs/, mkdocs.yml → docs site
- tests/ → unit tests
- Package “nettacker/”:
- api/ → REST endpoints and engine
- core/ → argument parsing, engine loop, plugin loader, fuzzer, graph
- database/ → ORM and SQL backends
- lib/ → helper libs (graphing, reporting, HTML logs, ICMP, payloads)
- modules/ → YAML-driven scan, brute, vuln plugins
- web/ → static WebUI files
- config.py, logger.py → global config & logging
- Patterns: layered (presentation/API → core engine → data), plugin architecture for modules

##### README insights
- Describes features (scanning, brute forcing, reporting)
- Mentions API & WebUI, Docker deployment, persistent storage under .data

##### Detail
- Essential architectural elements: UI, API, core engine modules, plugin system, data persistence, external targets, deployment

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Docker Container"
        direction TB

        subgraph "UI / Presentation Layer"
            direction TB
            CLI["CLI Client"]:::presentation
            WebUI["WebUI (Static Files)"]:::presentation
            APIService["REST API Service"]:::presentation
        end

        subgraph "Business Logic Layer"
            direction TB
            CoreEngine["Core Engine"]:::business
            PluginSys["Plugin System (scan, brute, vuln)"]:::business
            subgraph "Helper Libraries"
                direction TB
                GraphLib["Graph Engines"]:::business
                HTMLReport["HTML Reporting"]:::business
                ICMPEngine["ICMP Engine"]:::business
                CompareRep["Compare Reports"]:::business
                Payloads["Payloads & Wordlists"]:::business
            end
            ConfigLog["Config & Logging"]:::business
        end

        subgraph "Data Layer"
            direction TB
            DBConnect["Database Connectors"]:::data
            DBStorage["DB Storage (.data volume)"]:::data
        end
    end

    ExternalTargets["External Targets (Networks/Services)"]:::external

    %% Connections
    CLI -->|"invocation"| CoreEngine
    CLI -->|"optional key/logs"| APIService
    WebUI -->|"AJAX/JSON calls"| APIService
    APIService -->|"submit job / retrieve status"| CoreEngine
    CoreEngine -->|"load & execute plugins"| PluginSys
    PluginSys -->|"network probes"| ExternalTargets
    PluginSys -->|"results/events"| CoreEngine
    CoreEngine -->|"store results"| DBConnect
    DBConnect -->|"persist data"| DBStorage
    CoreEngine -->|"generate report"| HTMLReport
    HTMLReport -->|"write logs"| DBStorage

    %% Click Events
    click CLI "https://github.com/owasp/nettacker/blob/master/nettacker.py"
    click CLI "https://github.com/owasp/nettacker/blob/master/nettacker/main.py"
    click APIService "https://github.com/owasp/nettacker/blob/master/nettacker/api/core.py"
    click APIService "https://github.com/owasp/nettacker/blob/master/nettacker/api/engine.py"
    click APIService "https://github.com/owasp/nettacker/blob/master/nettacker/api/helpers.py"
    click APIService "https://github.com/owasp/nettacker/blob/master/nettacker/api/readme.md"
    click WebUI "https://github.com/owasp/nettacker/blob/master/nettacker/web/static/index.html"
    click WebUI "https://github.com/owasp/nettacker/tree/master/nettacker/web/static/css"
    click WebUI "https://github.com/owasp/nettacker/tree/master/nettacker/web/static/js"
    click WebUI "https://github.com/owasp/nettacker/tree/master/nettacker/web/static/img"
    click WebUI "https://github.com/owasp/nettacker/blob/master/nettacker/web/readme.md"
    click CoreEngine "https://github.com/owasp/nettacker/blob/master/nettacker/core/app.py"
    click PluginSys "https://github.com/owasp/nettacker/tree/master/nettacker/modules/scan/"
    click PluginSys "https://github.com/owasp/nettacker/tree/master/nettacker/modules/brute/"
    click PluginSys "https://github.com/owasp/nettacker/tree/master/nettacker/modules/vuln/"
    click DBConnect "https://github.com/owasp/nettacker/blob/master/nettacker/database/sqlite.py"
    click DBConnect "https://github.com/owasp/nettacker/blob/master/nettacker/database/mysql.py"
    click DBConnect "https://github.com/owasp/nettacker/blob/master/nettacker/database/postgresql.py"
    click DBConnect "https://github.com/owasp/nettacker/blob/master/nettacker/database/db.py"
    click DBConnect "https://github.com/owasp/nettacker/blob/master/nettacker/database/models.py"
    click DBConnect "https://github.com/owasp/nettacker/blob/master/nettacker/database/readme.md"
    click GraphLib "https://github.com/owasp/nettacker/blob/master/nettacker/lib/graph/d3_tree_v1/engine.py"
    click GraphLib "https://github.com/owasp/nettacker/blob/master/nettacker/lib/graph/d3_tree_v2/engine.py"
    click HTMLReport "https://github.com/owasp/nettacker/blob/master/nettacker/lib/html_log/log_data.py"
    click ICMPEngine "https://github.com/owasp/nettacker/blob/master/nettacker/lib/icmp/engine.py"
    click CompareRep "https://github.com/owasp/nettacker/blob/master/nettacker/lib/compare_report/engine.py"
    click Payloads "https://github.com/owasp/nettacker/tree/master/nettacker/lib/payloads/"
    click ConfigLog "https://github.com/owasp/nettacker/blob/master/nettacker/config.py"
    click ConfigLog "https://github.com/owasp/nettacker/blob/master/nettacker/logger.py"
    click DBStorage "https://github.com/owasp/nettacker/tree/master/.data/"
    click DBStorage "https://github.com/owasp/nettacker/tree/master/.data/results/"
    click DBStorage "https://github.com/owasp/nettacker/tree/master/.data/tmp/"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef business fill:#d4edda,stroke:#333,stroke-width:1px
    classDef data fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef external fill:#f8d7da,stroke:#333,stroke-width:1px
```
