Description
I don't like scrolling down to read the code of my website, so I've squished it. As a bonus, my pages load faster! Browse here, and find the flag!
Setup
Browse to the provided URL (http://titan.picoctf.net:<PORT_FROM_INSTANCE>/) and open DevTools.
Solution
Want to try it yourself first?
The guided walkthrough reveals hints one step at a time.
Step 1Inspect the DOM
ObservationThe page says the HTML is squished, meaning minified. The flag is still there in plaintext; search DevTools for the picoCTF{ prefix.Open DevTools (F12), focus the Elements panel, and Ctrl+F for picoCTF. The matching node highlights and you can read the flag in place.Learn more
Browser DevTools (opened with F12 or Ctrl+Shift+I) provide a live, structured view of the DOM that is far more readable than raw source. The Elements panel lets you navigate the full HTML tree, search for text, and inspect attributes - even in heavily minified pages where the source is a single long line.
Minification compresses HTML, CSS, and JavaScript by removing whitespace, comments, and shortening variable names to reduce file size and improve load times. It is a performance optimization, not a security measure. The content is identical to the original - it is just harder to read at a glance. The browser's DevTools automatically parse and pretty-print minified code in the Elements panel.
- Use Ctrl+F in the Elements panel to search for text like
picoCTFacross the entire DOM tree. - The Sources panel has a "Pretty print" button (
{}) that reformats minified JS/CSS with proper indentation. - View Source (Ctrl+U) shows the raw HTML as served by the server, before JavaScript modifies the DOM.
- Use Ctrl+F in the Elements panel to search for text like
Step 2One-liner option
ObservationThe whole page is one long line, so reading it by eye is hopeless. Pipe curl into grep with a non-greedy character class and pull the flag out directly.curl -s fetches the page and grep -oE picks out only the flag substring. The character class [^}]+ matches any flag body up to the first closing brace.bashcurl -s http://titan.picoctf.net:<PORT_FROM_INSTANCE>/ | grep -oE 'picoCTF\{[^}]+\}'Expected output
picoCTF{pr3tty_c0d3_743...}What didn't work first
Tried: Run curl without grep and scroll through the output hoping to spot the flag manually.
Minification puts the whole page on one very long line, where a short flag is nearly invisible. grep -oE isolates the match instead of leaving you to scan thousands of characters of concatenated HTML.
Tried: Use grep -o 'picoCTF{.*}' (greedy dot-star) instead of the [^}]+ character class.
A greedy .* runs from the first picoCTF{ to the last closing brace on the line. Minified HTML is full of braces, from CSS rules and JS objects, so the match swallows far too much. The negated class stops at the first closing brace, which is where the flag ends.
Learn more
curl -sfetches a URL silently (no progress bar) and prints the response body to stdout. Piping throughgrep -oE 'picoCTF\{[^}]+\}'extracts only the matching portion using an extended regex (-E) and prints only the match (-o) rather than the whole line. The character class[^}]+matches any character that is not a closing brace, so the pattern stops cleanly at the end of the flag.This pipeline approach is a fundamental CTF and security research skill. Instead of manually reading through thousands of bytes of minified HTML, you let regex do the work. The same pattern applies to searching server responses, log files, and API output for sensitive information during penetration tests.
If your shell aliases grep to
--color=alwaysand a redirected file comes out garbled with escape codes, add--color=never; the default--color=autoalready drops the ANSI sequences when the output is not a terminal. Real CTF flags are often embedded inside HTML attribute values or JavaScript strings, so a tighter regex is sometimes needed if multiple matches collide on one line.
Interactive tools
- 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.
- Regex TesterTest regular expressions against a string with live match highlighting, flag toggles, and common CTF pattern shortcuts.
Flag
Reveal flag
picoCTF{pr3tty_c0d3_743...}
Even minified HTML can't hide a plaintext flag.