# htrgouvea/nozaki architecture

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

- Interactive diagram: https://gitdiagram.com/htrgouvea/nozaki
- Repository: https://github.com/htrgouvea/nozaki

## Overview

##### Project Type & Purpose
- Nozaki is a specialized security testing fuzzer. Its purpose is to automatically discover security issues in web applications using fuzzing techniques.
- It is a command-line tool (invoked via nozaki.pl) that supports dynamic workflows (YAML files) and customizable behaviors through plugins and wordlists.

##### Main Architectural Components
a. CLI / Entry Point:
– The main script (nozaki.pl) acts as the entry point. It handles command-line arguments, configuration options (like headers, methods, and timeouts), and triggers the fuzzing process.
b. Engine Core:
– Located under lib/Engine, key modules include:
- Fuzzer.pm – The core functionality that likely handles sending HTTP requests and processing responses.
- FuzzerThread.pm – Manages multithreading to perform parallel fuzzing.
- Orchestrator.pm – Coordinates the overall fuzzing process, managing tasks and threads.
c. Functions & Helpers:
– Under lib/Functions, helper modules (Helper.pm, Parser.pm, Plugins.pm) provide support for parsing user inputs, processing responses, and integrating with plugins.
d. Plugins:
– Plugins (found under lib/Plugins) extend functionality for specific tasks:
- For encoding tasks (Base64, for instance) and
- For seeding fuzz tests through various methods (e.g., BurpSuite, OpenAPI, Passive_Collect, etc.).
e. Workflow / Configuration:
– YAML workflow files (both in the “workflows” directory and as examples in docs) allow users to define test cases and rules which the orchestrator loads. They determine how fuzzing rules, wordlists, and HTTP methods are applied.
f. Wordlists & Data Files:
– The project includes various wordlists (e.g., paths, payloads, technologies) that supply endpoints, parameters, or payloads for the fuzzing process.
g. Infrastructure & Deployment:
– The Dockerfile indicates that the project is containerized for easy deployment.
– Additional CI/CD configurations in the .github directory show integration with workflows for testing, linting, and security analysis.

##### Relationships & Interactions
- The CLI (nozaki.pl) gathers user inputs and parameters (e.g., URLs, headers, wordlists, workflows) and then passes these to the Engine.
- The Orchestrator module centrally manages the flow: it initiates Fuzzer threads (via FuzzerThread) which in turn execute tests using the logic defined in Fuzzer.
- Helper functions and parsers support the transformation of raw input/workflow definitions into actionable fuzzing rules.
- Plugins augment core functionality by processing or generating ancillary data (e.g., encoded content, specialized seed generation).
- Wordlists serve as static data sources that provide targets/endpoints and payload variations.
- YAML workflows serve as a configuration layer defining detailed fuzzing test cases, enabling reuse across different testing scenarios.

##### Architectural Patterns & Design Principles
- Modularity: Clear separation between the core engine, functions, and plugins.
- Extensibility: Plugins and helpers allow for additional functionalities or integration with third-party tools.
- Parallelism: Use of multi-threading (FuzzerThread) to manage concurrent HTTP requests.
- Configurability: Dynamic YAML-based workflows provide a flexible mechanism to define and reuse test cases.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry / CLI Layer
    subgraph "Entry/CLI"
        CLI["CLI: nozaki.pl"]:::cli
    end

    %% Engine Core Layer
    subgraph "Engine Core"
        ORCH["Orchestrator"]:::core
        FUZ["Fuzzer"]:::core
        FTH["FuzzerThread"]:::core
    end

    %% Functions & Helpers Layer
    subgraph "Functions & Helpers"
        PARS["Parser.pm"]:::helper
        HELP["Helper.pm"]:::helper
        FUNPLUG["Plugins.pm"]:::helper
    end

    %% Plugins Layer
    subgraph "Plugins"
        subgraph "Encoding"
            BASE64["Base64"]:::plugin
        end
        subgraph "Seeds"
            BURP["BurpSuite"]:::plugin
            OPEN["OpenAPI"]:::plugin
            PASS["Passive_Collect"]:::plugin
            ROBOTS["Robots"]:::plugin
            SCRAP["Scraping"]:::plugin
            SITE["Sitemap"]:::plugin
            SWAG["Swagger"]:::plugin
            WAYBACK["WayBackUrls"]:::plugin
            ZAP["ZAP"]:::plugin
        end
    end

    %% Configuration Layer
    subgraph "Configuration"
        YAML["YAML Workflows"]:::config
    end

    %% Data Sources Layer
    subgraph "Data Sources"
        WORDS["Wordlists"]:::data
    end

    %% Deployment & Infrastructure Layer
    subgraph "Deployment"
        DOCK["Dockerfile"]:::deploy
        GITHUB[".github"]:::deploy
    end

    %% Connections between components
    CLI -->|"triggers"| ORCH
    ORCH -->|"manages"| FUZ
    ORCH -->|"manages"| FTH
    ORCH -->|"loads"| YAML
    FUZ -->|"executes"| PARS
    FUZ -->|"executes"| HELP
    FUZ -->|"integrates"| FUNPLUG
    FUNPLUG -->|"extends"| BASE64
    FUNPLUG -->|"extends"| BURP
    FUNPLUG -->|"extends"| OPEN
    FUNPLUG -->|"extends"| PASS
    FUNPLUG -->|"extends"| ROBOTS
    FUNPLUG -->|"extends"| SCRAP
    FUNPLUG -->|"extends"| SITE
    FUNPLUG -->|"extends"| SWAG
    FUNPLUG -->|"extends"| WAYBACK
    FUNPLUG -->|"extends"| ZAP
    FUZ -->|"uses"| WORDS
    YAML -->|"configures"| FUZ
    DOCK -->|"runs"| CLI
    GITHUB -->|"triggers build"| DOCK

    %% Click Events
    click CLI "https://github.com/htrgouvea/nozaki/blob/main/nozaki.pl"
    click ORCH "https://github.com/htrgouvea/nozaki/blob/main/lib/Engine/Orchestrator.pm"
    click FUZ "https://github.com/htrgouvea/nozaki/blob/main/lib/Engine/Fuzzer.pm"
    click FTH "https://github.com/htrgouvea/nozaki/blob/main/lib/Engine/FuzzerThread.pm"
    click PARS "https://github.com/htrgouvea/nozaki/blob/main/lib/Functions/Parser.pm"
    click HELP "https://github.com/htrgouvea/nozaki/blob/main/lib/Functions/Helper.pm"
    click FUNPLUG "https://github.com/htrgouvea/nozaki/blob/main/lib/Functions/Plugins.pm"
    click BASE64 "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Encode/Base64.pm"
    click BURP "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/BurpSuite.pm"
    click OPEN "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/OpenAPI.pm"
    click PASS "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/Passive_Collect.pm"
    click ROBOTS "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/Robots.pm"
    click SCRAP "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/Scraping.pm"
    click SITE "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/Sitemap.pm"
    click SWAG "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/Swagger.pm"
    click WAYBACK "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/WayBackUrls.pm"
    click ZAP "https://github.com/htrgouvea/nozaki/blob/main/lib/Plugins/Seeds/ZAP.pm"
    click YAML "https://github.com/htrgouvea/nozaki/tree/main/workflows"
    click WORDS "https://github.com/htrgouvea/nozaki/tree/main/wordlists"
    click DOCK "https://github.com/htrgouvea/nozaki/tree/main/Dockerfile"
    click GITHUB "https://github.com/htrgouvea/nozaki/blob/main/.github"

    %% Styles
    classDef cli fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef core fill:#F7D6AE,stroke:#333,stroke-width:2px;
    classDef helper fill:#D6F7AE,stroke:#333,stroke-width:2px;
    classDef plugin fill:#F7AEDF,stroke:#333,stroke-width:2px;
    classDef config fill:#E0AEDF,stroke:#333,stroke-width:2px;
    classDef data fill:#C4E1FF,stroke:#333,stroke-width:2px;
    classDef deploy fill:#FFD1DC,stroke:#333,stroke-width:2px;
```
