root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat editorial.md
// writeups

Editorial

15 Jun 2024 · 12 min read · root access
Editorial - maquina de Hack The Box

Executive summary — Editorial is an Easy Linux box with a very instructive chain end to end. A publisher's site lets you upload a book cover directly from a URL, which opens a classic SSRF in /upload-cover. Using it as an internal port scanner with ffuf we discover an unauthenticated API on 127.0.0.1:5000 that leaks the dev user's credentials. Once inside over SSH, a forgotten git repository in the home directory keeps prod's password in its history (not the current code). Finally, prod can sudo a script that clones repositories with GitPython 3.1.29, vulnerable to CVE-2022-24439: git's ext:: transport allows injecting system commands, which we use to craft a SUID copy of /bin/sh and get root. Path: SSRF → internal API → dev → git log → prod → GitPython (CVE-2022-24439) → root.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.129.10.105

Attack map

[80] editorial.htb → /upload-cover accepts a URL (bookurl) → SSRF confirmed
   │  ffuf against 127.0.0.1 → internal port 5000 → unauth API leaks dev creds
   ▼
[SSH]  dev  (user.txt)
   │  leftover git repo in ~/apps → history reveals prod credentials
   ▼
[su]  prod
   │  sudo clone_prod_change.py (GitPython 3.1.29) → CVE-2022-24439 (ext:: protocol)
   ▼
[ROOT]  SUID shell via /bin/sh copied to /tmp/rootsh

1. Reconnaissance

Port and service scanning always comes first: it tells us the attack surface before touching anything else.

nmap -p- --min-rate 10000 10.129.10.105
22/tcp open  ssh
80/tcp open  http
nmap -sCV -p22,80 10.129.10.105
22/tcp open  ssh   OpenSSH 8.9p1
80/tcp open  http  nginx 1.18.0

The web service redirects to http://editorial.htb, so we add the domain to our hosts file to browse it by name:

echo "10.129.10.105 editorial.htb" | sudo tee -a /etc/hosts
ping -c 2 editorial.htb
🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.