strings it

Published: April 2, 2026

Description

Can you find the flag in file without running it?

Download the binary named 'strings' from the challenge page.

Solution

  1. Step 1Extract printable strings and grep for the flag
    The strings utility scans any file and prints sequences of consecutive printable characters (default minimum length: 4). Piping the output through grep narrows it to the flag line immediately.
    strings strings | grep picoCTF
    Learn more

    The strings command scans any binary file -- executables, object files, firmware images, documents -- and prints every sequence of consecutive printable ASCII characters that meets a minimum length threshold (default: 4 characters). It works by reading raw bytes and outputting runs of printable characters followed by a null byte or non-printable byte.

    This is powerful for reverse engineering because compiled programs still contain their string literals in plain form in the binary. Error messages, hardcoded URLs, passwords, flag values, and format strings all appear verbatim in the binary's data section. Running strings on an unknown binary is often the very first step in any CTF binary challenge or malware analysis session.

    Useful strings flags to know:

    • -n 8 -- raise minimum length to 8 (reduces noise)
    • -e l -- scan for 16-bit little-endian strings (Windows executables)
    • -t x -- print the file offset (in hex) of each string
    • -a -- scan the entire file, not just loadable sections

    In real-world malware analysis, strings quickly reveals C2 (command-and-control) server hostnames, mutex names, registry keys, and embedded commands. Security tools like FLOSS (FireEye Labs Obfuscated String Solver) extend the concept to also decode obfuscated and dynamically constructed strings that simple strings would miss.

Flag

picoCTF{...}

The strings utility finds sequences of printable characters in any binary -- flags and other secrets embedded in executables are often immediately visible.

More General Skills