Had this on a recent engagement and thought I'd provide a cut-down version as a fun little CTF-like challenge.

As an attacker, you can invoke `pwnme()` and control the value of `$filename` via a web request.

You cannot control the contents of the file system that this code is running on. You don't have the ability to upload files.

How do you achieve command injection?

#php #challenge

@oj id start with filename is foo;id
@notaname @oj that would almost certainly fail to pass the file_exists() conditional though. And per the challenge you can't create files on the victim system.
@justinsteven @oj *reads file_exists docs* 
@justinsteven @oj filename is something like https://myserver.com/;<shell command> might need to futz with things