# Thread Handoff - Thread: steady-puzzle-2181 - UUID: 6997fbc6-1d6e-4121-9e30-37b3ea96d61b - CTF: midnight-sun-ctf-2026-quals - Challenge: riscal - Runtime: codex - Model: gpt-5.5 - Status: completed ## Transcript - **Assistant:** I’ll inspect the challenge files first, identify the category and validation logic, then use `/workspace` only if I need scratch scripts or artifacts. I’ll also try to send concise progress notes to the provided webhook, but network access may require approval in this environment. - **Assistant:** There’s a single executable in `/challenge`, so this is likely a reversing or pwn-style input validator. I’m going to fingerprint it and look for obvious strings/imports before deciding whether to emulate, decompile, or symbolically solve. - **Assistant:** The binary is a stripped 64-bit RISC-V PIE. The raw strings already expose several interesting constants, including `flag: `, success/failure messages, and a suspicious `midnight{...}` string, but I’m checking whether that string is the required local input or only a decoy before using it against the remote service. - **Assistant:** The main check is clearer now: the program reads exactly 45 bytes, transforms them in-place, and compares the result to `Reversing and pwning are both science and art`. The embedded `midnight{...}` is printed only after the check succeeds, so I’m reversing the transform to get the input needed by the remote. - **Assistant:** The transform reduces to `target[i] = key[i] XOR input[i] XOR input[44-i]`. The equations are symmetric and the middle byte cancels out, so there are many valid 45-byte inputs; I generated a printable one and verified it against the recovered transform in Python. Next I’ll use it on the remote service. - **Assistant:** flag: yeh! midnight{RISCV_1S_4_34zy_1S4_70_unDeRst4Nd!!} - **Assistant:** The remote accepted the generated input and returned the key. I’ll send one final webhook update with the result, then summarize the reverse-engineering path and the exact input used. - **Assistant:** Solved. Flag/key: ```text midnight{RISCV_1S_4_34zy_1S4_70_unDeRst4Nd!!} ``` The binary is a stripped 64-bit RISC-V ELF. Its main logic reads a 45-byte input, transforms it, and compares the transformed buffer with: ```text Reversing and pwning are both science and art ``` The transform is: ```text out[i] = key[i] ^ input[i] ^ input[44 - i] ``` where `key` is the 45-byte blob embedded at `.rodata+0x8`. Reversing that equation gives many valid inputs. One printable valid input I used was: ```text aaaaaaaaaaabaaBaaAACAdA)--&*mg-hW_lVHf}2Fk$)q ``` Submitting it to the server: ```text flag: yeh! midnight{RISCV_1S_4_34zy_1S4_70_unDeRst4Nd!!} ``` - **System:** Thread completed