# c0d3d4ddy/malzy architecture

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

- Interactive diagram: https://gitdiagram.com/c0d3d4ddy/malzy
- Repository: https://github.com/c0d3d4ddy/malzy

## Overview

This repository contains Windows command-and-control and host-execution tooling. The listener gathers connection settings, accepts a client connection, and sends it a command to download and launch a Netcat client; it then starts a separate Netcat listener. The Windows launcher performs environment and privilege checks before downloading and running a remote PowerShell script. A separate utility locates LSASS and attempts to resolve a WDigest function address, but the excerpt shows no injection. The README is empty, so this map reflects only the sampled source.

Main entry points: [`malzy/listener.py`](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py) (TCP command server), [`malzy/main.c`](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c) (Privilege elevation), [`malzy/lsass_inj.c`](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/lsass_inj.c) (LSASS process lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_listener["Listener and control"]
  node_settings["Connection settings<br/>[listener.py]"]
  node_listener_server["TCP command server<br/>[listener.py]"]
  node_netcat["Netcat listener<br/>[listener.py]"]
end

subgraph group_launcher["Windows launcher"]
  node_launcher_checks["Environment checks<br/>[main.c]"]
  node_elevation["Privilege elevation<br/>[main.c]"]
  node_powershell["PowerShell runner<br/>[main.c]"]
end

subgraph group_inspection["Process inspection"]
  node_lsass_lookup["LSASS process lookup<br/>[lsass_inj.c]"]
  node_wdigest_lookup["WDigest address lookup<br/>[lsass_inj.c]"]
end

node_operator(("Operator"))
node_client_host(("Connecting client"))
node_script_host["Remote script host"]

node_operator -->|"provides settings"| node_settings
node_settings -->|"configures"| node_listener_server
node_listener_server -->|"sends command"| node_client_host
node_client_host -->|"connects"| node_listener_server
node_listener_server -->|"starts listener"| node_netcat
node_launcher_checks -->|"gates"| node_elevation
node_elevation -->|"precedes launch"| node_powershell
node_powershell -->|"downloads script"| node_script_host
node_lsass_lookup -->|"provides process ID"| node_wdigest_lookup

click node_settings "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py"
click node_listener_server "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py"
click node_netcat "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py"
click node_launcher_checks "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c"
click node_elevation "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c"
click node_powershell "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c"
click node_lsass_lookup "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/lsass_inj.c"
click node_wdigest_lookup "https://github.com/c0d3d4ddy/malzy/blob/main/malzy/lsass_inj.c"

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_settings,node_listener_server,node_netcat,node_client_host toneBlue
class node_launcher_checks,node_elevation,node_powershell toneAmber
class node_lsass_lookup,node_wdigest_lookup toneMint
class node_operator,node_script_host toneIndigo
```

## Components

### Listener and control

- [Connection settings](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py): `malzy/listener.py`
- [TCP command server](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py): `malzy/listener.py`
- [Netcat listener](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/listener.py): `malzy/listener.py`

### Windows launcher

- [Environment checks](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c): `malzy/main.c`
- [Privilege elevation](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c): `malzy/main.c`
- [PowerShell runner](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/main.c): `malzy/main.c`

### Process inspection

- [LSASS process lookup](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/lsass_inj.c): `malzy/lsass_inj.c`
- [WDigest address lookup](https://github.com/c0d3d4ddy/malzy/blob/main/malzy/lsass_inj.c): `malzy/lsass_inj.c`

### Other components

- **Operator**
- **Connecting client**
- **Remote script host**

## Connections

- Operator → Connection settings: provides settings (evidence: `malzy/listener.py`)
- Connection settings → TCP command server: configures (evidence: `malzy/listener.py`)
- TCP command server → Connecting client: sends command (evidence: `malzy/listener.py`)
- Connecting client → TCP command server: connects (evidence: `malzy/listener.py`)
- TCP command server → Netcat listener: starts listener (evidence: `malzy/listener.py`)
- Environment checks → Privilege elevation: gates (evidence: `malzy/main.c`)
- Privilege elevation → PowerShell runner: precedes launch (evidence: `malzy/main.c`)
- PowerShell runner → Remote script host: downloads script (evidence: `malzy/main.c`)
- LSASS process lookup → WDigest address lookup: provides process ID (evidence: `malzy/lsass_inj.c`)
