# umair-aziz025/dahua-cve-research architecture

> Architecture diagram of the GitHub repository umair-aziz025/dahua-cve-research, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/umair-aziz025/dahua-cve-research
- Repository: https://github.com/umair-aziz025/dahua-cve-research

## Overview

This repository is a set of authorized-testing PoC tools for discovering Dahua cameras and probing documented authentication-bypass and buffer-overflow CVEs. The main workflow is subnet/host discovery, device fingerprinting, vulnerability checks, and reporting; separate CLIs provide focused auth bypass with optional device-information dumping and HTTP/TCP overflow probes with post-probe reachability checks. The scripts are standalone rather than a shared application. Scanner internals are partial excerpts, so only visible call relationships are shown.

Main entry points: [`dahua_auth_bypass.py`](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py) (Auth bypass CLI), [`dahua_rce.py`](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py) (Overflow PoC CLI), [`dahua_scanner.py`](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py) (Network scanner), [`dahua_exploit.py`](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_exploit.py) (Multi-CVE runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and assessment"]
  node_scanner["Network scanner<br/>[dahua_scanner.py]"]
  node_fingerprint["Device fingerprinting<br/>[dahua_scanner.py]"]
  node_scanner_checks["Vulnerability checks<br/>[dahua_scanner.py]"]
  node_scan_report["Scan summary<br/>[dahua_scanner.py]"]
  node_multi_scanner["Multi-CVE runner<br/>[dahua_exploit.py]"]
end

subgraph group_auth["Authentication bypass"]
  node_auth_cli["Auth bypass CLI"]
  node_rpc_challenge["RPC2 challenge"]
  node_hashing["Login hash"]
  node_rpc_login["RPC2 login"]
  node_default_creds["Default credential check"]
  node_device_dump["Device information dump"]
end

subgraph group_overflow["Overflow probes"]
  node_overflow_cli["Overflow PoC CLI<br/>[dahua_rce.py]"]
  node_reachability["Reachability check<br/>[dahua_rce.py]"]
  node_http_probe["HTTP overflow probe<br/>[dahua_rce.py]"]
  node_tcp_probe["TCP overflow probe<br/>[dahua_rce.py]"]
  node_dvrip_frame["DVRIP frame builder<br/>[dahua_rce.py]"]
  node_crash_result["Probe result<br/>[dahua_rce.py]"]
end

node_operator(("Authorized tester"))
node_camera["Dahua camera"]

node_operator -->|"runs scan"| node_scanner
node_scanner -->|"fingerprints devices"| node_fingerprint
node_scanner -->|"checks findings"| node_scanner_checks
node_scanner -->|"prints summary"| node_scan_report
node_scanner_checks -->|"probes"| node_camera
node_operator -->|"runs tests"| node_multi_scanner
node_multi_scanner -->|"tests CVEs"| node_camera
node_operator -->|"runs bypass"| node_auth_cli
node_auth_cli -->|"requests challenge"| node_rpc_challenge
node_rpc_challenge -->|"sends RPC2 request"| node_camera
node_auth_cli -->|"computes hash"| node_hashing
node_auth_cli -->|"submits login"| node_rpc_login
node_rpc_login -->|"sends RPC2 login"| node_camera
node_auth_cli -->|"falls back to"| node_default_creds
node_auth_cli -->|"optionally dumps"| node_device_dump
node_device_dump -->|"calls RPC2 methods"| node_camera
node_operator -->|"runs probe"| node_overflow_cli
node_overflow_cli -->|"checks before and after"| node_reachability
node_overflow_cli -->|"dispatches HTTP probe"| node_http_probe
node_overflow_cli -->|"dispatches TCP probe"| node_tcp_probe
node_tcp_probe -->|"builds frame"| node_dvrip_frame
node_http_probe -->|"sends oversized JSON"| node_camera
node_tcp_probe -->|"sends oversized frame"| node_camera
node_overflow_cli -->|"summarizes probes"| node_crash_result

click node_scanner "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py"
click node_fingerprint "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py"
click node_scanner_checks "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py"
click node_scan_report "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py"
click node_multi_scanner "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_exploit.py"
click node_auth_cli "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py"
click node_rpc_challenge "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py"
click node_hashing "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py"
click node_rpc_login "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py"
click node_default_creds "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py"
click node_device_dump "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py"
click node_overflow_cli "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py"
click node_reachability "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py"
click node_http_probe "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py"
click node_tcp_probe "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py"
click node_dvrip_frame "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py"
click node_crash_result "https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.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_scanner,node_fingerprint,node_scanner_checks,node_scan_report,node_multi_scanner toneBlue
class node_auth_cli,node_rpc_challenge,node_hashing,node_rpc_login,node_default_creds,node_device_dump toneAmber
class node_overflow_cli,node_reachability,node_http_probe,node_tcp_probe,node_dvrip_frame,node_crash_result toneMint
class node_operator,node_camera toneIndigo
```

## Components

### Discovery and assessment

- [Network scanner](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py): `dahua_scanner.py`
- [Device fingerprinting](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py): `dahua_scanner.py`
- [Vulnerability checks](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py): `dahua_scanner.py`
- [Scan summary](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_scanner.py): `dahua_scanner.py`
- [Multi-CVE runner](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_exploit.py): `dahua_exploit.py`

### Authentication bypass

- [Auth bypass CLI](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py): `dahua_auth_bypass.py`
- [RPC2 challenge](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py): `dahua_auth_bypass.py`
- [Login hash](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py): `dahua_auth_bypass.py`
- [RPC2 login](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py): `dahua_auth_bypass.py`
- [Default credential check](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py): `dahua_auth_bypass.py`
- [Device information dump](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_auth_bypass.py): `dahua_auth_bypass.py`

### Overflow probes

- [Overflow PoC CLI](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py): `dahua_rce.py`
- [Reachability check](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py): `dahua_rce.py`
- [HTTP overflow probe](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py): `dahua_rce.py`
- [TCP overflow probe](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py): `dahua_rce.py`
- [DVRIP frame builder](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py): `dahua_rce.py`
- [Probe result](https://github.com/umair-aziz025/dahua-cve-research/blob/main/dahua_rce.py): `dahua_rce.py`

### Other components

- **Authorized tester**
- **Dahua camera**

## Connections

- Authorized tester → Network scanner: runs scan (evidence: `README.md`)
- Network scanner → Device fingerprinting: fingerprints devices (evidence: `dahua_scanner.py`)
- Network scanner → Vulnerability checks: checks findings (evidence: `dahua_scanner.py`)
- Network scanner → Scan summary: prints summary (evidence: `dahua_scanner.py`)
- Vulnerability checks → Dahua camera: probes (evidence: `dahua_scanner.py`)
- Authorized tester → Multi-CVE runner: runs tests (evidence: `README.md`)
- Multi-CVE runner → Dahua camera: tests CVEs (evidence: `dahua_exploit.py`)
- Authorized tester → Auth bypass CLI: runs bypass (evidence: `README.md`)
- Auth bypass CLI → RPC2 challenge: requests challenge (evidence: `dahua_auth_bypass.py`)
- RPC2 challenge → Dahua camera: sends RPC2 request (evidence: `dahua_auth_bypass.py`)
- Auth bypass CLI → Login hash: computes hash (evidence: `dahua_auth_bypass.py`)
- Auth bypass CLI → RPC2 login: submits login (evidence: `dahua_auth_bypass.py`)
- RPC2 login → Dahua camera: sends RPC2 login (evidence: `dahua_auth_bypass.py`)
- Auth bypass CLI → Default credential check: falls back to (evidence: `dahua_auth_bypass.py`)
- Auth bypass CLI → Device information dump: optionally dumps (evidence: `dahua_auth_bypass.py`)
- Device information dump → Dahua camera: calls RPC2 methods (evidence: `dahua_auth_bypass.py`)
- Authorized tester → Overflow PoC CLI: runs probe (evidence: `README.md`)
- Overflow PoC CLI → Reachability check: checks before and after (evidence: `dahua_rce.py`)
- Overflow PoC CLI → HTTP overflow probe: dispatches HTTP probe (evidence: `dahua_rce.py`)
- Overflow PoC CLI → TCP overflow probe: dispatches TCP probe (evidence: `dahua_rce.py`)
- TCP overflow probe → DVRIP frame builder: builds frame (evidence: `dahua_rce.py`)
- HTTP overflow probe → Dahua camera: sends oversized JSON (evidence: `dahua_rce.py`)
- TCP overflow probe → Dahua camera: sends oversized frame (evidence: `dahua_rce.py`)
- Overflow PoC CLI → Probe result: summarizes probes (evidence: `dahua_rce.py`)
