Gopher The Flag - A Mini Capture The Flag for Gophers

By Will Roden
October, 10 2023 | Reading time: 1 minute

I went to GopherCon this year and did my first capture the flag. It was about as much fun as I've had at a conference, and I will definitely do it again next year.

I've been mulling another challenge since then, and today I took the time to put it together. I called it "gopher the flag", but after seeing the code, "goto the flag" would have been a better name.

This is a little different from a typical CTF because the flag is in the code. It's just a little obscured.

Try it with go run github.com/willabides/gopher-the-flag/cmd/gtf@v0.0.0. When you enter the correct password, it will give you a flag. The flag is formatted like flag{fffff-fffff-fffff-fffff-fffff}. There is also a bonus flag that you can't get from the command line.

I've come up with two decent solutions. One is a hairier than the other but requires less code. I'm sure there are other ways to do it.

If you try this and find yourself manually following goto statements, you're doing it on hard mode.

The code is at https://github.com/WillAbides/gopher-the-flag