PicoCTF — seed-sPRiNG Walkthrough

The challenge prompt

Prerequisites

Tools Used

Understanding the Logic

Reversing the assembly

/* main() */
/* Code to print the banner */
/* Code to seed rand() with current unix time */
/* Code for FOR LOOP below
...
0x000008ab c745f4010000. mov dword [var_ch], 1
0x000008b2 e9be000000 jmp 0x975
...
/* Code to check for correctness of the pattern guessed */
...
0x00000971 8345f401 add dword [var_ch], 1
0x00000975 837df41e cmp dword [var_ch], 0x1e
0x00000979 0f8e38ffffff jle 0x8b7
...
/* Code to print the flag */

Understanding the Pattern generation

The Sequence generator

...
time_t seed = time(0);
srand(seed);
/* Loop that checks for correctness of user's guesses */
for(int i=1; i<=30; i++){
/* CODE TO PRINT PROMPT */
random = rand() & 15;
...

Toe-to-toe with Time

Summarizing my algorithm

Defeating Time

Moment of truth

Conclusion

Programmer🔸Hacker (aka CaptainWoof)🔸Content-creator