# 0x5477/ingram-pro architecture

> Architecture diagram of the GitHub repository 0x5477/ingram-pro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0x5477/ingram-pro
- Repository: https://github.com/0x5477/ingram-pro

## Overview

Ingram-Pro scans supplied camera targets, identifies exposed services, fingerprints devices, and runs matching vulnerability checks; verified findings and optional snapshots are saved for reporting. Its documented capabilities also include weak-credential checks and deeper Dahua enumeration, relay control, and event monitoring. The graph combines sampled runtime calls, SOURCE INDEX references, and README-documented capabilities; Dahua internals not shown in excerpts are represented at subsystem level where appropriate.

Main entry points: [`IngramPro/core.py`](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/core.py) (Scan coordinator), [`IngramPro/pocs/__init__.py`](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/pocs/__init__.py) (POC discovery), [`IngramPro/lib/DahuaConsole/Console.py`](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/Console.py) (Dahua console), [`run_ingram_pro.py`](https://github.com/0x5477/ingram-pro/blob/main/run_ingram_pro.py) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan workflow"]
  node_entry["CLI entry<br/>[run_ingram_pro.py]"]
  node_config["Scan configuration<br/>[config.py]"]
  node_core["Scan coordinator<br/>[core.py]"]
  node_targets["Target generation<br/>[data.py]"]
  node_probe["Port probing<br/>[port_scan.py]"]
  node_fingerprint["Device fingerprinting<br/>[fingerprint.py]"]
  node_results[("Findings and progress<br/>[data.py]")]
  node_snapshots["Snapshot workers<br/>[data.py]"]
end

subgraph group_pocs["Vulnerability checks"]
  node_poc_registry["POC discovery<br/>[__init__.py]"]
  node_poc_base["POC framework<br/>[base.py]"]
  node_cve_checks["CVE checks"]
  node_weak_passwords["Weak credentials"]
end

subgraph group_dahua["Dahua interaction"]
  node_dahua_console["Dahua console<br/>[Console.py]"]
  node_dahua_api["Device interaction<br/>[dahua.py]"]
  node_dahua_auth["Dahua authentication"]
  node_dahua_connection["Dahua connections<br/>[connection.py]"]
  node_dahua_password["Credential manager<br/>[pwdmanager.py]"]
  node_dahua_events["Event monitoring<br/>[events.py]"]
  node_dahua_relay["Relay control<br/>[relay.py]"]
  node_dahua_servers["Event servers<br/>[servers.py]"]
end

subgraph group_support["Runtime support"]
  node_network_utils["Network utilities<br/>[net.py]"]
  node_shared_utils["Shared utilities<br/>[common.py]"]
  node_status["Progress display<br/>[status_bar.py]"]
end

node_operator(("Operator"))
node_camera(("Camera targets"))

node_operator -->|"starts scan"| node_entry
node_entry -->|"loads options"| node_config
node_entry -->|"starts scanner"| node_core
node_core -->|"reads targets"| node_targets
node_targets -.->|"yields targets"| node_camera
node_core -->|"checks ports"| node_probe
node_core -->|"identifies devices"| node_fingerprint
node_core -->|"loads checks"| node_poc_registry
node_poc_registry -->|"registers checks"| node_poc_base
node_core -->|"records findings"| node_results
node_core -->|"queues captures"| node_snapshots
node_snapshots -->|"runs capture"| node_poc_base
node_poc_registry -.->|"discovers checks"| node_cve_checks
node_poc_registry -.->|"includes credential checks"| node_weak_passwords
node_camera -.->|"receives probes"| node_cve_checks
node_camera -.->|"receives login checks"| node_weak_passwords
node_dahua_console -->|"uses device API"| node_dahua_api
node_dahua_console -->|"uses credentials"| node_dahua_password
node_dahua_console -->|"uses event servers"| node_dahua_servers
node_dahua_connection -->|"uses credentials"| node_dahua_password
node_dahua_connection -->|"uses device API"| node_dahua_api
node_dahua_password -->|"uses logon modes"| node_dahua_auth
node_dahua_servers -->|"uses event handling"| node_dahua_events
node_dahua_events -->|"uses connection"| node_dahua_connection
node_dahua_api -.->|"supports relay control"| node_dahua_relay
node_config -->|"uses network helpers"| node_network_utils
node_targets -->|"generates addresses"| node_network_utils
node_core -->|"uses helpers"| node_shared_utils
node_core -->|"updates progress"| node_status

click node_entry "https://github.com/0x5477/ingram-pro/blob/main/run_ingram_pro.py"
click node_config "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/config.py"
click node_core "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/core.py"
click node_targets "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/data.py"
click node_probe "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/port_scan.py"
click node_fingerprint "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/fingerprint.py"
click node_results "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/data.py"
click node_snapshots "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/data.py"
click node_poc_registry "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/pocs/__init__.py"
click node_poc_base "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/pocs/base.py"
click node_cve_checks "https://github.com/0x5477/ingram-pro/tree/main/IngramPro/pocs"
click node_weak_passwords "https://github.com/0x5477/ingram-pro/tree/main/IngramPro/pocs"
click node_dahua_console "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/Console.py"
click node_dahua_api "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/dahua.py"
click node_dahua_auth "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/dahua_logon_modes.py"
click node_dahua_connection "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/connection.py"
click node_dahua_password "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/pwdmanager.py"
click node_dahua_events "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/events.py"
click node_dahua_relay "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/relay.py"
click node_dahua_servers "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/servers.py"
click node_network_utils "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/net.py"
click node_shared_utils "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/common.py"
click node_status "https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/status_bar.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_entry,node_config,node_core,node_targets,node_probe,node_fingerprint,node_results,node_snapshots toneBlue
class node_poc_registry,node_poc_base,node_cve_checks,node_weak_passwords toneAmber
class node_dahua_console,node_dahua_api,node_dahua_auth,node_dahua_connection,node_dahua_password,node_dahua_events,node_dahua_relay,node_dahua_servers toneMint
class node_network_utils,node_shared_utils,node_status toneRose
class node_operator,node_camera toneIndigo
```

## Components

### Scan workflow

- [CLI entry](https://github.com/0x5477/ingram-pro/blob/main/run_ingram_pro.py): `run_ingram_pro.py`
- [Scan configuration](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/config.py): `IngramPro/config.py`
- [Scan coordinator](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/core.py): `IngramPro/core.py`
- [Target generation](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/data.py): `IngramPro/data.py`
- [Port probing](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/port_scan.py): `IngramPro/utils/port_scan.py`
- [Device fingerprinting](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/fingerprint.py): `IngramPro/utils/fingerprint.py`
- [Findings and progress](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/data.py): `IngramPro/data.py`
- [Snapshot workers](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/data.py): `IngramPro/data.py`

### Vulnerability checks

- [POC discovery](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/pocs/__init__.py): `IngramPro/pocs/__init__.py`
- [POC framework](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/pocs/base.py): `IngramPro/pocs/base.py`
- [CVE checks](https://github.com/0x5477/ingram-pro/tree/main/IngramPro/pocs): `IngramPro/pocs`
- [Weak credentials](https://github.com/0x5477/ingram-pro/tree/main/IngramPro/pocs): `IngramPro/pocs`

### Dahua interaction

- [Dahua console](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/Console.py): `IngramPro/lib/DahuaConsole/Console.py`
- [Device interaction](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/dahua.py): `IngramPro/lib/DahuaConsole/dahua.py`
- [Dahua authentication](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/dahua_logon_modes.py): `IngramPro/lib/DahuaConsole/dahua_logon_modes.py`
- [Dahua connections](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/connection.py): `IngramPro/lib/DahuaConsole/connection.py`
- [Credential manager](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/pwdmanager.py): `IngramPro/lib/DahuaConsole/pwdmanager.py`
- [Event monitoring](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/events.py): `IngramPro/lib/DahuaConsole/events.py`
- [Relay control](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/relay.py): `IngramPro/lib/DahuaConsole/relay.py`
- [Event servers](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/lib/DahuaConsole/servers.py): `IngramPro/lib/DahuaConsole/servers.py`

### Runtime support

- [Network utilities](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/net.py): `IngramPro/utils/net.py`
- [Shared utilities](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/common.py): `IngramPro/utils/common.py`
- [Progress display](https://github.com/0x5477/ingram-pro/blob/main/IngramPro/utils/status_bar.py): `IngramPro/utils/status_bar.py`

### Other components

- **Operator**
- **Camera targets**

## Connections

- Operator → CLI entry: starts scan (evidence: `run_ingram_pro.py`)
- CLI entry → Scan configuration: loads options (evidence: `run_ingram_pro.py`)
- CLI entry → Scan coordinator: starts scanner (evidence: `run_ingram_pro.py`)
- Scan coordinator → Target generation: reads targets (evidence: `IngramPro/core.py`)
- Target generation → Camera targets: yields targets
- Scan coordinator → Port probing: checks ports (evidence: `IngramPro/core.py`)
- Scan coordinator → Device fingerprinting: identifies devices (evidence: `IngramPro/core.py`)
- Scan coordinator → POC discovery: loads checks (evidence: `IngramPro/core.py`)
- POC discovery → POC framework: registers checks (evidence: `IngramPro/pocs/__init__.py`)
- Scan coordinator → Findings and progress: records findings (evidence: `IngramPro/core.py`)
- Scan coordinator → Snapshot workers: queues captures (evidence: `IngramPro/core.py`)
- Snapshot workers → POC framework: runs capture (evidence: `IngramPro/data.py`)
- POC discovery → CVE checks: discovers checks (evidence: `IngramPro/pocs/__init__.py`)
- POC discovery → Weak credentials: includes credential checks (evidence: `IngramPro/pocs/__init__.py`)
- Camera targets → CVE checks: receives probes
- Camera targets → Weak credentials: receives login checks
- Dahua console → Device interaction: uses device API (evidence: `IngramPro/lib/DahuaConsole/Console.py`)
- Dahua console → Credential manager: uses credentials (evidence: `IngramPro/lib/DahuaConsole/Console.py`)
- Dahua console → Event servers: uses event servers (evidence: `IngramPro/lib/DahuaConsole/Console.py`)
- Dahua connections → Credential manager: uses credentials (evidence: `IngramPro/lib/DahuaConsole/connection.py`)
- Dahua connections → Device interaction: uses device API (evidence: `IngramPro/lib/DahuaConsole/connection.py`)
- Credential manager → Dahua authentication: uses logon modes (evidence: `IngramPro/lib/DahuaConsole/pwdmanager.py`)
- Event servers → Event monitoring: uses event handling (evidence: `IngramPro/lib/DahuaConsole/servers.py`)
- Event monitoring → Dahua connections: uses connection (evidence: `IngramPro/lib/DahuaConsole/events.py`)
- Device interaction → Relay control: supports relay control
- Scan configuration → Network utilities: uses network helpers (evidence: `IngramPro/config.py`)
- Target generation → Network utilities: generates addresses (evidence: `IngramPro/data.py`)
- Scan coordinator → Shared utilities: uses helpers (evidence: `IngramPro/core.py`)
- Scan coordinator → Progress display: updates progress (evidence: `IngramPro/core.py`)
