How soufianetahiri/mirai-botnet works
This repository contains Mirai’s bot, command-and-control service, and Telnet loader. The documented operational loop is bot discovery/reporting, result reception, loading, and subsequent bot activity; the bot also resolves and connects to the CNC, where commands are managed. The graph keeps those product stages distinct from the bot’s internal runtime. Relationships among unsampled CNC modules and some loader startup details are not inferred; edges reflect sampled source or explicit README statements.
Main entry points: main.c Bot runtime · attack.c Command execution · cnc CNC service · server.c Telnet loader
Components 19
Bot runtime
- Bot runtime
mirai/bot/main.c - Device discovery
mirai/bot/scanner.c - Domain resolution
mirai/bot/resolv.c - Command execution
mirai/bot/attack.c - Application methods
mirai/bot/attack_app.c - TCP methods
mirai/bot/attack_tcp.c - UDP methods
mirai/bot/attack_udp.c - GRE methods
mirai/bot/attack_gre.c - Process management
mirai/bot/killer.c
Control plane
- CNC service
mirai/cnc - CNC database access
mirai/cnc/database.go - Bot client list
mirai/cnc/clientList.go
Loading pipeline
- Result receiver
mirai/tools/scanListen.go - Telnet loader
loader/src/server.c - Loader connections
loader/src/connection.c - Binary selection
loader/src/binary.c
Operational utilities
- Table encoder
mirai/tools/enc.c
Other components
- Operator
- MySQL service
Connections 18
- Operator → CNC service: manages
- CNC service → CNC database access: uses
- CNC database access → MySQL service: stores data
- Bot runtime → Domain resolution: resolves CNC
mirai/bot/main.c - Bot runtime → CNC service: connects
- Bot runtime → Device discovery: starts
mirai/bot/main.c - Bot runtime → Command execution: initializes
mirai/bot/main.c - Bot runtime → Process management: initializes
mirai/bot/main.c - Command execution → Application methods: dispatches
- Command execution → TCP methods: dispatches
- Command execution → UDP methods: dispatches
- Command execution → GRE methods: dispatches
- Device discovery → Result receiver: reports results
- Result receiver → Telnet loader: forwards results
- Telnet loader → Loader connections: handles sessions
loader/src/server.c - Telnet loader → Binary selection: selects payload
- CNC service → Bot client list: tracks clients
- Operator → Table encoder: configures strings