# bryanmax9/backdoor-malware-in-c-language architecture

> Architecture diagram of the GitHub repository bryanmax9/backdoor-malware-in-c-language, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bryanmax9/backdoor-malware-in-c-language
- Repository: https://github.com/bryanmax9/backdoor-malware-in-c-language

## Overview

This repository contains educational examples of a TCP command-and-control server and a Windows target agent. The principal workflow is an operator entering commands at the server, which sends them to the agent; the agent executes supported actions and returns responses. Separate agent capabilities include registry-based persistence and a keyboard-capture thread that writes a local log. The README describes an AWS/Kali analysis environment, but the source excerpts do not show deployment wiring or any transfer of the key log to the server.

Main entry points: [`servidor.c`](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/servidor.c) (TCP control server), [`backdoor.c`](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c) (Command execution), [`keylogger.h`](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/keylogger.h) (Keyboard capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Command control"]
  node_server["TCP control server<br/>[servidor.c]"]
end

subgraph group_agent["Target agent"]
  node_target["Windows agent<br/>[backdoor.c]"]
  node_command["Command execution<br/>[backdoor.c]"]
  node_persistence["Registry persistence<br/>[backdoor.c]"]
end

subgraph group_capture["Key capture"]
  node_keylogger["Keyboard capture<br/>[keylogger.h]"]
end

node_operator(("Operator"))
node_runkey[("Windows Run registry")]
node_keyfile["Local key log"]
node_aws["AWS EC2 environment"]

node_operator -->|"enters commands"| node_server
node_server -->|"sends commands"| node_target
node_target -->|"connects by TCP"| node_server
node_target -->|"dispatches commands"| node_command
node_command -->|"sends responses"| node_server
node_command -->|"calls on request"| node_persistence
node_persistence -->|"writes startup entry"| node_runkey
node_command -->|"starts thread"| node_keylogger
node_keylogger -->|"appends keystrokes"| node_keyfile
node_aws -->|"hosts analysis server"| node_server

click node_server "https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/servidor.c"
click node_target "https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c"
click node_command "https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c"
click node_persistence "https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c"
click node_keylogger "https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/keylogger.h"

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_server toneBlue
class node_target,node_command,node_persistence,node_runkey toneAmber
class node_keylogger toneMint
class node_operator,node_keyfile,node_aws toneIndigo
```

## Components

### Command control

- [TCP control server](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/servidor.c): `servidor.c`

### Target agent

- [Windows agent](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c): `backdoor.c`
- [Command execution](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c): `backdoor.c`
- [Registry persistence](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/backdoor.c): `backdoor.c`

### Key capture

- [Keyboard capture](https://github.com/bryanmax9/backdoor-malware-in-c-language/blob/main/keylogger.h): `keylogger.h`

### Other components

- **Operator**
- **Windows Run registry**
- **Local key log**
- **AWS EC2 environment**

## Connections

- Operator → TCP control server: enters commands (evidence: `servidor.c`)
- TCP control server → Windows agent: sends commands (evidence: `servidor.c`)
- Windows agent → TCP control server: connects by TCP (evidence: `backdoor.c`)
- Windows agent → Command execution: dispatches commands (evidence: `backdoor.c`)
- Command execution → TCP control server: sends responses (evidence: `backdoor.c`)
- Command execution → Registry persistence: calls on request (evidence: `backdoor.c`)
- Registry persistence → Windows Run registry: writes startup entry (evidence: `backdoor.c`)
- Command execution → Keyboard capture: starts thread (evidence: `backdoor.c`)
- Keyboard capture → Local key log: appends keystrokes (evidence: `keylogger.h`)
- AWS EC2 environment → TCP control server: hosts analysis server (evidence: `README.md`)
