// Static ain't always noise
General Skills · Easy · CyLab Security Academy (picoCTF)
// Summary
The flag is stored inside a program file as plain text, mixed in with unreadable machine code. A helper script copies the readable text into its own file, where the flag can be searched for. Like pulling one key out of a sandbox with a magnet.
// Objective
Given: static, an ELF1 binary, and ltdis.sh, a shell script2.
Asked: the flag.
Type: stated.
// Recon
cat static — Mostly unreadable bytes. The file is compiled machine code../ltdis.sh static — Creates static.ltdis.x86_64.txt (the disassembly3) and static.ltdis.strings.txt (the readable text).
// Deduction
- The file is machine code → the flag can't be read with
catdirectly. - Text written into a program's code stays readable after compiling (string literals4) → pull out the readable text.
- The script saves its output to two files → search both for
academy.
// Solve
./ltdis.sh static(if it says permission denied, runchmod +x ltdis.shfirst)
Result: two output files.grep academy static.ltdis.*(searches both output files)
Result: the flag.
// Answer
Plain: the flag was inside the program as ordinary text. A tool that lists only the readable text found it.
Technical: string literals are stored in the binary as printable bytes. strings5, which ltdis.sh runs, lists every run of 4 or more printable characters, and grep6 picks out the flag.
// Dead ends
Assuming the script created the flag — The flag was already in the binary. The script only saved what strings found, so strings static | grep academy does the same in one step.
// Root cause
Skill tested: extracting embedded text from a compiled binary.
Real-world use: running strings is a first step with unknown malware. It shows URLs, IP addresses and messages without running the program.
// Transfer
- Binary plus "find the flag" →
strings file | grep <flag prefix>first. - Nothing found → the flag is built while the program runs → run it, or open it in a debugger.
// Index
- 1Binary / ELFA program file in the processor's own format. ELF is the standard format on Linux.
- 2Shell scriptA text file of terminal commands run in order.
- 3DisassemblyMachine code translated into readable assembly instructions.
- 4String literalText written directly into a program's code, stored as-is in the compiled file.
- 5stringsPrints every run of 4 or more readable characters in a file.
- 6grepPrints only the lines that contain a given pattern.