SpringBoot-Eureka-xstream-rce漏洞复现

SpringBoot-Eureka-xstream-rce

actuator 是 springboot 提供的用来对应用系统进行自省和监控的功能模块。其提供的执行器端点分为两类:原生端点和用户自定义扩展端点,原生端点主要有:

在这里插入图片描述

漏洞利用

1.利用trace,获取认证信息(Cookie、tooken、Session),利用认证信息访问接口

http://localhost:9093/trace

访问/trace端点获取基本的 HTTP 请求跟踪信息(时间戳、HTTP 头等),如果存在登录用户的操作请求,可以伪造cookie进行登录。

在这里插入图片描述

2.利用env加refresh进行getshell

http://localhost:9093/env

访问/env端点获取全部环境属性,由于 actuator 会监控站点 mysql、mangodb 之类的数据库服务,所以通过监控信息有时可以mysql、mangodb 数据库信息,如果数据库正好开放在公网,那么造成的危害是巨大的

在这里插入图片描述

/env端点配置不当造成RCE

利用条件:

  • 可以 POST 请求目标网站的 /env 接口设置属性
  • 可以 POST 请求目标网站的 /refresh 接口刷新配置(存在 spring-boot-starter-actuator 依赖)
  • 目标使用的 eureka-client < 1.8.7(通常包含在 spring-cloud-starter-netflix-eureka-client 依赖中)
  • 目标可以请求攻击者的 HTTP 服务器(请求可出外网)

因为自己搭建的靶场环境一直复现失败,决定直接实战,搜索

app="Eureka-Server"

爬取ip,访问/env路径,若返回状态码为200则可能成功,可以写批量exp的脚本

接下来对我们搜集的ip测试是否出网

在这里插入图片描述

Spring Cloud Starter Eureka Server is a starter dependency that provides the Eureka Server module of the Spring Cloud Netflix project. Eureka Server is a service registry that enables microservices to discover and communicate with each other. With Eureka, each microservice registers itself with the Eureka Server and queries the Eureka Server to find other microservices it depends on. The Spring Cloud Starter Eureka Server provides an easy way to set up an Eureka server instance in a Spring Boot application. It includes all the necessary dependencies and configuration to enable the Eureka Server and register services. To use Spring Cloud Starter Eureka Server, you can add the following dependency to your project: ``` <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency> ``` After adding the dependency, you can annotate your main Spring Boot application class with `@EnableEurekaServer` to enable the Eureka Server: ``` @SpringBootApplication @EnableEurekaServer public class EurekaServerApplication { public static void main(String[] args) { SpringApplication.run(EurekaServerApplication.class, args); } } ``` Once you have the Eureka Server set up, you can register microservices with it using the `@EnableDiscoveryClient` annotation in your microservice application. Overall, the Spring Cloud Starter Eureka Server provides an easy and efficient way to set up an Eureka Server in a Spring Boot application and enable microservice communication.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值