# ractiurd/ghoulsight architecture

> Architecture diagram of the GitHub repository ractiurd/ghoulsight, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ractiurd/ghoulsight
- Repository: https://github.com/ractiurd/ghoulsight

## Overview

#### Purpose and Distribution

GhoulSight is a Linux-oriented XSS scanner distributed here as a prebuilt executable rather than source code. Its sole executable entry point is `ghoulsight`; `README.md` defines its CLI contract and operational requirements. No application source tree, dependency manifest, or deployment configuration is present.

#### CLI Control Plane

The binary accepts targets from a single URL, URL list, stdin, raw HTTP request, or domain crawl, then selects one or more scan modes (`r`, `d`, `c`, `f`). Major runtime controls include concurrency, timeout, crawl depth, headers, cookies, POST data, payload location, output file, probing, and reflection-only mode. Entry artifact: `ghoulsight`.

#### Target Acquisition and Discovery

Input normalization is the first major boundary: direct URLs and parsed raw requests supply explicit targets, while domain mode crawls links and forms to discover parameterized URLs. Crawling is depth-limited and extracts links plus GET/POST form inputs. Optional URL probing filters unreachable targets before scan work begins. The README documents this behavior in `README.md`; implementation is encapsulated in `ghoulsight`.

#### Scan Orchestration and Modes

A configurable thread pool processes targets and can combine reflected, DOM, context-aware, and fuzz scans. Smart-scan behavior stops further payload testing for a URL after its first confirmed XSS. Reflection caching avoids repeated parameter work, while a two-phase strategy tries custom payloads before fallback payloads for targets without findings. Primary runtime: Go 1.25+ binary `ghoulsight`.

#### Injection and Payload Engines

Reflected scanning tests query and POST parameters; path-based scanning identifies reflected URL segments and injects into them. DOM mode analyzes browser DOM sources and sinks. Context-aware mode identifies HTML, JavaScript, CSS, URL, and related contexts, dynamically creates payloads, and mutates them for breakout, encoding, grammar, and interaction variants. Fuzz mode replaces `FUZZ` positions across URLs, headers, cookies, and form data using single, cluster-bomb, or pitchfork strategies. Payload files are external user-managed inputs, conventionally under `~/.config/ghoulsight/payloads/`.

#### Verification, Results, and External Boundaries

The scanner’s defining claim is execution-based confirmation rather than reflection-only reporting: it requires a locally installed Chromium-family browser (Chrome, Chromium, or Brave) to validate findings. Confirmed results produce PoC URLs/raw requests, progress reporting, and optional file output. Telegram bot integration provides setup and real-time scan/finding notifications. Relevant repository artifacts: `ghoulsight`, `README.md`.

#### Licensing and Persistent State

Execution is gated by a machine-bound subscription system: initial installations receive 300 trial runs, while activation keys grant 30-day access and expired subscriptions fall back to remaining trials. The README also describes persistent adaptive-learning state for successful mutation patterns, though its storage location and protocol are not exposed. A small `switch.txt` exists but has no documented architectural role.

Main entry points: [`ghoulsight`](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight) (Scan orchestrator), [`README.md`](https://github.com/ractiurd/ghoulsight/blob/main/README.md) (CLI contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs"]
  node_cli["CLI control plane<br/>CLI interface"]
  node_direct_input["URLs, stdin &amp; raw requests<br/>target input"]
  node_domain_crawl["Domain crawl<br/>discovery"]
  node_readme["CLI contract<br/>documentation<br/>[README.md]"]
end

subgraph group_scanner["Scanner Runtime"]
  node_normalizer["Target normalization<br/>target pipeline"]
  node_url_probe["URL probe<br/>reachability filter"]
  node_thread_pool["Scan orchestrator<br/>concurrent scheduler"]
  node_reflected_scan["Reflected &amp; path scan<br/>injection engine"]
  node_dom_scan["DOM scan<br/>browser analysis"]
  node_context_scan["Context-aware scan<br/>payload engine"]
  node_fuzz_scan["FUZZ scan<br/>fuzz engine"]
end

subgraph group_validation["Validation &amp; Results"]
  node_browser{{"Chromium-family browser<br/>local browser"}}
  node_confirmation["Execution confirmation<br/>finding verifier"]
  node_results["PoCs &amp; output<br/>reporting"]
end

subgraph group_external["External Services &amp; State"]
  node_payload_files["User payload files<br/>external payload input"]
  node_telegram{{"Telegram bot<br/>notification integration"}}
  node_subscription[("Subscription gate<br/>license state")]
  node_adaptive_state[("Adaptive learning state<br/>persistent state")]
end

node_readme -.->|"documents"| node_cli
node_cli -->|"accepts"| node_direct_input
node_cli -->|"starts"| node_domain_crawl
node_direct_input -->|"supplies targets"| node_normalizer
node_domain_crawl -->|"discovers targets"| node_normalizer
node_normalizer -.->|"optional"| node_url_probe
node_normalizer -->|"targets"| node_thread_pool
node_url_probe -->|"reachable targets"| node_thread_pool
node_subscription -->|"gates execution"| node_cli
node_thread_pool -->|"dispatches"| node_reflected_scan
node_thread_pool -->|"dispatches"| node_dom_scan
node_thread_pool -->|"dispatches"| node_context_scan
node_thread_pool -->|"dispatches"| node_fuzz_scan
node_payload_files -->|"custom payloads"| node_reflected_scan
node_payload_files -->|"payload source"| node_context_scan
node_payload_files -->|"payload source"| node_fuzz_scan
node_adaptive_state -.->|"mutation patterns"| node_context_scan
node_reflected_scan -->|"candidate findings"| node_confirmation
node_dom_scan -->|"candidate findings"| node_confirmation
node_context_scan -->|"candidate findings"| node_confirmation
node_fuzz_scan -->|"candidate findings"| node_confirmation
node_confirmation -->|"executes in"| node_browser
node_confirmation -->|"confirmed findings"| node_results
node_results -->|"notifies"| node_telegram

click node_cli "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_direct_input "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_domain_crawl "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_normalizer "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_url_probe "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_thread_pool "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_reflected_scan "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_dom_scan "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_context_scan "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_fuzz_scan "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_confirmation "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_results "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_telegram "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_subscription "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_adaptive_state "https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight"
click node_readme "https://github.com/ractiurd/ghoulsight/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_direct_input,node_domain_crawl,node_readme toneBlue
class node_normalizer,node_url_probe,node_thread_pool,node_reflected_scan,node_dom_scan,node_context_scan,node_fuzz_scan toneAmber
class node_browser,node_confirmation,node_results toneMint
class node_payload_files,node_telegram,node_subscription,node_adaptive_state toneRose
```

## Components

### Inputs

- [CLI control plane](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): CLI interface · Selects inputs, modes, and runtime controls. · `ghoulsight`
- [URLs, stdin & raw requests](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): target input · `ghoulsight`
- [Domain crawl](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): discovery · Depth-limited link and form discovery. · `ghoulsight`
- [CLI contract](https://github.com/ractiurd/ghoulsight/blob/main/README.md): documentation · Documents operation and requirements. · `README.md`

### Scanner Runtime

- [Target normalization](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): target pipeline · `ghoulsight`
- [URL probe](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): reachability filter · Optionally removes unreachable targets. · `ghoulsight`
- [Scan orchestrator](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): concurrent scheduler · Runs selected modes with smart-stop and reflection caching. · `ghoulsight`
- [Reflected & path scan](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): injection engine · Tests query, POST, and reflected path segments. · `ghoulsight`
- [DOM scan](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): browser analysis · Analyzes DOM sources and sinks. · `ghoulsight`
- [Context-aware scan](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): payload engine · Generates and mutates payloads by injection context. · `ghoulsight`
- [FUZZ scan](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): fuzz engine · Expands FUZZ positions in requests and form data. · `ghoulsight`

### Validation & Results

- **Chromium-family browser**: local browser · Executes payloads to confirm XSS.
- [Execution confirmation](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): finding verifier · Distinguishes confirmed XSS from reflection-only results. · `ghoulsight`
- [PoCs & output](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): reporting · Emits progress, PoC URLs/raw requests, and optional files. · `ghoulsight`

### External Services & State

- **User payload files**: external payload input · Custom payloads precede fallback payloads.
- [Telegram bot](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): notification integration · Sends setup and real-time scan notifications. · `ghoulsight`
- [Subscription gate](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): license state · Machine-bound trials and 30-day activations gate execution. · `ghoulsight`
- [Adaptive learning state](https://github.com/ractiurd/ghoulsight/blob/main/ghoulsight): persistent state · Stores successful mutation patterns; location is undisclosed. · `ghoulsight`

## Connections

- CLI contract → CLI control plane: documents
- CLI control plane → URLs, stdin & raw requests: accepts
- CLI control plane → Domain crawl: starts
- URLs, stdin & raw requests → Target normalization: supplies targets
- Domain crawl → Target normalization: discovers targets
- Target normalization → URL probe: optional
- Target normalization → Scan orchestrator: targets
- URL probe → Scan orchestrator: reachable targets
- Subscription gate → CLI control plane: gates execution
- Scan orchestrator → Reflected & path scan: dispatches
- Scan orchestrator → DOM scan: dispatches
- Scan orchestrator → Context-aware scan: dispatches
- Scan orchestrator → FUZZ scan: dispatches
- User payload files → Reflected & path scan: custom payloads
- User payload files → Context-aware scan: payload source
- User payload files → FUZZ scan: payload source
- Adaptive learning state → Context-aware scan: mutation patterns
- Reflected & path scan → Execution confirmation: candidate findings
- DOM scan → Execution confirmation: candidate findings
- Context-aware scan → Execution confirmation: candidate findings
- FUZZ scan → Execution confirmation: candidate findings
- Execution confirmation → Chromium-family browser: executes in
- Execution confirmation → PoCs & output: confirmed findings
- PoCs & output → Telegram bot: notifies
