Challenge Description:
Try your luck at our card counting mini-game! Get through every level to earn yourself the flag!
basically the game needs u to memorize each card number then add them together and answer its question
so the page loaded
Script
/static/scripts/c2hlbGZhd2F5.js
the game used api requests and each level returned a seed
the full card generation logic was exposed in javascript
JavaScript
const s=1664525;
const i=1013904223;
const o=2147483647;
function h(){
let t=63&r>>4;
let e=t&15;
if(e>9){e=16-e}
let n=3&t>>4;
r=r*s+i&o;
return(n+e*4+16)%40
}
the expression
Expression
63&r>>4
is evaluated as
Expression
63 & (r >> 4)
the card value used by the server was
Value
e + 1
solve
the seed was provided by the game
the prng logic was public
using the seed generated the exact same card sequence as the server
adding all card values gave the correct answer for each level
every correct answer returned the next seed
levels used
Levels
4
8
25
80
50
100
1000
Flag
dalctf{y0vre_re@dy_for_p0k3r}