# edarmy/web-vulnerability-automation-script architecture

> Architecture diagram of the GitHub repository edarmy/web-vulnerability-automation-script, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edarmy/web-vulnerability-automation-script
- Repository: https://github.com/edarmy/web-vulnerability-automation-script

## Overview

##### Project Type and Purpose
- The project is an automation tool focused on identifying and exploiting common web vulnerabilities from the PortSwigger Web Security Academy labs.
- Its primary purpose is to help security researchers and penetration testers streamline testing via automated vulnerability scanning, custom payload injections, session management, and multi-threaded execution.
- The README confirms the target labs cover both authentication vulnerabilities and access control issues.

##### Analyzing the File Structure
- The top-level folder “Automation” is divided into two vulnerability categories: “Authentication Vulnerabilities” and “access control vlurn”. Each category has its own subdirectories.
- Within these directories, each lab (for example, “Lab1 2FA simple bypass” under authentication, and “Unprotected admin functionality…” labs under access control) appears as a self-contained module with its own script, requirements, and readme.
- The structure suggests that each lab is managed as an independent module that likely shares common patterns (such as logging, payload injection, and session management) even though they target different types of vulnerabilities.

##### Key Components
a. User/Tester Interface:
- Entry point where a security researcher initiates the automation (likely via a CLI or script execution).

b. Automation Controller/Engine:
- A central orchestrator (even if implicit) that selects and triggers different vulnerability modules.
- This component may handle core functions such as configuration management, session handling, and multi-threaded execution.

c. Vulnerability Modules:
- Divide into two main groups:
- Authentication Vulnerabilities (e.g., “2FA simple bypass” module)
- Access Control Vulnerabilities (including “Unprotected admin functionality with unpredictable URL”, “Unprotected admin functionality”, and “User role controlled by request parameter”).
- Each module is depicted as a distinct component that encapsulates the logic for scanning/exploitation, custom payloads, and lab-specific operations.

d. Supporting Components:
- Logging & Reporting: A dedicated component for storing and tracking results, as indicated in the README.
- Dependency/Configuration Management: Show that each module might rely on common or individual dependencies (from each module’s requirements.txt).

e. Multi-threaded Execution Engine:
- A logical unit that indicates the tool’s ability to run scans concurrently, boosting performance.

f. External Targets:
- A component representing external web applications (the actual PortSwigger labs) that are tested by these automation modules.

- Starting from the tester’s input to the Automation Controller.
- The Controller then dispatches tasks to the respective vulnerability modules.
- Modules communicate results back to the Controller.
- From these modules, results flow toward the Logging & Reporting system.
- Interaction between the Controller and multi-threaded execution—in other words, show that tasks may be dispatched concurrently.
- That each module may share direct interactions with external lab targets via HTTP requests (or similar protocols).

##### Architectural Patterns and Design Principles
- The overall design mimics a modular pattern, where each lab-specific script acts as an independent component.
- Separation of concerns: testing logic is encapsulated in individual modules while common tasks (such as session management and logging) reside in other supporting components.
- The use of a centralized Automation Engine – either explicitly coded or conceptually understood as the orchestrator – encourages a “plug-and-play” design where additional vulnerability modules can be integrated easily.

##### Final Recommendations
- Every component is detailed with its responsibilities clearly labeled.
- Use connectors to indicate dependencies (for example, configuration files and multi-threaded execution support).
- Avoid oversimplification—capture as many distinct components as possible, even if some labs share similar structures, to emphasize the modularity of the design.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Input"
        Tester("Security Researcher (CLI)"):::frontend
    end

    %% Automation Controller Layer
    subgraph "Automation Engine"
        Controller("Task Dispatcher/Orchestrator"):::controller
        MultiThread("Multi-threaded Execution Engine"):::multithread
        Controller -->|"dispatches_to_thread"| MultiThread
    end

    %% Vulnerability Modules Layer
    subgraph "Vulnerability Modules"
        subgraph "Authentication Vulnerabilities"
            AuthModule("Authentication Module (Lab1 2FA simple bypass)"):::module
            DepAuth("Dependency: requirements.txt (Auth)"):::dependency
        end
        subgraph "Access Control Vulnerabilities"
            AC_UnprotUrl("Access Module (Unprotected admin functionality with unpredictable URL)"):::module
            DepAC_UnprotUrl("Dependency: requirements.txt (Unprot URL)"):::dependency
            AC_Unprot("Access Module (Unprotected admin functionality)"):::module
            DepAC_Unprot("Dependency: requirements.txt (Access Control)"):::dependency
            AC_UserRole("Access Module (User role controlled by request parameter)"):::module
            DepAC_UserRole("Dependency: requirements.txt (User Role)"):::dependency
        end
    end

    %% Supporting Services Layer
    subgraph "Support Services"
        LogReport("Logging & Reporting"):::support
    end

    %% External Systems Layer
    subgraph "External Systems"
        Target("External Lab Targets (PortSwigger Labs)"):::external
    end

    %% Connections
    Tester -->|"initiates"| Controller

    Controller -->|"dispatches"| AuthModule
    Controller -->|"dispatches"| AC_UnprotUrl
    Controller -->|"dispatches"| AC_Unprot
    Controller -->|"dispatches"| AC_UserRole

    AuthModule -->|"executes_in"| MultiThread
    AC_UnprotUrl -->|"executes_in"| MultiThread
    AC_Unprot -->|"executes_in"| MultiThread
    AC_UserRole -->|"executes_in"| MultiThread

    AuthModule -->|"reports_to"| LogReport
    AC_UnprotUrl -->|"reports_to"| LogReport
    AC_Unprot -->|"reports_to"| LogReport
    AC_UserRole -->|"reports_to"| LogReport

    AuthModule -->|"targets"| Target
    AC_UnprotUrl -->|"targets"| Target
    AC_Unprot -->|"targets"| Target
    AC_UserRole -->|"targets"| Target

    AuthModule -->|"requires"| DepAuth
    AC_UnprotUrl -->|"requires"| DepAC_UnprotUrl
    AC_Unprot -->|"requires"| DepAC_Unprot
    AC_UserRole -->|"requires"| DepAC_UserRole

    %% Click Events for components
    click AuthModule "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/Authentication Vulnerabilities/Lab1 2FA simple bypass/2FA simple bypass.py"
    click AC_UnprotUrl "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/access control vlurn/Unprotected admin functionality with unpredictable URL/Lab2 unproadminfununpreurl.py"
    click AC_Unprot "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/access control vlurn/Unprotected admin functionality/lab1 unprotectedadmin.py"
    click AC_UserRole "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/access control vlurn/User role controlled by request parameter/user0lconbyreq.py"
    click DepAuth "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/Authentication Vulnerabilities/Lab1 2FA simple bypass/requirements.txt"
    click DepAC_UnprotUrl "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/access control vlurn/Unprotected admin functionality with unpredictable URL/requirments.txt"
    click DepAC_Unprot "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/access control vlurn/Unprotected admin functionality/requirements.txt"
    click DepAC_UserRole "https://github.com/edarmy/web-vulnerability-automation-script/blob/main/Automation/access control vlurn/User role controlled by request parameter/requirements.txt"

    %% Styles
    classDef frontend fill:#b3e6ff,stroke:#1a75ff,stroke-width:2px;
    classDef controller fill:#ffffcc,stroke:#ffcc00,stroke-width:2px;
    classDef module fill:#ccffcc,stroke:#009900,stroke-width:2px;
    classDef dependency fill:#ffcccc,stroke:#ff0000,stroke-width:2px;
    classDef support fill:#f2d7d5,stroke:#a93226,stroke-width:2px;
    classDef multithread fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef external fill:#e6e6fa,stroke:#8a2be2,stroke-width:2px;
```
