Spring
101
A framework for building Java applications.
A Spring extension that simplifies the configuration of Spring apps by providing defaults and conventions to minimize the boilerplate code required.
Recon
The default error page (/error) for Spring applications:

Attacks
Actuators
Spring Boot's actuators is a set of built-in monitoring and debugging features and its endpoints should not be public facing. For instance, /actuator/sessions lists active HTTP Spring sessions. For an example of leveraging an actuator for session hijacking see Cozyhosting.
Config Files
Spring applications will load properties from the application.properties file which is typically under the webroot (/) or the config subdirectory. This file can contain sensitive information, such as credentials and database information. We can use Burp Intruder to enumerate this file.
The example below is based on OffSec's WEB-200 course, more specifically, the Asio lab.


Apache Commons
Apache Commons Text is a part of the larger Apache Commons project, which provides reusable Java components. Specifically, Commons Text offers utility classes for advanced string manipulation. While not part of the Spring Framework itself, it is commonly included in Spring-based applications due to its useful text processing features.
Apache Commons Text from 1.5 up to 1.9 are vulnerable to Text4Shell (CVE-2022-42889). There is a PoC available written for POST requests and using the data parameter. A modified version of the PoC is also available allowing for more flexibility.
JDWP
Java Debug Wire Protocol (JDWP) is a protocol used by the Java Platform Debugger Architecture (JPDA) to enable communication between a debugger and a Java application. It is typically used during development to inspect and control Java programs. While JDWP is not specific to Spring, it can be exposed in Spring-based applications—especially in misconfigured environments or containerized deployments. If left open in production (commonly on port 5005), JDWP can be exploited by attackers to execute arbitrary code, inspect memory, or gain full control over the JVM.
The identification process of a JDWP process goes like this:
We’re in a Java web app:
We find a local open port with no response from manual probbing:
There’s a Java process running as
root:
We suspect this might be debug-related:
The above pattern should trigger the “Maybe it’s JDWP” instinct.
There is a PoC available but we might have to dig a bit more in order to successfully use it. This PoC waits for an event to be triggered in order to achieve RCE; we will have to enumerate the port from which we can do that.
We can then check what the Java process is doing:
Enumerating the outputted paths confirms that the port 5000 is what we are searching for:
Now we can use the PoC and gain a root shell on the target:
Last updated
Was this helpful?