mitre-cyber-academy / ctf-scoreboard-archive

Repository for the Deprecated MITRE Capture the Flag scoreboard.
Apache License 2.0
11 stars 10 forks source link

[Request] Regex flag support #45

Open noraj opened 7 years ago

noraj commented 7 years ago

For now flags are strings, but it could be great to support regex flags to allow range of answers or multiple flags (more than just case sensitive or not).

rbclark commented 7 years ago

We already support multiple flags for a single challenge, is that what you are looking for?

noraj commented 7 years ago

For example you make a digital forensics challenge, a memory dump, an ask to find an album of picture and the flag must be the name of one picture, album containing pictures from flag_pic0001.png to flag_pic9999.png you won't enter 9999 different flags but want to enter a regex like /flag_pic[0-9]{4}/. This maybe a bad example but I have not a good one in mind right now.

String flag are enough if you have one or a few possible flags but if you want to support wide range (like in my example) or even complex format like /[ae]{1}[0-9]{2,3}[\s_]{1}[a-zA-Z]*/ for any reasons that's too much possibilities to enter manually. You may have a hard stenography challenge or whatever where answer is open to interpretation and where the player can find several good answer. There a lot of reason wanting to support regex flag in some cases.

And it is rather easy to implement.

rbclark commented 7 years ago

For us this feature doesn't exactly matter too much, for your example we would just have one of the images in the album named MCA-xxxxxxxx to make it obvious which is the expected value. We generally try to design any challenges in a manner that makes it very clear to the user when they have stumbled across the actual flag, and use a very specific flag format in order to make it easy to tell. That being said if this is a feature that you would benefit from we would be happy to consider a pull request for such a feature, however my preference would be that such a feature would have the ability to be toggled on and off and would default to off in order to avoid confusion for people administrating the scoreboard who are not familiar with regex.

noraj commented 7 years ago

I looked at the source code and it seems difficult to integrate this feature with the actual design. And you're right there is always a way to do it with only one string if the challenge is designed correctly. I just see this feature in RootTheBox and seemed cool to me.