$ cat writeup.md…
$ cat writeup.md…
Hack.lu2026
Task: AES-CBC 'pro activation token' service with a PKCS#7 padding oracle and a custom XOR auth tag. Solution: recover D(.) block-by-block via the oracle, forge the token with backward CBC chaining, and satisfy the tag using trailing whitespace blocks.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Note: Your favorite LinkedIn quote generator has recently moved its truly inspirational quotes behind the Pro tier to keep up with rapidly scaling infrastructure demands.
Already purchased Pro for yourself or your team? Redeem the activation token associated with your Account ID from your billing confirmation.
English summary: a Python TCP service (TLS-wrapped, reached via ncat --ssl <host> 443) is a joke "inspirational quote generator". Free quotes are public; the flag is only returned once Session.sub_state == "pro", which requires submitting a valid "Pro activation token associated with your Account ID" over the upgrade operation. The full server.py source was provided. No real token is ever given, so it must be forged.
The relevant code (server.py):
KEY = bytes.fromhex(os.getenv("KEY", 32 * "0")) if len(KEY) != 16: raise ValueError("Invalid key length.") class Session: def set_name(self, name: str) -> str: self.username = name self.user_id = SHA256.new(name.encode()).hexdigest() # 64 hex chars return f"Account ID: {self.user_id}" def upgrade(self, inp: str) -> str: try: inp_b = bytes.fromhex(inp) except ValueError: return "Invalid activation token format." if len(inp_b) < 16 * 3 or len(inp_b) % 16 != 0: return "Invalid activation token format." iv, ct, auth_tag = inp_b[:16], inp_b[16:-16], inp_b[-16:] cipher = AES.new(KEY, mode=AES.MODE_CBC, iv=iv) pt = unpad(cipher.decrypt(ct), 16) if pt.decode("latin-1").strip() != f"uid: {self.user_id}; tier: pro": return "Activation token does not match this account." auth_tag_dec = AES.new(KEY, AES.MODE_ECB).decrypt(auth_tag) if auth_tag_dec != xor_blocks(pt): return "Activation token integrity check failed." self.sub_state = "pro" return f"Welcome to Pro, {self.username}. ..." def get_quote(self) -> str: if self.sub_state == "pro": return f"Exclusive Pro insight: {FLAG}" ... def main(): ... while True: ... try: match op: case "upgrade": print(session.upgrade(input("Pro activation token: "))) ... except ValueError: pass # <-- swallows unpad()'s padding error, printing NOTHING
Three observations drive the whole attack:
...
$ grep --similar