


Example analysis of Spring Boot Actuator's unauthorized access to getshell
Preface
The department boss dug this vulnerability in a certain src. It is an old hole. I thought it was interesting, so I set up a local environment to test it.
Actuator is a functional module provided by springboot for introspection and monitoring of application systems. With the help of Actuator, developers can easily view and collect statistics on certain monitoring indicators of the application system. When Actuator is enabled, if relevant permissions are not controlled, illegal users can obtain monitoring information in the application system by accessing the default actuator endpoints, leading to information leakage or even server takeover.
Actuator is a functional module provided by Spring Boot, which can be used for introspection and monitoring of application systems. The provided executor endpoints are divided into two categories: native endpoints and user-defined extension endpoints. The native endpoints mainly include:
utilization ideas
Use env plus refresh to perform getshell
Use mappings to find unauthorized interfaces
Use trace to obtain authentication information (Cookie, Tooken, Session), and use the authentication information to access the interface.
env may leak the database account password (mangodb). Of course, the external network must be opened, so the possibility is small.
Foreigners say that sql statements can be executed, but I don’t understand it yet
Vulnerability discovery
Usually identify the framework used by the current web application as the springboot framework. There are two main ways to judge:
Through the icon of the web application web page label (favicon.ico); if the web application developer has not modified the default icon of the springboot web application, then enter the application After the home page, you can see the following default green small icon:
- ##The default error page is reported through the springboot framework; if The web application developer has not modified the default 4xx and 5xx error pages of the springboot web application. Then when a 4xx or 5xx error occurs in the web application, the following error will be reported (only the 404 error page is used as an example here): Access a randomly constructed path , for example: http://172.26.2.24:8090/index. If the following error page appears, it means that the web website uses the springboot framework (most of the situations encountered in practice are like this).
eureka.client.serviceUrl.defaultZone=http://10.1.1.135:2333/xstream
Then visit /refresh, capture the packet and change the get request to Post request, post data is arbitrary,
# Then in our nc window you can see that a shell has been successfully bounced back.
Vulnerability Repair
As a security dog, you can’t just dig without fixing, introduce spring-boot under the project’s pom.xml file -starter-security depends on
<dependency> <groupid>org.springframework.boot</groupid><artifactid>spring-boot-starter-security</artifactid> </dependency>
Then enable the security function in application.properties, configure the access account password, and restart the application to pop up.
management.security.enabled=true security.user.name=admin security.user.password=admin
To disable the interface, you can set it as follows (such as disabling the env interface):
endpoints.env.enabled = false
Question
Foreigners said that they can execute sql statements but found that they could not be executed. Maybe the method is not correct. I took a screenshot of his picture. I hope someone who can successfully execute it can share it. .
In the actual environment, it is found that there are many no refreshes, resulting in the inability to execute the command. There is no breakthrough yet
The above is the detailed content of Example analysis of Spring Boot Actuator's unauthorized access to getshell. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1
Powerful PHP integrated development environment