HackCTF

HackCTF - Random Key

shinobu 2021. 11. 21. 18:21

 

rand 함수 취약점 문제이다

 

같은 값을 생성하는 코드를 짜고 동시에 돌리면 된다

 

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(){
    int v3,v5;

    v3 = time(0LL);
    srand(time(0LL););
    v5 = rand();

    printf("%d\n", v5);
    return 0;
}