Flash CTF – All About Flags

Challenge Description

This challenge presents us with a simple command-line utility written in Go called “All About Flags”. When run, the program displays information about itself and provides various options for interaction.

The program appears to be a straightforward utility that can display version information, show help, and most importantly, reveal a flag when given the right command-line argument.

Initial Exploration

When we first run the program without any arguments, it shows an error message and suggests using the help option:

$ ./all-about-flags
Error: No action specified
Use --help for usage information

This is a common pattern in command-line programs – they require specific arguments to perform actions, and will show helpful error messages when used incorrectly.

Understanding Command Line Arguments

Command-line arguments are additional pieces of information you provide to a program when you run it. Think of them like options or settings that tell the program what you want it to do.

In this case, the program expects us to use what are called “flags” – these are arguments that commonly start with one (-) or two dashes (–) and tell the program to perform specific actions.

Exploring Available Options

The most helpful thing we can do is ask the program what options it supports by using the --help flag:

$ ./all-about-flags --help
Usage: ./all-about-flags [OPTIONS]

All About Flags - A utility for validating and displaying the MetaCTF Flash CTF
- "All About Flags" challenge flag
               
Options:
  --flag
        Display the challenge flag
  --help
        Show this help message
  --verbose
        Enable verbose output
  --version
        Show version information

Examples:
  ./all-about-flags --flag                    Display the challenge flag
  ./all-about-flags --flag --verbose          Display flag with verbose output
  ./all-about-flags --version                 Show version information
  ./all-about-flags --help                    Show this help message

Exit Codes:
  0  Success
  1  Error or invalid usage
  2  Flag not found or invalid

Perfect! Now we can see all the available options. The program supports four main flags:

  • --help: Shows this help message (what we just used)
  • --version: Shows version information
  • --flag: Displays the challenge flag (this sounds promising!)
  • --verbose: Enables verbose output (can be combined with other flags)

Getting the Flag

Based on the help output, it looks like the --flag option is exactly what we need to get the challenge flag. Let’s try it:

$ ./all-about-flags --flag
MetaCTF{I_f1y_m4ny_fl4g5_4nd_c4p7ur3_3v3n_m0r3}

Excellent! We’ve found the flag: MetaCTF{I_f1y_m4ny_fl4g5_4nd_c4p7ur3_3v3n_m0r3}

Understanding What Happened

Let’s break down what we just did:

  1. We identified the program./all-about-flags – this runs the program from the current directory
  2. We used the help system--help showed us all available options
  3. We found the right flag--flag was clearly designed to display the challenge flag
  4. We executed the command: The program responded with the flag we needed

Additional Exploration

We can also explore other features of the program. For example, let’s see the version information:

$ ./all-about-flags --version
All About Flags version 1.0.0
Build: 2025-07-30
Go version: go1.24

And we can combine flags. The --verbose flag can be used with --flag to get more detailed output:

$ ./all-about-flags --flag --verbose
Printing flag...
MetaCTF{I_f1y_m4ny_fl4g5_4nd_c4p7ur3_3v3n_m0r3}
Flag printed sucessfully!

Key Takeaways

This challenge teaches several important concepts:

  1. Command-line interfaces: Many programs, especially security tools and utilities, use command-line arguments instead of graphical interfaces
  2. Help systems: Most command-line programs have built-in help (usually --help or -h) that explain how to use them
  3. Flag-based arguments: Programs often use flags (like --flag--version) to control their behavior
  4. Reading documentation: Always check the help or documentation first to understand what a program can do