Era
DonutMaster9/2/20262 min read
#machines#htb#medium#subdomain-fuzzing#idor-file-download#site-backup-extraction#bcrypt-hash-cracking#security-question-account-take#php-ssh2-wrapper-rce#binary-section-patching-(`objc#linux
Era
Platform: HackTheBox | Category: Machines | Type: Machine | Difficulty: Medium | OS: Linux | Author: DonutMaster | Date: 2025-11-30 | Status: Solved Techniques: Subdomain Fuzzing, IDOR File Download, Site Backup Extraction, Bcrypt Hash Cracking, Security Question Account Takeover, PHP SSH2 Wrapper RCE, Binary Section Patching (
objcopy)
Summary
Walkthrough of the HackTheBox Medium machine Era (Linux). Foothold achieved via IDOR on file download endpoint leaking an old site backup zip containing database credentials and password hashes. Escalation via security question modification/takeover, FTP login, and exploiting PHP SSH2 stream wrapper (ssh2.exec://) for RCE. Privesc via patching monitored binary signature section (objcopy).
Recon
Port Scan
bash read-only • copy allowedrustscan -a era.htb -- -A
| Port | Service | Version | Notes |
|---|---|---|---|
| 21/tcp | ftp | vsFTPd 3.0.5 | FTP service |
| 80/tcp | http | Nginx 1.18.0 | Era Designs web app |
Foothold
Exploitation Steps
- Discover subdomain
file.era.htbvia vhost fuzzing. - Register an account and find IDOR vulnerability in
download.php?id=X. Enumerate IDs to locate a site backup zip file (site-backup-30-08-24.zip). - Extract
filedb.sqlitefrom the backup containing user password hashes and security questions. - Update the admin security question via the web panel to take over the admin account, or log in via cracked FTP credentials (
yuri). - Use FTP to upload/access modules, then leverage PHP SSH2 wrapper (
ssh2.exec://) via LFI/show parameter indownload.phpfor RCE (eric).
Privilege Escalation
Root Escalation
- Inspect pspy logs showing root periodically running
objcopy --dump-section .text_sig=...on a monitoring binary. - Replace or patch
/opt/AV/periodic-checks/monitorwith a compiled C reverse shell binary retaining the correct.text_sigsection header. - Trigger execution loop to obtain a root shell.
Flags
| Flag | Location | Value |
|---|---|---|
| user | /home/eric/user.txt | REDACTED |
| root | /root/root.txt | REDACTED |
Key Takeaways / Lessons
- Ensure strict access control checks on IDOR file download endpoints.
- Protect configuration backups and database files containing sensitive password hashes or security question answers.