SmartHire
Executive summary — SmartHire is a black-box Medium Linux box over a fictional «AI-first hiring» platform that trains scikit-learn models via MLflow. The real vector lives in a hidden MLflow subdomain, unlinked from the app: default credentials → RCE via pickle deserialisation (CVE-2024-37055 family) by uploading a malicious model to the registry →
svcwebshell → root via.pthinjection in a writable plugins directory loaded withsudo NOPASSWD.
| Platform | Hack The Box |
| Operating system | Linux — Ubuntu (nginx 1.18.0 + Flask + MLflow 2.14.1) |
| Difficulty | Medium |
| Status | Retired |
| Scenario | Black box, no credentials |
| Target IP | <TARGET_IP> |
Attack map
[1] Recon web -- app Flask "SmartHIRE" en smarthire.htb (register / dashboard / predict)
|
[2] Vhost fuzzing (cabecera Host, filtrando el catch-all 301) ->
models.smarthire.htb -> instancia MLflow real (401 Basic Auth)
|
[3] Default creds -> admin:password -> API REST completa de MLflow (registry + artifacts)
|
[4] RCE -- pickle deserialization (CVE-2024-37055): subir modelo malicioso
a la version del modelo de NUESTRA cuenta, disparar con /predict
+-> reverse shell como svcweb -> user.txt
|
[5] Root -- sudo NOPASSWD sobre mlflowctl.py -> site.addsitedir() sobre
plugins/dev (escribible por el grupo devs) -> .pth injection
+-> SUID bash -> root.txt
1. Reconnaissance and web app enumeration
nmap -sC -sV -T4 <TARGET_IP>
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.15 (patched against regreSSHion)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to http://smarthire.htb/
nmap -p- --min-rate 3000 confirms only 22 and 80 are open across the full TCP range.
echo "<TARGET_IP> smarthire.htb" | sudo tee -a /etc/hosts
The site («SmartHIRE — AI-first hiring») allows registration (/register: username + company + password) and, after login, a /dashboard with two functions:
POST /upload_hiring_data -- multipart CSV (name,skills,experience,education,
position_applied,previous_company) -> trains a RandomForestClassifier and registers
it in an internal MLflow Model Registry as "{company}-{user_id_hash12}-model"
(random 12-hex hash per account, NOT derivable)
POST /predict -- multipart CSV (experience,skills) -> loads the account's most recent
model via MLflow and returns a 0-100 score
The Flask session (itsdangerous) is readable without the signature but not forgeable:
flask-unsign --decode --cookie '<cookie>' # reveals {username, company, user_id}
flask-unsign --unsign --cookie '<cookie>' --wordlist rockyou.txt
# SECRET_KEY crack against the full wordlist (~56k) -> no luck
Dead ends (ruled out with evidence): documented because they bound the surface and explain why the real vector was outside the app.
| Test | Result |
|---|---|
SSTI in username | {{7*7}} reflects literally, not evaluated |
Path traversal in the model name (company field) | mlflow.register_model() rejects / and % with INVALID_PARAMETER_VALUE |
Blind command injection in company (own HTTP listener) | No callback |
SQLi (manual + sqlmap against /login) | Not injectable (parameterised ORM) |
Traversal in /static/ | nginx normalises ../ before the backend |
NUL byte (\x00) in company | Generic 500 (not the usual JSON), consistent with ValueError: NUL character not allowed from sqlite3 — confirms an SQLite backend, but not exploitable on its own |
A genuine TOCTOU in model delete/recreate (concurrent
upload_hiring_data): confirmed (model_deletedinconsistent between parallel responses), but 15 concurrent requests crashed the VM (each training run takes ~10s of MLflow overhead; the single-worker Flask collapsed → HTB reset). With 2-3 concurrent requests the box is stable but no cross-tenant exploitation was found. Opsec lesson: this was the self-inflicted DoS that forced the IP reset — set a mental concurrency limit before firing heavy parallel loads.
Root Access unlocks the content you can't see — everything else on the site is already open.
See Root Access plansNo account? Create one free then upgrade from your console.