hacking

    redpwnCTF - ret2generic-flag-reader

    redpwnCTF - ret2generic-flag-reader

    이번에는 ret2generic-flag-reader 문제를 풀어보자. 일단 아래의 C코드를 확인해보자. #include #include #include void super_generic_flag_reading_function_please_ret_to_me() { char flag[0x100] = {0}; FILE *fp = fopen("./flag.txt", "r"); if (!fp) { puts("no flag!! contact a member of rob inc"); exit(-1); } fgets(flag, 0xff, fp); puts(flag); fclose(fp); } int main(void) { char comments_and_concerns[32]; setbuf(stdout, NULL); ..