Skip to main content

Obedient Cat picoCTF 2021 Solution

A beginner challenge testing basic file retrieval and reading on the command line.

Published: April 2, 2026Updated: August 13, 2026

Description

This file has a flag in plain sight (which is what 'in-the-clear' means). Download the file called flag.

Download the flag file using wget.

bash
wget <url>/flag

Solution

Want to try it yourself first?

The guided walkthrough reveals hints one step at a time.

Walk me through it
  1. Step 1Print the file contents
    Observation
    The description says the flag is in plain sight inside a downloaded file with no extension. cat prints the raw contents straight to the terminal, with no decoding step at all.
    The flag is stored as plain text in the file. Use cat to print it directly to the terminal.
    bash
    cat flag

    Expected output

    picoCTF{s4n1ty_v3r1f13d_...}
    What didn't work first

    Tried: Opening the downloaded file in a text editor or double-clicking it in a file manager expecting a viewable document.

    With no extension, some editors and file managers treat the file as binary or unknown, and either refuse to open it or show garbled output. cat skips all extension-based guessing and writes the raw bytes to stdout, which works for any plain-text file whatever it is called.

    Tried: Running 'strings flag' to search for the flag instead of 'cat flag'.

    strings filters to printable runs of four characters or more, so it would still find the flag past any binary padding, but it adds a step for nothing here. That four-character minimum can also split or drop short tokens. cat prints the file exactly as stored, which is what you want once the content is known to be plain text.

    Learn more

    cat (short for "concatenate") is one of the most commonly used Unix commands. It reads one or more files and writes their contents to standard output. Despite its simplicity, it's the go-to tool for quickly inspecting small text files, and it's also used to chain files together: cat file1 file2 > combined.

    "In the clear" (or "in plaintext") means data is stored or transmitted without any encryption or obfuscation - it's immediately human-readable. The opposite is data "at rest" protected by encryption, where you need a key to read it. Many real-world security incidents involve sensitive data left in the clear: API keys in public GitHub repos, passwords in unencrypted config files, or traffic sent over HTTP instead of HTTPS.

    wget (Web GET) is a command-line tool for downloading files from the web. It supports HTTP, HTTPS, and FTP. For CTF work, wget <url> is the quickest way to pull down challenge files without opening a browser. An alternative is curl -O <url>, which provides more control over HTTP headers and request methods.

    Sensitive data in the clear is one of the most common real-world security failures. Classic examples include: API keys and tokens checked into public GitHub repositories, database credentials stored in plaintext config files, passwords transmitted over HTTP instead of HTTPS, and private keys left in world-readable files. The 2017 Equifax breach and numerous cloud storage exposures all involved data that was technically accessible without any attack - it was simply stored or transmitted without encryption.

    Beyond cat: For binary files that may contain non-printable characters, xxd or hexdump -C give a hex+ASCII side-by-side view. file identifies the file type by inspecting magic bytes rather than relying on the file extension. less is useful for paging through large files. For this challenge, cat is sufficient since the flag is plain ASCII text, but building the habit of checking file first is good forensic practice.

    Standard output, stdin, and pipelines: cat writes to stdout, which can be redirected with > (overwrite), >> (append), or piped with | into another command. For example, cat flag | grep picoCTF filters lines containing the pattern. Understanding how Unix pipes chain commands is fundamental to CTF work - most solutions involve piping the output of one tool into another.

Interactive tools
  • File Magic IdentifierIdentify file types from magic numbers. Paste hex bytes or drop a file to detect PNG, JPEG, ZIP, PDF, ELF, PCAP, SQLite, and dozens of other formats.
  • Hex ViewerView text or raw hex bytes as a xxd-style hex dump with byte offset, hex columns, and ASCII sidebar. Highlights printable characters and null bytes.
  • Strings ExtractorPull printable text from any binary, library, or image. ASCII and UTF-16 detection, configurable minimum length, flag-like highlight, no command line needed.

Flag

Reveal flag

picoCTF{s4n1ty_v3r1f13d_...}

The simplest possible challenge - the flag is the entire file contents.

Key takeaway

Data in the clear is stored or sent as plain unencrypted text that any observer can read without a key. It is among the most common real security failures: API keys committed to public repositories, credentials in plaintext config files, passwords sent over HTTP. cat reads a file and writes it to standard output, which makes it the first tool to reach for on any unknown file. Noticing that sensitive data was left unprotected matters as much as breaking real encryption.

Related reading

Useful tools for General Skills

Where to go next