mirror of https://github.com/OWASP/Nettacker.git
5.1 KiB
5.1 KiB
OWASP Nettacker Codebase Overview
OWASP Nettacker is an open‑source, Python‑based framework for automated penetration testing and information gathering. It supports modular tasks such as port scanning, service detection, subdomain enumeration, vulnerability scans, and credential brute forcing, all driven by a unified CLI, REST API, and Web UI.
Project layout
.
├── docs
├── nettacker
│ ├── api
│ ├── core
│ │ ├── lib
│ │ └── utils
│ ├── database
│ ├── lib
│ │ ├── compare_report
│ │ ├── graph
│ │ │ ├── d3_tree_v1
│ │ │ └── d3_tree_v2
│ │ ├── html_log
│ │ ├── icmp
│ │ └── payloads
│ │ ├── User-Agents
│ │ ├── passwords
│ │ └── wordlists
│ ├── locale
│ ├── modules
│ │ ├── brute
│ │ ├── scan
│ │ └── vuln
│ └── web
│ └── static
│ ├── css
│ ├── fonts
│ ├── img
│ │ └── flags
│ │ ├── 1x1
│ │ └── 4x3
│ ├── js
│ └── report
└── tests
├── api
├── core
│ ├── lib
│ └── utils
├── database
└── lib
└── payloads
- Entry point –
nettacker/main.pycreates aNettackerapplication instance and runs it when invoked via the provided script or CLI - Core engine (
nettacker/core)app.pyorchestrates scans: parsing arguments, expanding targets (including IP ranges and subdomains), launching multiprocess/multithread modules, and generating reportsmodule.pyloads YAML-defined modules, applies service discovery results, expands payload loops, and dispatches protocol-specific engines in threaded fashionarg_parser.py,ip.py,messages.py, andutilsprovide CLI parsing, IP range handling, internationalized messages, and common helpers- Protocol engines reside in
core/lib(e.g., HTTP, FTP, SSH, SMTP, socket) and are invoked by modules
- Modules (
nettacker/modules) – Scanning logic is defined declaratively in YAML under three categories (brute,scan,vuln). Each module contains aninfoblock and a list ofpayloadsthat specify library, request parameters, fuzzing rules, and response conditions. Example:dir_scanperforms directory discovery over HTTP using wordlists and response conditions - Database layer (
nettacker/database) – Uses SQLAlchemy to interface with SQLite, MySQL, or PostgreSQL for persisting events and reports - API & Web UI (
nettacker/api,nettacker/web) – Flask-based REST API plus static assets enabling web‑based scan management - Supporting libraries (
nettacker/lib) – Reporting helpers, ICMP tools, graph generation, and payload wordlists - Configuration –
config.pydefines default paths, database settings, and runtime options - Tests – The
testsdirectory includes unit tests and validation checks; for example,test_yaml_regexes.pyensures regex definitions in YAML modules compile correctly - Build & dependencies –
pyproject.tomldefines the project as a Poetry package and lists dependencies such asaiohttp,multiprocess,paramiko, andsqlalchemy
Important concepts
- Modular architecture: Modules are YAML files; the engine interprets them and runs protocol-specific steps.
- Target expansion: Before scanning, the engine normalizes URLs, enumerates IP ranges, resolves subdomains, and runs preliminary checks like ICMP and port scans
- Service discovery: Results from
port_scanfeed into subsequent modules, allowing conditional execution based on discovered services. Service discovery can be turned off during scans using-dor--skip-service-discoveryrun-time option. - Concurrency: Scans are distributed across processes and threads for performance, with configurable limits per host and module using the
-tand-Mruntime options. The requests can be rate-limited using the-woption.
Where to go next
- Documentation: Review
docs/Installation.mdanddocs/Usage.mdfor setup and basic usage;docs/Modules.mdexplains module types and parameters;docs/Developers.mdcovers contribution guidelines and how to add languages or modules - Explore modules: Study YAML files under
nettacker/modules/*to see how scans, brute-force checks, and vulnerability tests are structured. - Understand protocol engines: Read files in
nettacker/core/lib/to learn how HTTP, socket, and other protocol interactions are implemented. - Run locally: Use the CLI (
nettacker) or Docker instructions in Installation and Usage - Contribute: Follow the guidelines in
docs/Developers.mdand runmake pre-commitandmake testbefore submitting changes.