How jgamblin/mirai-source-code works
README describes a botnet comprising an IoT bot, a command-and-control server, and a Telnet-based loader. The documented high-level workflow is loader discovery and deployment, bot execution, then CnC control and attack capability. Source excerpts show the loader’s Telnet state handling and the bot’s initialization/control loop; CnC internals and several supporting subsystems were not excerpted, so their relationships are limited to README-level evidence.
Main entry points: server.c Probe Server · main.go CnC Server · main.c Bot Runtime · attack.c Attack Dispatch
Components 25
Loader
- Loader Entry
loader/src/main.c - Telnet Targets
- Probe Server
loader/src/server.c - Telnet Session
loader/src/connection.c - Target Records
loader/src/headers/telnet_info.h - Binary Selection
loader/src/binary.c - Loader Utilities
loader/src/util.c
IoT Bot
- Bot Runtime
mirai/bot/main.c - Credential Scanner
mirai/bot/scanner.c - Attack Dispatch
mirai/bot/attack.c - Attack Methods
mirai/bot/attack_app.c - Packet Attacks
mirai/bot/attack_tcp.c - GRE Attacks
mirai/bot/attack_gre.c - UDP Attacks
mirai/bot/attack_udp.c - Process Killer
mirai/bot/killer.c - String Table
mirai/bot/table.c
Command And Control
- CnC Server
mirai/cnc/main.go - Admin Interface
mirai/cnc/admin.go - CnC API
mirai/cnc/api.go - Attack Control
mirai/cnc/attack.go - Bot Registry
mirai/cnc/bot.go - Client List
mirai/cnc/clientList.go - CnC Database
mirai/cnc/database.go
Delivery Support
- Payload Delivery
dlr/main.c
Other components
- Operator
Connections 25
- Operator → Admin Interface: administers
README.md - Operator → Loader Entry: runs loader
README.md - Loader Entry → Probe Server: starts probes
loader/src/main.c - Telnet Targets → Probe Server: target probes
README.md - Probe Server → Telnet Session: handles sessions
loader/src/server.c - Probe Server → Target Records: uses target data
loader/src/server.c - Probe Server → Binary Selection: selects payload
loader/src/server.c - Probe Server → Loader Utilities: uses utilities
loader/src/server.c - Probe Server → Bot Runtime: deploys bot
README.md - Bot Runtime → Credential Scanner: starts scanner
mirai/bot/main.c - Bot Runtime → Attack Dispatch: initializes attacks
mirai/bot/main.c - Bot Runtime → Process Killer: initializes killer
mirai/bot/main.c - Bot Runtime → CnC Server: connects to CnC
README.md - Admin Interface → CnC Server: controls
- CnC Server → CnC API: serves API
- CnC Server → Bot Registry: tracks bots
- CnC Server → Client List: tracks clients
- CnC Server → CnC Database: uses database
- CnC Server → Attack Control: dispatches attacks
- Attack Control → Bot Runtime: sends commands
README.md - Attack Dispatch → Attack Methods: dispatches methods
- Attack Dispatch → Packet Attacks: dispatches methods
- Attack Dispatch → GRE Attacks: dispatches methods
- Attack Dispatch → UDP Attacks: dispatches methods
- Payload Delivery → Bot Runtime: payload delivery