Enhance!

Challenge Overview

Download this image file and find the flag.

Download image file

Solution

wget https://artifacts.picoctf.net/c/101/drawing.flag.svg

First I opened the image to try to "enhance" and see if there was a flag and there wasn't. Then I ran strings drawing.flag.svg and saw the flag.

image

Now I could just copy paste the flag or I could try to make a script to get the flag from the output.

I first took only the data after >" with grep. " to escape the " charater.

strings drawing.flag.svg | grep "\">"

image

Now I used cut to get rid of the first part. "-d" is for the delimeter which in this case is ">" and -f2 is to keep the second feild.

strings drawing.flag.svg | grep "\">" | cut -d ">" -f2

image

Now to get rid of the right side it's the same thing but a different delimeter "<" and -f1 for the first field.

strings drawing.flag.svg | grep "\">" | cut -d ">" -f2 | cut -d "<" -f1

image

Now to get rid of all of the empty lines and new lines use tr with the \n delimeter.

strings drawing.flag.svg | grep "\">" | cut -d ">" -f2 | cut -d "<" -f1 | tr -d "\n"

image

Now it's basically the flag but with spaces in between every letter. That's easily fixed with tr again but with the delimeter being a space " ".

strings drawing.flag.svg | grep "\">" | cut -d ">" -f2 | cut -d "<" -f1 | tr -d "\n" | tr -d " "

image

Flag: picoCTF{3nh4nc3d_24374675}