Skip to content
RCE Write-up Intermediate

Script Kiddie Nightmares: Hacking Poorly Coded Botnets

The Miori v1.3 botnet's login handler used sprintf to build a shell command with the failed username and password, then passed it to system(), allowing command injection. An attacker could send a crafted username to execute arbitrary commands before authentication, leading to remote code execution.

v3ded.github.io

Published on v3ded.github.io

As the title suggests, this post will touch on the theme of exploiting badly coded botnets, usually ones owned and operated by skids. I never really took interest in such a topic before and therefore knew very little about the “cool” DDoS community.

V3ded, on v3ded.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The code used sprintf to insert user-controlled input into a string passed to system(), without escaping shell metacharacters.

Impact

An unauthenticated attacker could execute arbitrary commands on the botnet server, potentially gaining a root shell if the service ran with elevated privileges.

What the attacker needed

Network access to the C2 server; no authentication required

How it was found

  1. Connect to the botnet's command-and-control server on its listening port.
  2. Send the login command followed by a username containing shell metacharacters and a command, then any password.
  3. The server executes the injected command, which can be a reverse shell.
  4. Start a listener to catch the reverse shell connection.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The botnet's login code took the username you typed and pasted it directly into a command that the computer runs. By typing special characters like a quote and a semicolon, an attacker could break out of the intended command and run their own. This let them take over the server without even logging in.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.