# codesparadox/dos-c architecture

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

- Interactive diagram: https://gitdiagram.com/codesparadox/dos-c
- Repository: https://github.com/codesparadox/dos-c

## Overview

##### Project type and purpose
- This is a network-attack tool suite written primarily in Python (with a small Node.js “browserd0s” sub-module). Its goal is to perform DoS/DDoS attacks via multiple methods: raw TCP floods, UDP floods, pps floods, and browser-driven attacks using Playwright and proxy lists. It exposes both “basic” single-script entry points (DoS_C.py, Converstion_v7_0.py) and an “advanced” orchestrator (DosRunner.py).

##### File structure
- Top-level Python modules:
- DoS_C.py – basic TCP/UDP/pps flood with Public class and thread pool.
- DosRunner.py – feature-rich CLI orchestrator launching multiple worker threads/connections.
- Converstion_v7_0.py – raw-socket-based TCP flood with manual IP/TCP header crafting.
- skills.py – shared utility functions (e.g., random payload generation, IP spoofing stubs).
- browserd0s/ – Node.js submodule for browser-based DDoS:
- index.js & playwright.js – spin up Playwright headless browsers and flood via HTTP.
- fixedtls, proxy.txt – configuration files for proxy lists or custom TLS handshake code.
- about.txt, install.txt, usage.txt, wget-log – documentation and logs.
- README.md at root & in browserd0s/ describe methods, usage, dependencies.

##### README for insights
- The attack methods live in three Python scripts, each taking target IP, port, duration, threads/connections.
- browserd0s uses Playwright for browser-side flooding, likely via repeated page loads.
- No external databases; state is ephemeral.
- Emphasis on threading, raw sockets, and potential IP/MAC spoofing in future.

##### Main components & interactions
- Attacker CLI Layer (User)
– Inputs: method, target IP/port, duration, threads, connections.
– Entry points: DoS_C.py, DosRunner.py, Converstion_v7_0.py, browserd0s/index.js
- Orchestration Layer
– DosRunner.py: parses CLI flags, configures thread pool & worker parameters.
– Public class in DoS_C.py: wraps individual attack functions.
- Attack Engine Modules
a. TCP Flood Engine (socket.connect loop – stream sockets)
b. UDP Flood Engine (DatagramSocket)
c. PPS Flood Engine (packet-per-second – small UDP bursts)
d. Raw-Socket Flood Engine (Converstion_v7_0.py – IP/TCP header crafting)
e. Browser-based Flood Engine (Node.js + Playwright – HTTP requests via headless browsers, optional proxies)
- Shared Utility Module
– skills.py: random data generation, timing, status checks (check_target_status).
- Thread / Worker Pool
– Each engine spawns N threads or headless browsers.
- File-based Config & Logs
– proxy.txt, fixedtls (TLS override), usage/install docs, wget-log.
- Network Layer / Target
– Attacks travel over raw sockets / TCP / UDP / HTTP to the Target IP:Port.

##### Relationships and data flow
- User → CLI Entry Point → Orchestrator → selects Attack Engine
- Orchestrator → spawns Worker Threads or Browser Instances
- Each Worker → uses Utility functions → sends packets/requests → onto the Internet
- Feedback: Optional check_target_status calls pre- and post-attack
- Logs: Workers write minimal status to stdout or wget-log

##### Architectural patterns & design principles
- Modular Engines: each flood method encapsulated in its own function/script.
- Orchestrator pattern: DosRunner.py centralizes thread and connection management.
- Thread pool concurrency for high throughput.
- Separation of concerns: utility functions in skills.py, config files in browserd0s folder.
- Future extensibility: planned IP/MAC spoofing modules can attach to skills.py or raw-socket engine.

##### Relevant technologies & libraries
- Python 3.6+ standard library: socket, threading, argparse.
- Raw sockets for manual packet crafting.
- Node.js + Playwright for browser-side floods.
- Plain text config files for proxies and TLS tweaks.

##### Essential architectural elements
- Don’t just list scripts—show grouping by function (CLI vs. engines vs. utils).
- Concurrency: illustrate thread pools or browser instances spawning.
- External dependencies: OS raw-socket privileges, Node runtime.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Attacker CLI Layer
    subgraph "Attacker CLI Layer"
        direction TB
        A1["DoS_C.py"]:::python
        A2["DosRunner.py"]:::python
        A3["Converstion_v7_0.py"]:::python
        A4["index.js"]:::node
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        direction TB
        O1["DosRunner.py\n(CLI parser & Thread Pool)"]:::python
        O2["Public Class\n(DoS_C.py)"]:::python
    end

    %% Shared Utility Module
    U1["skills.py"]:::python

    %% Attack Engines
    subgraph "Attack Engines"
        direction TB
        E1["TCP Flood Engine\n(DoS_C.py)"]:::python
        E2["UDP Flood Engine\n(DoS_C.py)"]:::python
        E3["PPS Flood Engine\n(DoS_C.py)"]:::python
        E4["Raw-Socket Flood Engine\n(Converstion_v7_0.py)"]:::python
        subgraph "Node.js Browser Engine"
            direction TB
            B1["index.js"]:::node
            B2["playwright.js"]:::node
        end
    end

    %% Configuration & Docs for Browser Module
    C1["proxy.txt"]:::config
    C2["fixedtls"]:::config
    D1["about.txt"]:::doc
    D2["install.txt"]:::doc
    D3["usage.txt"]:::doc
    D4["wget-log"]:::doc

    %% Documentation
    R1["README.md"]:::doc
    R2["browserd0s/README.md"]:::doc

    %% Target
    T["Target\nIP:Port"]:::external

    %% Control Flow
    A1 -->|executes| O2
    A2 -->|executes| O1
    A3 -->|executes| E4
    A4 -->|executes| B1

    O1 -->|spawns workers| E1
    O1 -->|spawns workers| E2
    O1 -->|spawns workers| E3
    O2 -->|wraps| E1
    O2 -->|wraps| E2
    O2 -->|wraps| E3

    B1 -->|loads| B2

    %% Utility usage
    E1 -->|uses| U1
    E2 -->|uses| U1
    E3 -->|uses| U1
    E4 -->|uses| U1
    B2 -->|uses| U1

    %% Config & Docs relations
    C1 -->|feeds| B1
    C2 -->|feeds| B1
    D1 -->|docs| B1
    D2 -->|docs| B1
    D3 -->|docs| B1
    D4 -->|logs| B1
    R1 -->|project docs| A1
    R2 -->|module docs| B1

    %% Data Flow to Target
    E1 -.->|TCP packets| T
    E2 -.->|UDP packets| T
    E3 -.->|UDP bursts| T
    E4 -.->|Raw IP/TCP| T
    B2 -.->|HTTP requests| T

    %% Click Events
    click A1 "https://github.com/codesparadox/dos-c/blob/main/DoS_C.py"
    click A2 "https://github.com/codesparadox/dos-c/blob/main/DosRunner.py"
    click A3 "https://github.com/codesparadox/dos-c/blob/main/Converstion_v7_0.py"
    click A4 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/index.js"
    click O1 "https://github.com/codesparadox/dos-c/blob/main/DosRunner.py"
    click O2 "https://github.com/codesparadox/dos-c/blob/main/DoS_C.py"
    click E1 "https://github.com/codesparadox/dos-c/blob/main/DoS_C.py"
    click E2 "https://github.com/codesparadox/dos-c/blob/main/DoS_C.py"
    click E3 "https://github.com/codesparadox/dos-c/blob/main/DoS_C.py"
    click E4 "https://github.com/codesparadox/dos-c/blob/main/Converstion_v7_0.py"
    click B1 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/index.js"
    click B2 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/playwright.js"
    click U1 "https://github.com/codesparadox/dos-c/blob/main/skills.py"
    click C1 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/proxy.txt"
    click C2 "https://github.com/codesparadox/dos-c/tree/main/browserd0s/fixedtls"
    click D1 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/about.txt"
    click D2 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/install.txt"
    click D3 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/usage.txt"
    click D4 "https://github.com/codesparadox/dos-c/tree/main/browserd0s/wget-log"
    click R1 "https://github.com/codesparadox/dos-c/blob/main/README.md"
    click R2 "https://github.com/codesparadox/dos-c/blob/main/browserd0s/README.md"

    %% Styles
    classDef python fill:#cfe2f3,stroke:#036;border-radius:4px
    classDef node fill:#f4cccc,stroke:#c00,border-radius:4px
    classDef config fill:#e7e6e6,stroke:#888,border-radius:4px
    classDef doc fill:#d9ead3,stroke:#6c6,border-radius:4px
    classDef external fill:#fff2cc,stroke:#a67c00,border-radius:4px
```
