Skip to content
Zone for Exploration and
Understanding of Security
← All writeups
Misc Easy

Trust But Verify

CyLab 2026 · Misc / Interactive Fiction · Easy

Type
Read-through story game, not a hack
Approach
Prompt-aware auto-player
Tools
Python sockets, netcat
Finding
Choices don't gate the flag
FLAG  ✓ captured — flag redacted
Approach
Read the Hintsidentify it's a story game
→
Automationprompt-aware auto-player
→
Findingchoices don't gate the flag
→
Impactflag captured

Summary

The hints make it clear this is a story game, not a puzzle: the game pauses often, and the flag prints near the end. Connect, press through the pauses, answer the choices, read the flag. The twist was automating a slow, mixed-prompt CLI reliably.

Two prompt types: “Press Enter to continue” (blank line) and choice prompts [a/b/c] > that reject a blank. Blasting Enter gets stuck forever on the first choice.

The auto-player

A socket client reads the stream and reacts to whatever prompt is waiting: send a newline for a pause, or score the options and send a letter for a choice. It logs the transcript live and stops as soon as <flag redacted> appears.

python
def pick_choice(text):
    opts = re.findall(r"^\s*([A-Za-z])\)\s*(.*)$", text, re.M)
    good = ["independently","look it up","verify","source","check"]
    bad  = ["type it directly","sounds right","trust","just use","copy"]
    best, bestscore = None, -999
    for letter, desc in opts:
        d = desc.lower(); score = 0
        score += 2*sum(g in d for g in good) - 3*sum(b in d for b in bad)
        if score > bestscore: bestscore, best = score, letter.lower()
    return best

Two real-world fixes made it work: respond only after the stream goes quiet for ~1.2s (a prompt is really waiting) rather than on a fixed timer, and write the transcript to disk live so a timeout never loses the flag.

An honest bug — and a finding

In one scene my scorer picked the wrong (non-verify) option, because I'd carelessly left "run it" in the good keyword list. The flag still printed — which revealed that the choices don't gate the flag; you reach the ending regardless. They only reframe the story.

text
Final choices: b, a, b
...
<flag redacted>

Takeaways

  • Read the hints first — they described the whole challenge and saved any reversing.
  • Detect the prompt before responding; mixed prompt types break naive Enter-spam.
  • Wait on the signal, not a timer, and flush output live so a kill never loses progress.
  • One stray keyword flipped a choice — the same unchecked assumption the game is about: trust, but verify.

Practice next

Explore more security challenges on CyLab Security Academy.

Explore CyLab Security Academy ↗