# zblurx/dploot architecture

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

- Interactive diagram: https://gitdiagram.com/zblurx/dploot
- Repository: https://github.com/zblurx/dploot

## Overview

##### Main System Components
- Command-Line Interface (CLI) – Represented by the entry point (dploot/entry.py) which parses user commands and dispatches actions.
- Action Modules – Under the “dploot/action” directory are individual modules (e.g., backupkey.py, blob.py, browser.py, certificates.py, etc.) that implement the various commands. These are the “user triage” commands.
- Triage Modules – Under “dploot/triage” which mirror some actions and run multiple commands together (e.g., triage.py calls the separate user triage tasks, while machinetriage aggregates machine-specific operations).
- Core Library – Under “dploot/lib”, a set of shared utility modules (consts.py, crypto.py, dpapi.py, masterkey.py, smb.py, target.py, utils.py, wmi.py) provide cryptographic routines, DPAPI logic, target connections, and other helper functions.
- Configuration and Build/Project Files – Files like pyproject.toml and the Makefile denote packaging/build instructions, though they are secondary in the runtime architecture.

##### Component Relationships and Interactions
- The CLI Entry (dploot/entry.py) accepts input parameters (command, target, credentials, etc.) and routes the request.
- Depending on the chosen command, the entry module delegates to a specific action (or triage) module. For example, if a user calls “dploot masterkeys” or “dploot backupkey,” the corresponding module in the “action” folder gets invoked.
- The Action and Triage modules use the functions provided by the Lib modules to perform tasks such as:
- Connecting to remote targets (using modules like target.py, smb.py, wmi.py).
- Handling DPAPI operations (dpapi.py and masterkey.py).
- Cryptographic calculations (crypto.py).
- Parsing or decrypting various data blobs (utils.py).
- There is a clear separation between modules handling user-specific triage (e.g., certificates, browser, credentials) and those handling machine-specific secret extraction (in both the “action” folder and the mirrored “triage” folder).

##### Important Architectural Patterns or Design Principles
- Modularity – Each discrete DPAPI action (e.g., dumping credentials, certificates, and vaults) is encapsulated in its own module.
- Separation of Concerns – The CLI portion (entry.py) handles interaction and routing while the “action” and “triage” directories implement business logic. The “lib” directory centralizes shared helper functions and low-level cryptography.
- Extensibility – With segregated modules, adding another command (like support for another data source) is straightforward.
- Reuse of code – The crypto and DPAPI decryption routines in the “lib” package are used by multiple action modules.

##### Detail Relevant Technologies and External Interactions
- Python Language and its associated packaging (as indicated by setup files such as pyproject.toml).
- Remote connectivity protocols for accessing Windows systems (e.g., use of SMB, WMI, RemoteRegistry). These can be noted as external “services” that the tool interacts with to retrieve files or secrets.
- DPAPI decryption logic – The tool relies on internal cryptographic functions (using standard algorithms such as 3DES, SHA) to decrypt secrets.
- Potential integration with tools and workflows (for instance, the use of domain backup keys, masterkey files, either via file input or decrypting on the fly).

## Diagram (Mermaid)

```mermaid
graph TD
    E["dploot/entry.py - CLI Router"]:::cli

    subgraph "Action Modules (dploot/action)"
        A1["backupkey.py"]:::action
        A2["blob.py"]:::action
        A3["browser.py"]:::action
        A4["certificates.py"]:::action
        A5["credentials.py"]:::action
        A6["masterkeys.py"]:::action
        A7["machinecertificates.py"]:::action
        A8["machinecredentials.py"]:::action
        A9["machinemasterkeys.py"]:::action
        A10["machinetriage.py"]:::action
        A11["machinevaults.py"]:::action
        A12["mobaxterm.py"]:::action
        A13["rdg.py"]:::action
        A14["sccm.py"]:::action
        A15["triage.py"]:::action
        A16["vaults.py"]:::action
        A17["wam.py"]:::action
        A18["wifi.py"]:::action
    end

    subgraph "Triage Modules (dploot/triage)"
        T1["backupkey.py"]:::triage
        T2["browser.py"]:::triage
        T3["certificates.py"]:::triage
        T4["credentials.py"]:::triage
        T5["masterkeys.py"]:::triage
        T6["mobaxterm.py"]:::triage
        T7["rdg.py"]:::triage
        T8["sccm.py"]:::triage
        T9["vaults.py"]:::triage
        T10["wam.py"]:::triage
        T11["wifi.py"]:::triage
    end

    subgraph "Core Library (dploot/lib)"
        L1["consts.py"]:::lib
        L2["crypto.py"]:::lib
        L3["dpapi.py"]:::lib
        L4["masterkey.py"]:::lib
        L5["smb.py"]:::lib
        L6["target.py"]:::lib
        L7["utils.py"]:::lib
        L8["wmi.py"]:::lib
    end

    subgraph "Configuration & Build Files"
        C1["pyproject.toml"]:::config
        C2["Makefile"]:::config
    end

    External["Windows Target: RemoteRegistry/SMB/WMI"]:::external

    %% Relationships
    E -->|"dispatches"| A1
    E -->|"dispatches"| A2
    E -->|"dispatches"| A3
    E -->|"dispatches"| A4
    E -->|"dispatches"| A5
    E -->|"dispatches"| A6
    E -->|"dispatches"| A7
    E -->|"dispatches"| A8
    E -->|"dispatches"| A9
    E -->|"dispatches"| A10
    E -->|"dispatches"| A11
    E -->|"dispatches"| A12
    E -->|"dispatches"| A13
    E -->|"dispatches"| A14
    E -->|"dispatches"| A15
    E -->|"dispatches"| A16
    E -->|"dispatches"| A17
    E -->|"dispatches"| A18

    E -->|"dispatches"| T1
    E -->|"dispatches"| T2
    E -->|"dispatches"| T3
    E -->|"dispatches"| T4
    E -->|"dispatches"| T5
    E -->|"dispatches"| T6
    E -->|"dispatches"| T7
    E -->|"dispatches"| T8
    E -->|"dispatches"| T9
    E -->|"dispatches"| T10
    E -->|"dispatches"| T11

    %% Representative usage of Core Library by modules
    A1 --> L1
    T1 --> L1
    A3 --> L2
    T5 --> L3
    A5 --> L4
    A7 --> L5
    T7 --> L6
    A9 --> L7
    T9 --> L8

    %% Core Library interacts with External Windows Target for DPAPI decryption and remote access
    L3 -->|"processes"| External

    %% CLI built with configuration files
    E -->|"built_with"| C1
    E -->|"built_with"| C2

    %% Click Events
    click E "https://github.com/zblurx/dploot/blob/main/dploot/entry.py"
    click A1 "https://github.com/zblurx/dploot/blob/main/dploot/action/backupkey.py"
    click A2 "https://github.com/zblurx/dploot/blob/main/dploot/action/blob.py"
    click A3 "https://github.com/zblurx/dploot/blob/main/dploot/action/browser.py"
    click A4 "https://github.com/zblurx/dploot/blob/main/dploot/action/certificates.py"
    click A5 "https://github.com/zblurx/dploot/blob/main/dploot/action/credentials.py"
    click A6 "https://github.com/zblurx/dploot/blob/main/dploot/action/masterkeys.py"
    click A7 "https://github.com/zblurx/dploot/blob/main/dploot/action/machinecertificates.py"
    click A8 "https://github.com/zblurx/dploot/blob/main/dploot/action/machinecredentials.py"
    click A9 "https://github.com/zblurx/dploot/blob/main/dploot/action/machinemasterkeys.py"
    click A10 "https://github.com/zblurx/dploot/blob/main/dploot/action/machinetriage.py"
    click A11 "https://github.com/zblurx/dploot/blob/main/dploot/action/machinevaults.py"
    click A12 "https://github.com/zblurx/dploot/blob/main/dploot/action/mobaxterm.py"
    click A13 "https://github.com/zblurx/dploot/blob/main/dploot/action/rdg.py"
    click A14 "https://github.com/zblurx/dploot/blob/main/dploot/action/sccm.py"
    click A15 "https://github.com/zblurx/dploot/blob/main/dploot/action/triage.py"
    click A16 "https://github.com/zblurx/dploot/blob/main/dploot/action/vaults.py"
    click A17 "https://github.com/zblurx/dploot/blob/main/dploot/action/wam.py"
    click A18 "https://github.com/zblurx/dploot/blob/main/dploot/action/wifi.py"
    click T1 "https://github.com/zblurx/dploot/blob/main/dploot/triage/backupkey.py"
    click T2 "https://github.com/zblurx/dploot/blob/main/dploot/triage/browser.py"
    click T3 "https://github.com/zblurx/dploot/blob/main/dploot/triage/certificates.py"
    click T4 "https://github.com/zblurx/dploot/blob/main/dploot/triage/credentials.py"
    click T5 "https://github.com/zblurx/dploot/blob/main/dploot/triage/masterkeys.py"
    click T6 "https://github.com/zblurx/dploot/blob/main/dploot/triage/mobaxterm.py"
    click T7 "https://github.com/zblurx/dploot/blob/main/dploot/triage/rdg.py"
    click T8 "https://github.com/zblurx/dploot/blob/main/dploot/triage/sccm.py"
    click T9 "https://github.com/zblurx/dploot/blob/main/dploot/triage/vaults.py"
    click T10 "https://github.com/zblurx/dploot/blob/main/dploot/triage/wam.py"
    click T11 "https://github.com/zblurx/dploot/blob/main/dploot/triage/wifi.py"
    click L1 "https://github.com/zblurx/dploot/blob/main/dploot/lib/consts.py"
    click L2 "https://github.com/zblurx/dploot/blob/main/dploot/lib/crypto.py"
    click L3 "https://github.com/zblurx/dploot/blob/main/dploot/lib/dpapi.py"
    click L4 "https://github.com/zblurx/dploot/blob/main/dploot/lib/masterkey.py"
    click L5 "https://github.com/zblurx/dploot/blob/main/dploot/lib/smb.py"
    click L6 "https://github.com/zblurx/dploot/blob/main/dploot/lib/target.py"
    click L7 "https://github.com/zblurx/dploot/blob/main/dploot/lib/utils.py"
    click L8 "https://github.com/zblurx/dploot/blob/main/dploot/lib/wmi.py"
    click C1 "https://github.com/zblurx/dploot/blob/main/pyproject.toml"
    click C2 "https://github.com/zblurx/dploot/tree/main/Makefile"

    %% Styles
    classDef cli fill:#f9c,stroke:#333,stroke-width:2px;
    classDef action fill:#bbf,stroke:#333,stroke-width:2px;
    classDef triage fill:#bfb,stroke:#333,stroke-width:2px;
    classDef lib fill:#ffb,stroke:#333,stroke-width:2px;
    classDef config fill:#fcc,stroke:#333,stroke-width:2px;
    classDef external fill:#cfc,stroke:#333,stroke-width:2px;
```
