This is my write-up of a Misc challenge The Text Editor Jail on the CTF site 247CTF.com.
We didn’t have time to setup and test a proper jail, so this text editor will have to do for now. Can you break free?
When we open the site, we can see that we are inside VIM editor.
If you don’t know, you can execute arbitrary shell commands inside VIM.
In command mode, use :!
to execute a command in the underlying shell. Lets list the files in the currend workind directory:
:! ls
run_for_flag
Nice! As the filename states, we need to run the executable file:
:! ./run_for_flag
Bingo!