Skip to main content
Challenges Predictable session token
Cryptography Medium Predictable token Solves: 6

Predictable session token

Author: CyberSamSU
Points
60

In web applications, a session token is an actual password. If it is obtained from a predictable generator, an attacker can calculate the session of another user, even an admin.

The generator here is a truncated LCG. The internal state is 48-bit, but only the upper 32 bits are shown in the token. That is, after each token, 16 bits remain unknown to us. This is 65,536 variants — one second of work for a computer. It is easy to check a candidate: if our guess is correct, the next token calculated from it will also match the token we have.

Leaked code from the server:

M = 1 << 48
A = 25214903917
C = 11
holat = <maxfiy urugʻ>

def keyingi_token():
    global holat
    holat = (A * holat + C) % M
    return holat >> 16          # 32 bit -> 8 ta hex belgi

# 1-, 2-, 3- tokenlar oddiy foydalanuvchilarga berildi
# 4- va 5- tokenlar admin sessiyasiga tegishli:
kalit = keyingi_token().to_bytes(4, 'big') + keyingi_token().to_bytes(4, 'big')
ct = bytes(b ^ kalit[i % 8] for i, b in enumerate(eslatma))

Captured three consecutive user tokens:

token 1: 5c2b3c69
token 2: 98682cf3
token 3: 94e981ca

In the attached file, the admin note is stored encrypted (in hex format). The key is the 4th and 5th tokens.

Sequence order: token 1 = state_1 >> 16, token 2 = state_2 >> 16, ..., admin key = (token 4) || (token 5), each 4 bytes big-endian.

Attached files
admin_eslatma.hex Log in to download
SHA-256 checksums
admin_eslatma.hex: c7c338139d65cfdca0a0fc35f0808f3f042e169433442a2f1f7acdc802f7c6a0
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −6 pts Log in
Hint 2 −12 pts Log in
Hint 3 −18 pts Log in
To submit a flag, log in.

First solvers

1. Faxriddin Oripov 02.10.2026
2. Лазиз 04.10.2026
3. testrejim 09.10.2026
4. Mirjaxon Qaxxarov 27.10.2026
5. Odam 05.11.2026
6. arcanum 11.11.2026