# whenitcomestocodeiamnot/wraith architecture

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

- Interactive diagram: https://gitdiagram.com/whenitcomestocodeiamnot/wraith
- Repository: https://github.com/whenitcomestocodeiamnot/wraith

## Overview

WRAITH scans user-supplied or discovered camera targets, identifies exposed services and device brands, tests matching vulnerability and credential checks, optionally probes RTSP, then records findings and produces reports. Its main runtime is coordinated by Core, with target/state management and snapshot work in Data. The README also documents evasion, discovery, and multiple report formats. The DahuaConsole subtree is a separate, substantial device-management capability. Some subsystem links below rely on README descriptions or the source index; unsampled implementation details are not inferred.

Main entry points: [`Ingram/core.py`](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/core.py) (Scan coordinator), [`Ingram/lib/DahuaConsole/dahua.py`](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/dahua.py) (Dahua device operations), [`run_ingram.py`](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/run_ingram.py) (CLI launcher), [`Ingram/pocs`](https://github.com/whenitcomestocodeiamnot/wraith/tree/main/Ingram/pocs) (Vulnerability checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Scan runtime"]
  node_launcher["CLI launcher<br/>[run_ingram.py]"]
  node_config["Scan configuration<br/>[config.py]"]
  node_core["Scan coordinator<br/>[core.py]"]
  node_data[("Target and results state<br/>[data.py]")]
  node_snapshots["Snapshot workers<br/>[data.py]"]
end

subgraph group_checks["Detection checks"]
  node_pocs["Vulnerability checks"]
  node_pocbase["POC base behavior<br/>[base.py]"]
  node_fingerprint["Device fingerprinting<br/>[fingerprint.py]"]
  node_rtsp["RTSP probes<br/>[rtsp_probe.py]"]
  node_ports["Port scanning<br/>[port_scan.py]"]
end

subgraph group_support["Scan support"]
  node_targets["Target discovery<br/>[target_sources.py]"]
  node_evasion["Request evasion<br/>[evasion.py]"]
  node_network["Network helpers<br/>[net.py]"]
  node_report["Result reporting<br/>[report.py]"]
  node_dashboard["Live dashboard<br/>[status_bar.py]"]
end

subgraph group_dahua["Dahua console"]
  node_dahua_cli["Dahua command console<br/>[Console.py]"]
  node_dahua_api["Dahua device operations<br/>[dahua.py]"]
  node_dahua_auth["Dahua logon modes"]
  node_pwdmanager["Credential manager<br/>[pwdmanager.py]"]
  node_dahua_events["Device events<br/>[events.py]"]
  node_dahua_connection["Device connection<br/>[connection.py]"]
end

node_operator(("Operator"))
node_camera(("Camera or NVR"))
node_discovery_services(("Shodan / Censys"))

node_operator -->|"starts scan"| node_launcher
node_launcher -->|"loads options"| node_config
node_launcher -->|"starts runtime"| node_core
node_launcher -->|"obtains targets"| node_targets
node_discovery_services -.->|"supplies targets"| node_targets
node_core -->|"manages scan state"| node_data
node_core -->|"checks ports"| node_ports
node_core -->|"fingerprints devices"| node_fingerprint
node_core -->|"runs matching checks"| node_pocs
node_pocs -->|"inherits behavior"| node_pocbase
node_core -->|"probes RTSP"| node_rtsp
node_core -->|"queues snapshots"| node_snapshots
node_snapshots -->|"invokes exploit"| node_pocs
node_core -.->|"updates display"| node_dashboard
node_core -->|"formats results"| node_report
node_core -->|"uses request controls"| node_evasion
node_pocbase -->|"builds headers"| node_evasion
node_evasion -->|"selects user agent"| node_network
node_pocs -.->|"tests exposure"| node_camera
node_rtsp -.->|"probes stream"| node_camera
node_dahua_cli -->|"dispatches commands"| node_dahua_api
node_dahua_api -->|"uses connection"| node_dahua_connection
node_dahua_api -.->|"uses event support"| node_dahua_events
node_dahua_api -.->|"uses credentials"| node_pwdmanager
node_pwdmanager -->|"derives logon parameters"| node_dahua_auth
node_dahua_connection -->|"uses device methods"| node_dahua_api

click node_launcher "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/run_ingram.py"
click node_config "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/config.py"
click node_core "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/core.py"
click node_data "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/data.py"
click node_snapshots "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/data.py"
click node_pocs "https://github.com/whenitcomestocodeiamnot/wraith/tree/main/Ingram/pocs"
click node_pocbase "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/pocs/base.py"
click node_fingerprint "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/fingerprint.py"
click node_rtsp "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/rtsp_probe.py"
click node_ports "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/port_scan.py"
click node_targets "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/target_sources.py"
click node_evasion "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/evasion.py"
click node_network "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/net.py"
click node_report "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/report.py"
click node_dashboard "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/status_bar.py"
click node_dahua_cli "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/Console.py"
click node_dahua_api "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/dahua.py"
click node_dahua_auth "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/dahua_logon_modes.py"
click node_pwdmanager "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/pwdmanager.py"
click node_dahua_events "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/events.py"
click node_dahua_connection "https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/connection.py"

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_launcher,node_config,node_core,node_data,node_snapshots toneBlue
class node_pocs,node_pocbase,node_fingerprint,node_rtsp,node_ports toneAmber
class node_targets,node_evasion,node_network,node_report,node_dashboard toneMint
class node_dahua_cli,node_dahua_api,node_dahua_auth,node_pwdmanager,node_dahua_events,node_dahua_connection toneRose
class node_operator,node_camera,node_discovery_services toneIndigo
```

## Components

### Scan runtime

- [CLI launcher](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/run_ingram.py): `run_ingram.py`
- [Scan configuration](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/config.py): `Ingram/config.py`
- [Scan coordinator](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/core.py): `Ingram/core.py`
- [Target and results state](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/data.py): `Ingram/data.py`
- [Snapshot workers](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/data.py): `Ingram/data.py`

### Detection checks

- [Vulnerability checks](https://github.com/whenitcomestocodeiamnot/wraith/tree/main/Ingram/pocs): `Ingram/pocs`
- [POC base behavior](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/pocs/base.py): `Ingram/pocs/base.py`
- [Device fingerprinting](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/fingerprint.py): `Ingram/utils/fingerprint.py`
- [RTSP probes](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/rtsp_probe.py): `Ingram/utils/rtsp_probe.py`
- [Port scanning](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/port_scan.py): `Ingram/utils/port_scan.py`

### Scan support

- [Target discovery](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/target_sources.py): `Ingram/utils/target_sources.py`
- [Request evasion](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/evasion.py): `Ingram/utils/evasion.py`
- [Network helpers](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/net.py): `Ingram/utils/net.py`
- [Result reporting](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/report.py): `Ingram/utils/report.py`
- [Live dashboard](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/utils/status_bar.py): `Ingram/utils/status_bar.py`

### Dahua console

- [Dahua command console](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/Console.py): `Ingram/lib/DahuaConsole/Console.py`
- [Dahua device operations](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/dahua.py): `Ingram/lib/DahuaConsole/dahua.py`
- [Dahua logon modes](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/dahua_logon_modes.py): `Ingram/lib/DahuaConsole/dahua_logon_modes.py`
- [Credential manager](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/pwdmanager.py): `Ingram/lib/DahuaConsole/pwdmanager.py`
- [Device events](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/events.py): `Ingram/lib/DahuaConsole/events.py`
- [Device connection](https://github.com/whenitcomestocodeiamnot/wraith/blob/main/Ingram/lib/DahuaConsole/connection.py): `Ingram/lib/DahuaConsole/connection.py`

### Other components

- **Operator**
- **Camera or NVR**
- **Shodan / Censys**

## Connections

- Operator → CLI launcher: starts scan (evidence: `run_ingram.py`)
- CLI launcher → Scan configuration: loads options (evidence: `run_ingram.py`)
- CLI launcher → Scan coordinator: starts runtime (evidence: `run_ingram.py`)
- CLI launcher → Target discovery: obtains targets (evidence: `run_ingram.py`)
- Shodan / Censys → Target discovery: supplies targets (evidence: `README.md`)
- Scan coordinator → Target and results state: manages scan state (evidence: `Ingram/core.py`)
- Scan coordinator → Port scanning: checks ports (evidence: `Ingram/core.py`)
- Scan coordinator → Device fingerprinting: fingerprints devices (evidence: `Ingram/core.py`)
- Scan coordinator → Vulnerability checks: runs matching checks (evidence: `Ingram/core.py`)
- Vulnerability checks → POC base behavior: inherits behavior (evidence: `Ingram/pocs/__init__.py`)
- Scan coordinator → RTSP probes: probes RTSP (evidence: `Ingram/core.py`)
- Scan coordinator → Snapshot workers: queues snapshots (evidence: `Ingram/core.py`)
- Snapshot workers → Vulnerability checks: invokes exploit (evidence: `Ingram/data.py`)
- Scan coordinator → Live dashboard: updates display (evidence: `Ingram/core.py`)
- Scan coordinator → Result reporting: formats results (evidence: `Ingram/core.py`)
- Scan coordinator → Request evasion: uses request controls (evidence: `Ingram/core.py`)
- POC base behavior → Request evasion: builds headers (evidence: `Ingram/pocs/base.py`)
- Request evasion → Network helpers: selects user agent (evidence: `Ingram/utils/evasion.py`)
- Vulnerability checks → Camera or NVR: tests exposure (evidence: `README.md`)
- RTSP probes → Camera or NVR: probes stream (evidence: `README.md`)
- Dahua command console → Dahua device operations: dispatches commands (evidence: `Ingram/lib/DahuaConsole/Console.py`)
- Dahua device operations → Device connection: uses connection (evidence: `Ingram/lib/DahuaConsole/connection.py`)
- Dahua device operations → Device events: uses event support
- Dahua device operations → Credential manager: uses credentials
- Credential manager → Dahua logon modes: derives logon parameters (evidence: `Ingram/lib/DahuaConsole/pwdmanager.py`)
- Device connection → Dahua device operations: uses device methods (evidence: `Ingram/lib/DahuaConsole/connection.py`)
