Description
Find uber-secret.txt hidden somewhere inside the provided archive. Hidden directories (those prefixed with a dot) might conceal the answer.
Setup
Download the archive and extract it. Grep can inspect the expanding tree faster than manual browsing.
Hidden directories (prefixed with .) appear once the archive is unzipped, so make sure your shell shows them.
wget https://artifacts.picoctf.net/c/500/files.zipunzip files.zip && rm files.zipSolution
- Step 1Locate the hidden folderOnce unzipped, the structure includes .secret nested multiple levels deep. Rather than traversing each directory by hand, let grep reveal which file mentions picoCTF.
grep -R picoLearn more
In Unix-like systems, any file or directory whose name begins with a dot (
.) is treated as hidden. These entries are excluded from the default output oflsand most file browsers, but they are fully accessible if you know the name or use flags likels -a(show all). This convention is commonly used for configuration directories (~/.ssh,~/.config) and is a classic hiding spot in CTF challenges.The recursive grep approach bypasses the need to navigate the directory tree at all.
grep -R pico .opens every file in every directory (including hidden ones) and prints matching lines. Because the flag starts withpicoCTF, the patternpicois broad enough to match it without needing to know the exact flag format in advance.In a real security context, analysts use exactly this approach to search for sensitive strings (passwords, API keys, PII) across a file system during a code audit or incident response. Tools like trufflehog, gitleaks, and semgrep automate this at scale for large repositories, but knowing the underlying grep mechanics helps you understand what those tools are doing and catch cases they miss.
- Step 2Inspect uber-secret.txtGrep output shows that files/adequate_books/more_books/.secret/deeper_secrets/deepest_secrets/uber-secret.txt contains the flag. Read it directly to confirm.
cat files/adequate_books/more_books/.secret/deeper_secrets/deepest_secrets/uber-secret.txtLearn more
Once grep reveals the full path,
catreads and prints the file contents. The deeply nested path (adequate_books/more_books/.secret/deeper_secrets/deepest_secrets/) demonstrates how archives can be structured to make manual browsing impractical - there are simply too many directories to check one by one.The hidden directory name
.secretis a common CTF convention inspired by real-world hidden directories. On Linux systems, the.sshdirectory stores private keys,.bash_historystores command history, and.gnupgstores GPG keys - all sensitive files that rely partially on the "hidden by convention" mechanism for obscurity. Attackers know to check these locations first.The takeaway is that security through obscurity alone - hiding files in unusual places or giving them inconspicuous names - is not a reliable defense. Any tool that reads the file system recursively (grep, find, Autopsy) will discover the file regardless of its depth or name. Real security requires access controls, encryption, or both.
- Step 3Trim the outputIf you only want the flag text, pipe grep through an extractor such as grep -oE, cut, or sed to strip away the path prefix.
grep -R pico | grep -oE 'picoCTF\{.*\}' --color=noneLearn more
When grep finds a match inside a named file, it outputs the result in the format
filename:matching_line. The nested grep with-oand an extended regex extracts only the portion of the line that matchespicoCTF\{.*\}. The.*inside the braces is a greedy match that captures everything between the opening and closing brace.The
--color=noneflag prevents ANSI escape codes from appearing in the output, which matters if you are piping the result into another program or saving it to a file - terminal color codes are invisible on screen but would corrupt the text if processed further.This kind of double-grep pipeline (first to find relevant lines, then to extract exactly the right token) appears constantly in CTF automation scripts. Once you internalize it, you can adapt it to extract any structured pattern from noisy output: IP addresses, URLs, email addresses, UUIDs, and more. The same pattern is used in log parsing, threat intelligence extraction, and security automation.
Flag
picoCTF{f1nd_15_f457_ab44...}
Once you know the hidden directory path, viewing uber-secret.txt prints the precise flag shown by grep.