前言
近日,有研究员公布了自己针对微软的Exchange服务的攻击链的3种利用方式。微软官方虽然出了补丁,但是出于种种原因还是有较多用户不予理会,导致现在仍然有许多有漏洞的服务暴露在公网中,本文主要在原理上简要分析复现了最近的ProxyShell利用链。
[<img src=“https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d38608a75bfc4c4dbde7c2e10a9f0ce4~tplv-k3u1fbpfcp-zoom-in-crop-mark:4536:0:0:0.image)](https://link.juejin.cn/?target=https%3A%2F%2Fwww.oschina.net%2Faction%2FGoToLink%3Furl%3Dhttps%253A%252F%252Fp0.ssl.qhimg.com%252Ft01f79829c1bb0f1c1a.png “https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fp0.ssl.qhimg.com%2Ft01f79829c1bb0f1c1a.png”” style=“margin: auto” />
1.ProxyLogon: The most well-known pre-auth RCE chain
2.ProxyOracle: A plaintext-password recovery attacking chain
3.ProxyShell: The pre-auth RCE chain we demonstrated at Pwn2Own 2021
漏洞复现及分析
复现环境:· Exchange Server 2016 Builder 15.1.1531受影响版本:· Exchange Server 2013 Versions < Builder 15.0.1497.012· Exchange Server 2016 CU18 < Builder 15.1.2106.013· Exchange Server 2016 CU19 < Builder 15.1.2176.009· Exchange Server 2019 CU7 < Builder 15.2.0721.013
利用链大致分两个阶段,ACL绕过和在绕过前提下的wsdl的SOAP接口利用,最终能导致RCE,利用效果图如下:

1.ACL绕过
在ProxyLogon就存在SSRF,而ProxyShell的SSRF利用点稍有不同,但是利用原理还是一致的,在Exchange 端挂调试下断点,调试dll代码如下,可知URL前后解析方式如下:

解析前URL

解析后URL
https: //Exchange:443/autodiscover/autodiscover.json?a=axx@foo.com/autodiscover/autodiscover.xml
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
https: //Exhcage:444/autodiscove/autodiscover.xml
从结果看443端口转向 444端口,那么现在再去看在服务端Exchange的web站点分布情况,页面是跑在IIS组件上的,故而看IIS上的站点分布,存在前台服务和后台服务,即存在80到81、443到444的映射关系。
[<img src=“https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/30c0a5608c624443bac2dc31f7a6b786~tplv-k3u1fbpfcp-zoom-in-crop-mark:4536:0:0:0.image)](https://link.juejin.cn/?target=https%3A%2F%2Fwww.oschina.net%2Faction%2FGoToLink%3Furl%3Dhttps%253A%252F%252Fp1.ssl.qhimg.com%252Ft01cc8b0c546070f865.png “https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fp1.ssl.qhimg.com%2Ft01cc8b0c546070f865.png”” style=“margin: auto” />
前台服务
[<img src=“https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5c6de33ea04b4ca7a2d59a1a0804412f~tplv-k3u1fbpfcp-zoom-in-crop-mark:4536:0:0:0.image)](https://link.juejin.cn/?target=https%3A%2F%2Fwww.oschina.net%2Faction%2FGoToLink%3Furl%3Dhttps%253A%252F%252Fp5.ssl.qhimg.co