image.png

Want to run this Docker container locally?

 docker run -d -p 3444:80 --name ctf-php-filter --restart always joshbeck2024/ctf-php-filter

We are provided the source code, and we can see that:

image.png

Exploiting with php://filter

php://filter is a built-in PHP stream wrapper.

Think of it like this:

This is a very common technique that allows for LFI (Local File Inclusion)

<http://sem2ctf.icsi.cyber:3444/?page=php://filter/convert.base64-encode/resource=index.php>

image.png

Copy that value, base64 decode, and you’ll find the flag in the php code.