# curry06/sysmon architecture

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

- Interactive diagram: https://gitdiagram.com/curry06/sysmon
- Repository: https://github.com/curry06/sysmon

## Overview

SysMon is a Windows monitoring and remote-control payload. Its main workflow starts at WinMain, which initializes persistence and background capture/listener threads; captured input and screenshots are sent through Telegram-facing HTTPS code. The README also documents clipboard tracking, watchdog recovery, and remote self-destruct. Some relationships below are supported by the README rather than sampled implementation excerpts; the keylogger implementation was read but its function bodies are not included here.

Main entry points: [`src/main.cpp`](https://github.com/curry06/sysmon/blob/main/src/main.cpp) (WinMain runtime), [`src/telegram.cpp`](https://github.com/curry06/sysmon/blob/main/src/telegram.cpp) (Telegram HTTPS API), [`src/c2_listener.cpp`](https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp) (Command polling), [`src/keylogger.cpp`](https://github.com/curry06/sysmon/blob/main/src/keylogger.cpp) (Keyboard monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime orchestration"]
  node_winmain["WinMain runtime<br/>[main.cpp]"]
  node_sharedconfig["Shared configuration<br/>[config.h]"]
  node_crypto["Configuration decryption<br/>[crypto.cpp]"]
end

subgraph group_capture["Monitoring and capture"]
  node_keylogger["Keyboard monitoring<br/>[keylogger.cpp]"]
  node_clipboard["Clipboard tracking<br/>[keylogger.cpp]"]
  node_screenshots["Screenshot capture<br/>[screenshot.cpp]"]
end

subgraph group_communications["Telegram communications"]
  node_telegramapi["Telegram HTTPS API<br/>[telegram.cpp]"]
  node_listener["Command polling<br/>[c2_listener.cpp]"]
  node_offset[("Polling offset storage<br/>[c2_listener.cpp]")]
  node_nuke["Remote self-destruct<br/>[c2_listener.cpp]"]
end

subgraph group_persistence["Persistence and recovery"]
  node_persistence["Startup persistence<br/>[persistence.cpp]"]
  node_replication["Disk replicas<br/>[persistence.cpp]"]
  node_defender["Defender exclusions<br/>[persistence.cpp]"]
  node_watchdog["Watchdog recovery<br/>[persistence.cpp]"]
end

node_operator(("Remote operator"))
node_telegram{{"Telegram Bot API"}}
node_windows{{"Windows desktop"}}

node_winmain -->|"uses globals"| node_sharedconfig
node_winmain -->|"installs"| node_persistence
node_winmain -->|"starts replication"| node_replication
node_winmain -->|"adds exclusions"| node_defender
node_winmain -->|"starts thread"| node_screenshots
node_winmain -->|"starts thread"| node_clipboard
node_winmain -->|"installs hook"| node_keylogger
node_winmain -->|"starts thread"| node_listener
node_winmain -->|"checks periodically"| node_watchdog
node_winmain -->|"loads and saves"| node_offset
node_screenshots -->|"uploads photos"| node_telegramapi
node_keylogger -->|"sends telemetry"| node_telegramapi
node_clipboard -->|"sends clipboard data"| node_telegramapi
node_telegramapi -->|"sends HTTPS requests"| node_telegram
node_listener -->|"downloads updates"| node_telegramapi
node_listener -->|"updates offset"| node_offset
node_operator -->|"issues commands"| node_telegram
node_listener -->|"dispatches nuke"| node_nuke
node_nuke -->|"removes startup entries"| node_persistence
node_nuke -->|"deletes replicas"| node_replication
node_watchdog -->|"restores startup"| node_persistence
node_watchdog -->|"restores executable"| node_replication
node_keylogger -->|"monitors input"| node_windows
node_clipboard -->|"reads clipboard"| node_windows
node_screenshots -->|"captures desktop"| node_windows
node_crypto -.->|"decrypts settings"| node_sharedconfig

click node_winmain "https://github.com/curry06/sysmon/blob/main/src/main.cpp"
click node_sharedconfig "https://github.com/curry06/sysmon/blob/main/include/config.h"
click node_crypto "https://github.com/curry06/sysmon/blob/main/src/crypto.cpp"
click node_keylogger "https://github.com/curry06/sysmon/blob/main/src/keylogger.cpp"
click node_clipboard "https://github.com/curry06/sysmon/blob/main/src/keylogger.cpp"
click node_screenshots "https://github.com/curry06/sysmon/blob/main/src/screenshot.cpp"
click node_telegramapi "https://github.com/curry06/sysmon/blob/main/src/telegram.cpp"
click node_listener "https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp"
click node_offset "https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp"
click node_persistence "https://github.com/curry06/sysmon/blob/main/src/persistence.cpp"
click node_replication "https://github.com/curry06/sysmon/blob/main/src/persistence.cpp"
click node_defender "https://github.com/curry06/sysmon/blob/main/src/persistence.cpp"
click node_watchdog "https://github.com/curry06/sysmon/blob/main/src/persistence.cpp"
click node_nuke "https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp"

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_winmain,node_sharedconfig,node_crypto toneBlue
class node_keylogger,node_clipboard,node_screenshots toneAmber
class node_telegramapi,node_listener,node_offset,node_nuke,node_telegram toneMint
class node_persistence,node_replication,node_defender,node_watchdog toneRose
class node_operator,node_windows toneIndigo
```

## Components

### Runtime orchestration

- [WinMain runtime](https://github.com/curry06/sysmon/blob/main/src/main.cpp): `src/main.cpp`
- [Shared configuration](https://github.com/curry06/sysmon/blob/main/include/config.h): `include/config.h`
- [Configuration decryption](https://github.com/curry06/sysmon/blob/main/src/crypto.cpp): `src/crypto.cpp`

### Monitoring and capture

- [Keyboard monitoring](https://github.com/curry06/sysmon/blob/main/src/keylogger.cpp): `src/keylogger.cpp`
- [Clipboard tracking](https://github.com/curry06/sysmon/blob/main/src/keylogger.cpp): `src/keylogger.cpp`
- [Screenshot capture](https://github.com/curry06/sysmon/blob/main/src/screenshot.cpp): `src/screenshot.cpp`

### Telegram communications

- [Telegram HTTPS API](https://github.com/curry06/sysmon/blob/main/src/telegram.cpp): `src/telegram.cpp`
- [Command polling](https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp): `src/c2_listener.cpp`
- [Polling offset storage](https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp): `src/c2_listener.cpp`
- [Remote self-destruct](https://github.com/curry06/sysmon/blob/main/src/c2_listener.cpp): `src/c2_listener.cpp`

### Persistence and recovery

- [Startup persistence](https://github.com/curry06/sysmon/blob/main/src/persistence.cpp): `src/persistence.cpp`
- [Disk replicas](https://github.com/curry06/sysmon/blob/main/src/persistence.cpp): `src/persistence.cpp`
- [Defender exclusions](https://github.com/curry06/sysmon/blob/main/src/persistence.cpp): `src/persistence.cpp`
- [Watchdog recovery](https://github.com/curry06/sysmon/blob/main/src/persistence.cpp): `src/persistence.cpp`

### Other components

- **Remote operator**
- **Telegram Bot API**
- **Windows desktop**

## Connections

- WinMain runtime → Shared configuration: uses globals (evidence: `src/main.cpp`)
- WinMain runtime → Startup persistence: installs (evidence: `src/main.cpp`)
- WinMain runtime → Disk replicas: starts replication (evidence: `src/main.cpp`)
- WinMain runtime → Defender exclusions: adds exclusions (evidence: `src/main.cpp`)
- WinMain runtime → Screenshot capture: starts thread (evidence: `src/main.cpp`)
- WinMain runtime → Clipboard tracking: starts thread (evidence: `src/main.cpp`)
- WinMain runtime → Keyboard monitoring: installs hook (evidence: `src/main.cpp`)
- WinMain runtime → Command polling: starts thread (evidence: `src/main.cpp`)
- WinMain runtime → Watchdog recovery: checks periodically (evidence: `src/main.cpp`)
- WinMain runtime → Polling offset storage: loads and saves (evidence: `src/main.cpp`)
- Screenshot capture → Telegram HTTPS API: uploads photos (evidence: `src/screenshot.cpp`)
- Keyboard monitoring → Telegram HTTPS API: sends telemetry (evidence: `README.md`)
- Clipboard tracking → Telegram HTTPS API: sends clipboard data (evidence: `README.md`)
- Telegram HTTPS API → Telegram Bot API: sends HTTPS requests (evidence: `src/telegram.cpp`)
- Command polling → Telegram HTTPS API: downloads updates (evidence: `src/c2_listener.cpp`)
- Command polling → Polling offset storage: updates offset (evidence: `src/c2_listener.cpp`)
- Remote operator → Telegram Bot API: issues commands (evidence: `README.md`)
- Command polling → Remote self-destruct: dispatches nuke (evidence: `src/c2_listener.cpp`)
- Remote self-destruct → Startup persistence: removes startup entries (evidence: `src/c2_listener.cpp`)
- Remote self-destruct → Disk replicas: deletes replicas (evidence: `src/c2_listener.cpp`)
- Watchdog recovery → Startup persistence: restores startup (evidence: `src/persistence.cpp`)
- Watchdog recovery → Disk replicas: restores executable (evidence: `src/persistence.cpp`)
- Keyboard monitoring → Windows desktop: monitors input (evidence: `README.md`)
- Clipboard tracking → Windows desktop: reads clipboard (evidence: `README.md`)
- Screenshot capture → Windows desktop: captures desktop (evidence: `src/screenshot.cpp`)
- Configuration decryption → Shared configuration: decrypts settings (evidence: `src/crypto.cpp`)
