UIUCTF 2022

Frame

chall

Analysis

  • know that: $allowed_extensions = array(".jpg", ".jpeg", ".png", ".gif"); -> we can use ".gif" extension file. Finding around and i got this doc

  • We can use gifsicle to embedd PHP code that runs the Linux command into a malicious image named output.php.gif.

Exploit

First way

  • Firstly, we convert png file that we received from chall to gif file

  • I have tried change file extension from png to gif but it doesn't work, of course.

  • I convert by online tool and ... that works. After we that just use this command:

  • Upload the output gif to server:

the path of our requesting

Go to that path and get some interesting things:

  • It works, try other commands to rce :

Here yah gooooo
  • Now just use rce command and got the flag:

flag in some confusing thing like this:

Firstway but easier ~

Now we can rce ez by web shell

/uploads/c654036b5974c786-output.php.gif?command=ls%20-a

Thanks for reading. Have a good day ❀️ !

Last updated