Hack The Box – Browsed
Proof-of-Concept demonstrating abuse of a Chrome extension upload feature combined with unsafe server-side routine execution.
This repository contains a Python proof-of-concept that targets the Browsed HTB machine.
The attack chain abuses:
- A Chrome extension upload feature
- A Flask endpoint that forwards user-controlled input into a Bash script
- Improper validation of routine identifiers, allowing command injection
The PoC automates:
- Building a malicious Chrome extension
- Uploading it using an anonymous PHP session
- Triggering server-side execution via a crafted request
.
├── browsed_rce.py # Main PoC script
├── README.md # Documentation
└── extension_build/ # Generated at runtime
├── content.js
└── manifest.json
- Python 3.9+
- Linux environment
nc(netcat)- Python dependencies:
requests
Install dependencies:
pip install requestspython browsed_rce.py <IP> <PORT>python browsed_rce.py 10.10.15.157 5050| Flag | Description |
|---|---|
--no-listen |
Skip starting a local listener |
The script generates a command string, base64-encodes it, and treats it strictly as data.
The PoC dynamically generates:
content.jsmanifest.json
These are packaged into a ZIP and uploaded to the target application.
- A new anonymous PHP session is created automatically
- The extension ZIP is uploaded using browser-like headers
The Flask backend exposes the following route:
@app.route('/routines/<rid>')
def routines(rid):
subprocess.run(["./routines.sh", rid])ridis fully user-controlled- Passed directly to a Bash script
- No validation or sanitization is applied
The Bash script expects numeric routine IDs but does not strictly enforce them, allowing crafted input to reach the shell.
| Issue | Description |
|---|---|
Unsafe subprocess usage |
User input forwarded to Bash |
| No strict validation | Assumes numeric routine IDs |
| Extension upload trust | User-controlled JS allowed |
| Local-only assumption | Flask bound to 127.0.0.1 |
- Never pass user input directly to shell scripts
- Avoid
subprocesswhen not strictly required - Replace shell logic with internal Python functions
- Validate and restrict uploaded extension content
This project is intended solely for educational purposes in controlled lab environments such as Hack The Box.
Do not use this code against systems you do not own or have explicit permission to test.