A new Gafgyt‑derived botnet, C0XMO, is using CVE‑2021‑27137 in DD‑WRT firmware to spread across a wide range of devices, launch massive DDoS attacks, and actively remove competing malware. Fortinet researchers detail its modular design, scanning tactics, and provide concrete mitigation steps.
C0XMO Botnet Exploits DD‑WRT Flaw, Wipes Out Rival Malware
Featured image
A fresh variant of the long‑standing Gafgyt botnet, dubbed C0XMO, has surfaced with a focus on the popular DD‑WRT router firmware. Discovered by Fortinet’s Threat Research team, the malware not only spreads aggressively across IoT and embedded platforms but also hunts down competing botnet clients, effectively clearing the field for its own DDoS operations.
Why this matters now
DD‑WRT powers thousands of consumer and small‑business routers worldwide. The vulnerability it exploits—CVE‑2021‑27137, a buffer overflow caused by insufficient input validation—allows unauthenticated attackers to execute arbitrary code. Once a router is compromised, C0XMO can pivot to any device on the same network, from ARM‑based cameras to x86 servers, dramatically expanding the botnet’s attack surface.
Fortinet’s lead analyst Michele Rossi explains, "The modular nature of C0XMO means operators can drop new exploits or add architectures without rewriting the core payload. That flexibility is why we’re seeing it jump from DD‑WRT routers to DVRs, video‑management platforms, and even Android‑based devices within days."
Technical walk‑through
1. Initial infection vector
- Exploit delivery – The attacker sends a crafted HTTP request to the router’s vulnerable management endpoint (port 7547 by default). The overflow overwrites the stack, hijacking control flow to launch a shell payload.
- Payload drop – A small loader binary is written to a hidden location such as
/tmp/.sysand marked executable. - Persistence – The loader creates a cron entry (
*/15 * * * * /tmp/.sys) and injects a line into/etc/profileso the malware survives reboots.
2. Multi‑architecture expansion
Fortinet recovered binaries for ARM, MIPS, PowerPC, SuperH, x86, and x86_64. Each binary is bundled with a tiny architecture‑detection routine that runs at start‑up and selects the appropriate payload. This approach mirrors earlier Gafgyt families but adds a Python‑based bootstrap that installs required libraries (requests, paramiko, beautifulsoup4) on the compromised host.
3. Scanning and lateral movement
The Python script launches a pool of worker threads that probe the Internet for common service ports:
- SSH (22)
- Telnet (23)
- HTTP/HTTPS (80/443)
- TR‑069 (7547)
- Alternate web ports (8080, 8443, 8888)
When a host responds, the script attempts credential‑stuffing attacks using default or weak passwords. Successful logins trigger the same architecture detection routine, followed by deployment of the matching binary.
4. Killing the competition
C0XMO includes a hard‑coded list of process names associated with rival botnets (e.g., Mirai, Hajime) and popular red‑team tools. It scans /proc and uses kill -9 to terminate these processes, then removes their binaries and any associated cron jobs or init scripts. The list is illustrated in the Fortinet report:
List of processes the malware checks for – Source: Fortinet
5. Command‑and‑Control (C2)
After establishing a foothold, the malware contacts a hard‑coded C2 server using a custom handshake that mixes magic strings with a shared secret. Commands received include:
- Heartbeat – confirms the bot is alive.
- Start/stop scan – toggles the scanning module.
- Launch DDoS – selects one of 19 attack vectors (UDP/TCP/SYN floods, NTP/Memcached amplification, Discord voice UDP floods, Valve‑specific floods, etc.).
The botnet’s DDoS engine can generate traffic in excess of 500 Gbps when coordinated across thousands of infected devices.
Practical takeaways for defenders
| Action | Reason |
|---|---|
| Patch DD‑WRT firmware – Apply the vendor’s latest release that disables the vulnerable TR‑069 endpoint. | Removes the initial exploit path. |
| Rotate admin credentials – Use strong, unique passwords for router admin accounts and disable remote management when not needed. | Stops credential‑stuffing attacks. |
| Network segmentation – Isolate IoT routers from critical servers and restrict outbound traffic on ports 22/23/7547. | Limits lateral movement. |
Monitor for hidden binaries – Look for files named .sys in /tmp, /var/tmp, or /dev/shm. |
Early indicator of C0XMO persistence. |
Process hygiene – Alert on termination of known botnet processes (e.g., mirai, gafgyt). |
Detects the botnet’s “clean‑up” phase. |
| Outbound traffic profiling – Flag sudden spikes in UDP/TCP SYN traffic or connections to known C2 IPs. | Helps catch DDoS preparation. |
Fortinet’s Tomás Delgado adds, "Traditional signature‑based AV struggles with C0XMO because the core binary is tiny and the heavy lifting happens in the Python loader. Behavioral detection—watching for mass credential‑brute forcing and hidden cron jobs—offers a more reliable defense."
What’s next?
C0XMO’s modular framework suggests future updates could incorporate new exploits (e.g., IoT devices with unsecured Telnet consoles) or expand into cloud‑native workloads. Organizations should therefore adopt a defense‑in‑depth posture: keep firmware current, enforce least‑privilege network access, and deploy endpoint detection that watches for the specific behaviors described above.
For a deeper dive, see Fortinet’s full technical advisory here.

Comments
Please log in or register to join the discussion