I'm at my CTF final stage and there I have this:
vim flag
iCourse{v3ry_g00d_fl4g}[ESC]13hs1[ESC]am_[ESC]9l2xli_[ESC]2li3[ESC]vypaks[ESC]:s/ry/15
:wq
I'm not really familiar with Vim so I can't figure out how to run this script. I'm guessing it must be doing something bigger than replacing "ry" with "15", because I tried that manually and flag is incorrect. Thanks in advance!
Yes it is possible. When launched with the
-s
command line flag,vim
will fetch commands from an input file:From the man page:
So all you need to do is use a tool like
sed
to convert every occurrence of[ESC]
into an escape character, store the result in a temporary file, and then feed it tovim
: