# mhdgning131/teletunnel architecture

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

- Interactive diagram: https://gitdiagram.com/mhdgning131/teletunnel
- Repository: https://github.com/mhdgning131/teletunnel

## Overview

TeleTunnel is a Windows remote-administration program controlled through a Telegram bot. An authorized Telegram user sends commands; the bot filters messages by configured user ID, dispatches supported operations to local capabilities, and returns results through Telegram. The README documents reconnaissance, command execution, clipboard and file operations, keylogging, and TCP tunneling. Most implementation resides in one C++ source file. The excerpts show portions of the HTTP helper, system reporting, keylogger, and stream manager; other feature nodes and their dispatch links reflect documented capabilities, not inspected implementations.

Main entry points: [`TeleTunnel v2.cpp`](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp) (Bot and dispatcher), [`config.h`](https://github.com/mhdgning131/teletunnel/blob/main/config.h) (Bot configuration), [`nlohmann/json.hpp`](https://github.com/mhdgning131/teletunnel/blob/main/nlohmann/json.hpp) (JSON parsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Telegram control"]
  node_bot["Bot and dispatcher<br/>[TeleTunnel v2.cpp]"]
  node_config["Bot configuration<br/>[config.h]"]
  node_http["WinINet HTTP<br/>[TeleTunnel v2.cpp]"]
  node_json["JSON parsing<br/>[json.hpp]"]
end

subgraph group_host["Host operations"]
  node_recon["Reconnaissance<br/>[TeleTunnel v2.cpp]"]
  node_sysinfo["System report<br/>[TeleTunnel v2.cpp]"]
  node_capture["Desktop capture<br/>[TeleTunnel v2.cpp]"]
  node_processes["Process listing<br/>[TeleTunnel v2.cpp]"]
  node_directories["Directory browser<br/>[TeleTunnel v2.cpp]"]
  node_commands["Command execution<br/>[TeleTunnel v2.cpp]"]
  node_clipboard["Clipboard manager<br/>[TeleTunnel v2.cpp]"]
end

subgraph group_files["File operations"]
  node_files["File transfer and drops<br/>[TeleTunnel v2.cpp]"]
end

subgraph group_tunnel["Keylogging and tunnels"]
  node_keylogger["Keylogger<br/>[TeleTunnel v2.cpp]"]
  node_streams["TCP stream manager<br/>[TeleTunnel v2.cpp]"]
end

node_user(("Authorized user"))
node_telegram["Telegram API"]
node_windows["Windows host APIs"]
node_internal["Internal services"]

node_user -->|"sends commands"| node_telegram
node_telegram -->|"delivers updates"| node_bot
node_bot -->|"reads credentials"| node_config
node_bot -->|"parses updates"| node_json
node_bot -->|"requests API"| node_http
node_http -->|"sends requests"| node_telegram
node_bot -->|"dispatches"| node_recon
node_recon -->|"collects report"| node_sysinfo
node_recon -->|"captures screen"| node_capture
node_recon -->|"lists processes"| node_processes
node_recon -->|"browses paths"| node_directories
node_bot -->|"dispatches"| node_commands
node_bot -->|"dispatches"| node_clipboard
node_bot -->|"dispatches"| node_files
node_bot -->|"dispatches"| node_keylogger
node_bot -->|"dispatches"| node_streams
node_sysinfo -->|"reads host data"| node_windows
node_capture -->|"captures desktop"| node_windows
node_processes -->|"reads processes"| node_windows
node_directories -->|"reads directories"| node_windows
node_commands -->|"runs commands"| node_windows
node_clipboard -->|"accesses clipboard"| node_windows
node_files -->|"reads and writes files"| node_windows
node_keylogger -->|"captures keystrokes"| node_windows
node_streams -->|"connects TCP"| node_internal
node_bot -->|"returns results"| node_telegram
node_user -.->|"uploads files"| node_files

click node_bot "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_config "https://github.com/mhdgning131/teletunnel/blob/main/config.h"
click node_http "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_json "https://github.com/mhdgning131/teletunnel/blob/main/nlohmann/json.hpp"
click node_recon "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_sysinfo "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_capture "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_processes "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_directories "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_commands "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_clipboard "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_files "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_keylogger "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp"
click node_streams "https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.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_bot,node_config,node_http,node_json,node_user toneBlue
class node_recon,node_sysinfo,node_capture,node_processes,node_directories,node_commands,node_clipboard toneAmber
class node_files,node_telegram,node_windows toneMint
class node_keylogger,node_streams toneRose
class node_internal toneIndigo
```

## Components

### Telegram control

- [Bot and dispatcher](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [Bot configuration](https://github.com/mhdgning131/teletunnel/blob/main/config.h): `config.h`
- [WinINet HTTP](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [JSON parsing](https://github.com/mhdgning131/teletunnel/blob/main/nlohmann/json.hpp): `nlohmann/json.hpp`

### Host operations

- [Reconnaissance](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [System report](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [Desktop capture](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [Process listing](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [Directory browser](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [Command execution](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [Clipboard manager](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`

### File operations

- [File transfer and drops](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`

### Keylogging and tunnels

- [Keylogger](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`
- [TCP stream manager](https://github.com/mhdgning131/teletunnel/blob/main/TeleTunnel%20v2.cpp): `TeleTunnel v2.cpp`

### Other components

- **Authorized user**
- **Telegram API**
- **Windows host APIs**
- **Internal services**

## Connections

- Authorized user → Telegram API: sends commands
- Telegram API → Bot and dispatcher: delivers updates
- Bot and dispatcher → Bot configuration: reads credentials
- Bot and dispatcher → JSON parsing: parses updates
- Bot and dispatcher → WinINet HTTP: requests API
- WinINet HTTP → Telegram API: sends requests
- Bot and dispatcher → Reconnaissance: dispatches
- Reconnaissance → System report: collects report
- Reconnaissance → Desktop capture: captures screen
- Reconnaissance → Process listing: lists processes
- Reconnaissance → Directory browser: browses paths
- Bot and dispatcher → Command execution: dispatches
- Bot and dispatcher → Clipboard manager: dispatches
- Bot and dispatcher → File transfer and drops: dispatches
- Bot and dispatcher → Keylogger: dispatches
- Bot and dispatcher → TCP stream manager: dispatches
- System report → Windows host APIs: reads host data
- Desktop capture → Windows host APIs: captures desktop
- Process listing → Windows host APIs: reads processes
- Directory browser → Windows host APIs: reads directories
- Command execution → Windows host APIs: runs commands
- Clipboard manager → Windows host APIs: accesses clipboard
- File transfer and drops → Windows host APIs: reads and writes files
- Keylogger → Windows host APIs: captures keystrokes
- TCP stream manager → Internal services: connects TCP
- Bot and dispatcher → Telegram API: returns results
- Authorized user → File transfer and drops: uploads files
