[Dreamhack] ssp-001
#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"); } void print_box(unsigned char *box, int idx) { //원하는 인덱스의 box 값을 출력 printf("Element of index %d is : %02x\n", idx, box[idx]);..
[Dreamhack] basic_exploitation_000
환경정보를 살펴보면, 보호기법이 아무것도 적용되지 않고 있다. #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); } int main(int argc, char *argv[]) { char buf[0x80]; initialize(); printf("buf = (%p)\n", buf); scanf("%141s", buf); return 0; } main 함수를 보면 buf..