CSCTF 2026 · Reverse engineering · 200 pts
PoshTerm.
An Electron terminal's bundled JS hides one real command among dozens of fake flags — and its real logic can be solved without ever calling the APIs it references.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Reverse engineering |
| Points | 200 |
| Status | Solved during the event |
| Target | PoshTerm.exe, offline (static analysis) |
TL;DR. PoshTerm's minified JS defines dozens of decoy commands and hardcoded fake flags, and one genuinely hidden command whose logic looks up a Wikipedia article's first-flight date, converts it to a Julian Date via JPL's API, and RC4-decrypts a bundled ciphertext with that Julian Date string as the key. Rather than call the live APIs, brute-forcing the Julian Date offline against the fixed ciphertext finds the one key that produces a clean flag.
Challenge
Work out what a terminal utility's one unlisted command prints, by static analysis only — the binary must not be run.
Solution
PoshTerm.exe is an Electron app; its "posh" shell is a bundled, minified JavaScript cmdlet system (e("Name", [aliases], [params], "desc", handler)), readable directly from the binary without ever executing it. The source is full of decoys: a hardcoded array of fake flag strings, a Get-Flag cmdlet, a Base64-encoded "Unlock-Vault" string, and an XOR'd flag3000 — none of these are the real answer.
The one genuinely hidden cmdlet (service_code, marked hidden:true) gates on two MD5 checks, then: searches Wikipedia for an article, opens it, and parses its "first flight" date; converts that date to a Julian Date via JPL's ssd-api jd_cal endpoint; and RC4-decrypts a fixed 48-byte ciphertext bundled in the JS, using the Julian Date string's ASCII bytes as the RC4 key.
Rather than hit the live Wikipedia and JPL endpoints (and risk the challenge's own stated organizer-withdrawal rule over access fairness), the Julian Date was brute-forced offline: sweeping the integer part across a 100,000-day range and the fractional part across .0/.25/.5/.75, and RC4-decrypting the bundled ciphertext with each candidate key. Exactly one key out of over 400,000 candidates produces a clean CSCTF{...} string — 2439047.5000000, which corresponds to 1965-10-14 midnight, a date a real Wikipedia lookup for the article in question would also return.
Flag
CSCTF{4_G00D_P0W3RSH3LL_DO35_N0T_C4LL_W1K1P3D14}What I took from it
- When a challenge's logic routes through a live, rate-limited or fairness-sensitive external source, and the final value only needs to satisfy one verifiable property (here, decrypting to a clean flag), brute-forcing that value offline is often faster and safer than calling the live source at all.