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

TartarSauce

12 May 2018 · 13 min read · root access
TartarSauce - maquina de Hack The Box

Executive summary — TartarSauce is a Medium Linux box where the real vector hides two levels below the web root: a nested WordPress at /webservices/wp running the gwolle-gb plugin, vulnerable to unauthenticated Remote File Inclusion (CVE-2015-8351) → shell as www-data. A sudo permission over tar escalates to onuma (user flag) via a documented GTFOBins abuse. Root comes from manipulating a periodic root backup script (backuperer): replacing a file with a symlink to root.txt during the race window between packaging and validation forces its diff comparison to fail and leak the flag's content into a readable error log.

PlatformHack The Box
Operating systemLinux
DifficultyMedium
StatusRetired
Target IP10.129.17.13

Attack map

[1] Recon -- 80/tcp http (only vector)
        |
[2] gobuster (two rounds) -- /webservices -> /webservices/wp (nested WordPress)
        |
[3] gwolle-gb plugin -- unauthenticated Remote File Inclusion (RFI) via ajaxresponse.php?abspath=
      +-> PHP reverse shell hosted on our own server, remotely included
      +-> shell as www-data
        |
[4] sudo -l -- (onuma) NOPASSWD: /bin/tar
      GTFOBins: tar --checkpoint-action=exec -> arbitrary execution
      +-> shell as onuma  ->  user.txt
        |
[5] Periodic root process: /usr/sbin/backuperer -- backup at /var/tmp/.random,
      sleep 30, decompresses, diff, error log if differences found
        |
[6] Replace the backup's robots.txt with a symlink to /root/root.txt before
      backuperer processes it -> repack -> diff fails -> the error log
      leaks root.txt's content

1. Reconnaissance

As with any assessment, the first step is finding out which services the box exposes before deciding where to attack.

nmap -p- --min-rate 5000 10.129.17.13
80/tcp open http

-p- scans all 65535 ports (not just the default top 1000) and --min-rate 5000 speeds things up by forcing a more aggressive packet rate — essential so a service on a non-standard port doesn't slip through. The result here is blunt: a single open port, 80. With no SSH exposed and nothing else listening, the entire initial compromise has to go through the web application.

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