[DreamHack] sint
·
dreamhack/system
Source code#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } void get_shell() { system("/bin/sh"); } int main() { char buf[256]; int size; initialize(); signal(SIGSEGV, get_shell); printf("Size: "); scanf("%d", &size); if (size..
[DreamHack] welcome
·
dreamhack/system
Source code#include int main(void) { FILE *fp; char buf[0x80] = {}; size_t flag_len = 0; printf("Welcome To DreamHack Wargame!\n"); fp = fopen("/flag", "r"); fseek(fp, 0, SEEK_END); flag_len = ftell(fp); fseek(fp, 0, SEEK_SET); fread(buf, 1, flag_len, fp); fclose(fp); printf("FLAG : "); fwrite(buf, 1, flag_len, stdout); } 단순히 실행만 하면 플래그를 얻을 수 있는 간단한 코드이다. Exploit codefrom pwn import * p = proces..
vkeod