Skip to content
RCE Write-up Intermediate

From Vibe Coding to Threat Hunting: How I Built a Honeypot That Caught the Mirai Botnet

A test instance of a Next.js application was compromised through a React2Shell vulnerability, allowing remote code execution. The attacker used this to download and execute Mirai botnet binaries, establishing a reverse shell and persistence.

rootsploit Follow

Published on medium.com

A developer friend was testing his Chess CoPilot analytic engine application when a critical React2Shell vulnerability in Next.js became the entry point for threat actors deploying Mirai botnet. After observing the initial attack, I decided to build a honeypot to capture and analyze the complete malware infection…

Rootsploit, on medium.com

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

Likely an unpatched Next.js version vulnerable to React2Shell (a remote code execution flaw) combined with exposed services and relaxed security in a test environment.

Impact

The attacker gained full interactive shell access and persistent reinfection, turning the server into a Mirai botnet node.

What the attacker needed

Unpatched Next.js with React2Shell; exposed test environment; no authentication on vulnerable endpoint

The fix

The application should be fixed by updating Next.js to patch the React2Shell vulnerability and by hardening the environment (closing unused ports, implementing rate limiting, WAF rules).

How it was found

  1. Attacker exploited React2Shell vulnerability to execute commands.
  2. Downloaded and executed a dropper script from a remote server.
  3. Dropper downloaded multiple Mirai botnet binaries for different architectures.
  4. The correct binary executed and established a reverse shell to a command-and-control server.
  5. Malware implemented a watchdog to re-infect every 5–10 minutes.

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.

A test server running an old version of Next.js had a bug that let attackers run commands on it. They used this to install malware that turned the server into part of a botnet, which can be used for attacks like flooding websites with traffic.

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.