What Is the “Steal My Bitcoin” PHP RCE Challenge?
If you’ve seen the “Show HN: Steal My Bitcoin” post trending with 440 points and 264 comments, you already know the premise: a developer built a deliberately vulnerable PHP application and is challenging the internet to exploit a Remote Code Execution (RCE) vulnerability to claim a Bitcoin prize. The creator explicitly stated they want to see if anyone can figure out how to actually use the PHP RCE the community spent days panicking over.
The direct takeaway: Do not attempt to exploit this on a production server or your personal machine without isolation. This guide will walk you through setting up a secure, sandboxed environment to analyze the challenge, test your payloads, and understand the mechanics of the vulnerability without risking your own data or breaking the law.
Step-by-Step Guide: Setting Up a Safe Testing Sandbox
To participate in the challenge or analyze the exploit, you need an isolated environment. Here is the exact setup using Docker and a local PHP container.
1. Prerequisites
- Docker Desktop installed (Windows/Mac) or Docker Engine (Linux).
- A code editor (VS Code recommended).
- Burp Suite Community Edition or Postman for intercepting HTTP requests.
- Python 3 for scripting automated payloads.
2. Pull the Vulnerable PHP Image
The challenge likely uses a specific PHP version. Based on the context of recent PHP RCE panics (like CVE-2024-4577 on Windows or similar CGI argument injection flaws), you should replicate the environment. Use a standard PHP-Apache image:
docker pull php:8.1-apache
3. Create the Docker Network and Container
Run the container with a mapped port and a mounted volume for your test scripts. Never expose this to the public internet.
docker run -d --name php-rce-sandbox -p 8080:80 -v $(pwd)/src:/var/www/html php:8.1-apache
4. Configure the Vulnerable App
Clone the repository or recreate the minimal PHP script provided in the HN thread. Typically, these challenges involve a file upload or a parameter that is passed to system() or eval(). Create a index.php in your src folder:
<?php
if (isset($_GET['cmd'])) {
system($_GET['cmd']);
}
?>
5. Test the RCE
Access the container at http://localhost:8080/index.php?cmd=whoami. If it returns www-data, your sandbox is live. Now you can test the actual challenge payloads without risking your host machine.
6. Intercept and Analyze
Use Burp Suite to intercept the request. Modify the cmd parameter to test various bypasses (e.g., cat /etc/passwd, ls -la). If the challenge uses a specific filter, you will need to craft a payload that bypasses escapeshellarg or disable_functions.
Common Issues, Alternatives, and What You Should Know
The “Panic” Context: Why This Matters
The background context mentions “the PHP RCE we spent the last few days panicking over.” This likely refers to a recent critical vulnerability in PHP-CGI (CVE-2024-4577) that allows argument injection on Windows systems. The challenge is a meta-test: can the community apply the theoretical exploit to a real-world scenario?
Troubleshooting Your Sandbox
- Issue:
docker: command not found. Fix: Install Docker Desktop and restart your terminal. - Issue: Port 8080 already in use. Fix: Change the mapping to
-p 8081:80. - Issue: Permission denied on mounted volume. Fix: Run
chmod -R 777 srcon Linux or ensure Docker Desktop has file sharing enabled.
Alternatives to Docker
If you cannot run Docker, use a virtual machine (VirtualBox + Ubuntu Server) or a cloud sandbox like TryHackMe or HackTheBox. Do not use shared hosting or your main VPS.
Security Warning: The Legal Line
Attempting to exploit a server you do not own is illegal under the Computer Fraud and Abuse Act (CFAA) and similar laws globally. The “Steal My Bitcoin” challenge is only legal if you are attacking the creator’s designated server. Never test payloads on random websites.
Frequently Asked Questions (FAQ)
How do I claim the Bitcoin in the “Steal My Bitcoin” challenge?
You must find the RCE, execute a command to read the wallet file or environment variable containing the private key, and transfer the funds. The creator has likely set up a honeypot or a time-locked wallet. Check the HN comments for the exact URL and rules.
Is the PHP RCE in this challenge a zero-day?
No, based on the context, it is likely a known vulnerability (like CVE-2024-4577) or a deliberately introduced flaw in a custom script. The creator is testing if the community can weaponize a known panic into a working exploit.
Can I get in trouble for participating?
Only if you attack systems you don’t own. If you stick to the provided challenge URL and your local sandbox, you are safe. Do not use the payloads on your company’s server or a client’s site.
What tools do I need to exploit a PHP RCE?
At minimum: a browser, Burp Suite (or curl), and a text editor. For advanced bypasses, you may need Python for scripting and a reverse shell listener (netcat).
Final Verdict
The “Steal My Bitcoin” challenge is a brilliant, high-stakes CTF (Capture The Flag) that tests real-world exploitability. Do not attempt this on a live production server. Set up the Docker sandbox outlined above, replicate the PHP version, and test your payloads locally first. If you are new to RCE, start with the basics: command injection, file inclusion, and deserialization. The Bitcoin is a nice prize, but the real value is learning how to safely analyze and mitigate these vulnerabilities in your own code. Patch your PHP installations to the latest version and disable system() and eval() in production.