Publisher Writeup - TryHackMe
Last updated July 13, 2026 • 3 min read
Discovery
Two open TCP ports: SSH on 22 and HTTP on 80. Apache 2.4.41 on Ubuntu. The page title immediately names the technology: Publisher's Pulse: SPIP Insights & Tips.
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 80/tcp open http Apache httpd 2.4.41 ((Ubuntu)) |_http-title: Publisher's Pulse: SPIP Insights & Tips
Enumeration
Directory enumeration finds a /spip path returning a live SPIP CMS install.
images (Status: 200) spip (Status: 200)
SPIP is a PHP CMS. Checking the version from source or the changelog reveals SPIP < 4.2.1 — vulnerable to CVE-2023-27372, an unauthenticated remote code execution via PHP injection in the preview templating system. The vulnerability sits in echappe_retour(), which passes unsanitised input to an eval() call inside traitements_previsu_php_modeles_eval(). No credentials required.
Initial Access
Run the exploit against the /spip endpoint. It automatically fetches the anti-CSRF token, crafts the PHP injection payload, and drops into an interactive pseudo-shell:
[+] Anti-CSRF token found: AKXEs4U6r36PZ5LnRZXtHvxQ/ZZYCXnJB2crlmVwgtlVVXwXn/... [+] The URL http://10.66.139.79/spip is vulnerable [!] Shell is ready, please type your commands UwU # whoami www-data
Shell lands as www-data. Reading /etc/passwd shows one user with a bash shell: think. The user flag is readable directly:
-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAA... -----END OPENSSH PRIVATE KEY-----
Save the key locally, fix permissions, and SSH in as think:
think@ip-10-66-139-79:~$
Privilege Escalation
SUID Binary — run_container
Checking SUID binaries reveals a non-standard entry: /usr/sbin/run_container. Running it presents a Docker container management menu. The underlying script is at /opt/run_container.sh.
-rwxrwxrwx 1 root root 1715 Jan 10 2024 /opt/run_container.sh
The script is world-writable. Attempting to edit it directly fails — the think user's shell is /usr/sbin/ash and an AppArmor profile restricts writes to /opt/ and /tmp/ among others. The profile runs in complain mode though, meaning it logs but does not enforce.
The AppArmor profile applies to /usr/sbin/ash — not to /bin/bash. A bash binary placed in a writable path outside the profile's coverage will run without the write restrictions. /var/tmp is writable and not covered by the profile restrictions:
/var/tmp/bash
Now running under /var/tmp/bash, which is not constrained by the AppArmor profile for ash. Write a payload into the world-writable /opt/run_container.sh:
Trigger the SUID binary to execute the script as root:
connect to [ATTACKER_IP] from (UNKNOWN) [10.66.139.79] whoami root
Root shell obtained.
References
-
CVE-2023-27372 — SPIP < 4.2.1 Remote Code Executionwww.exploit-db.com/exploits/51536 (opens in new tab)
Unauthenticated PHP injection via SPIP preview templating — no credentials required
-
SPIP Security Advisory — CVE-2023-27372spip.net/en_article6627.html (opens in new tab)
Official SPIP security advisory for the RCE in the preview/templating system