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

Tabby

20 Jun 2020 · 9 min read · root access
Tabby - maquina de Hack The Box

Executive summary — Tabby is an Easy Linux box with a very complete chain: an LFI in news.php first leaks a system user (ash) and then Tomcat's credentials file; those credentials deploy a malicious WAR on the Manager (RCE); a backup ZIP found on the web server itself is cracked and its password is reused for user ash; and since ash is in the lxd group, we escalate to root by building a custom Alpine image on the attacker box and mounting the host filesystem in a privileged container. A LFI → Tomcat WAR → ZIP → LXD → root path.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.129.22.24

Attack map

[80] megahosting.htb/news.php?file= → LFI (path traversal)
   │  /etc/passwd → user «ash»
   │  tomcat-users.xml → Tomcat Manager credentials
   ▼
[8080] Tomcat Manager → deploy WAR (JSP reverse shell) → RCE (tomcat)
   │  /var/www/html/files/16162020_backup.zip → zip2john + hashcat → «admin@it»
   ▼
[su ash]  reused password → user.txt
   │  id → lxd group
   ▼
[LXD]  Alpine image built on the attacker box → privileged container
   │  mounts host / at /mnt/root
   ▼
[ROOT]  /mnt/root/root/root.txt

1. Reconnaissance

Full port and service scan:

nmap -p- -sC -sV -n -oA scan 10.129.22.24
  • -p-: scans all 65535 ports.
  • -sC: Nmap's default scripts.
  • -sV: version detection.
  • -n: skip DNS resolution.
  • -oA scan: saves the output in all three formats as scan.
22/tcp    open  ssh
80/tcp    open  http    Apache
8080/tcp  open  http    Apache Tomcat

Port 8080 is the interesting one: it exposes an Apache Tomcat, which ends up being the initial access vector.

🔒 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.