← BACK TO CHALLENGES
LOGIC

RANDOM

Predictable RNG
200
POINTS
DESCRIPTION
The program calls rand() without calling srand() first. In C, if srand() is never called, rand() uses the default seed of 1 - 100% predictable. Run the same rand() call locally in C (seed=1) to get the exact value the server will use. XOR it with 0xDEADBEEF to compute the required key, then provide it.
HOW TO CONNECT
SSH into the challenge server: Host: pwnable.kr Port: 2222 User: random Pass: guest Command: ssh [email protected] -p2222 Local solve script: #include <stdio.h> #include <stdlib.h> int main(){ unsigned int r = rand(); printf("%u\n", r ^ 0xDEADBEEF); return 0; } gcc solve.c -o solve && ./solve
ssh [email protected] -p2222
SUBMIT FLAG
Login or register to submit flags and earn points.
Flags are found on the challenge server after successful exploitation.