설명

    [pwnable.kr][Toddler] flag 문제풀이

    [pwnable.kr][Toddler] flag 문제풀이

    Flag 해당 바이너리를 다운받아 실행해보면 root@kali:~/BoB7/pwnable/flag# ./flag I will malloc() and strcpy the flag there. take it. 위와 같이 뜬다. root@kali:~/BoB7/pwnable/flag# checksec flag [*] '/root/BoB7/pwnable/flag/flag' Arch: amd64-64-little RELRO: No RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x400000) RWX: Has RWX segments Packer: Packed with UPX checksec로 확인해보면 UPX로 실행압축 되었음을 알 수 있다. root@kal..

    [pwnable.kr][Toddler] bof 문제풀이

    [pwnable.kr][Toddler] bof 문제풀이

    bof keyword : Stack Canary #include #include #include void func(int key){ char overflowme[32]; printf("overflow me : "); gets(overflowme);// smash me! if(key == 0xcafebabe){ system("/bin/sh"); } else{ printf("Nah..\n"); } } int main(int argc, char* argv[]){ func(0xdeadbeef); return 0; } main에서 key값으로 0 xdeadbeef값을 인자로 전달한다.32byte크기의 overflow(me배열이 선언되었데, gets함수로 인해 입력 크기를 제한하지 않고 입력 받게 된다.key값을 ..

    [pwnable.kr][Toddler] col 문제풀이

    [pwnable.kr][Toddler] col 문제풀이

    col #include #include unsigned long hashcode = 0x21DD09EC; unsigned long check_password(const char* p){ int* ip = (int*)p; int i; int res=0; for(i=0; i

    [pwnable.kr][Toddler] fd 문제풀이

    [pwnable.kr][Toddler] fd 문제풀이

    fd keyword : File Discriptor #include #include #include char buf[32]; int main(int argc, char* argv[], char* envp[]){ if(argc 123 #문자열 "123"이 정수 123으로 변환 ​ex) atoi("a") -> 0# 알파벳 같은 문자열은 0으로 변환된다. ==>0x1234 : 4660 이다. ssize_t read(int fd, void *buf, size_t nbytes) ​fd : 파일 디스크립터​void *buf : 파일을 읽어 들일 버퍼​size_t nbytes : 버퍼의 크기​return : 정상적으로 실행되었다면 읽어들인 바이트 수를 리턴, 실패시 -1을 반환 리눅스의 File descriptor ..

    [LOB] Level20: xavius → death_knight [完]

    [LOB] Level20: xavius → death_knight [完]

    death_knight /* The Lord of the BOF : The Fellowship of the BOF - dark knight - remote BOF */ #include #include #include #include #include #include #include #include #include main() { char buffer[40]; int server_fd, client_fd; struct sockaddr_in server_addr; struct sockaddr_in client_addr; int sin_size; if((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1){ perror("socket"); exit(1); } server_..

    [LOB] Level19: nightmare → xavius

    [LOB] Level19: nightmare → xavius

    xavius /* The Lord of the BOF : The Fellowship of the BOF - xavius - arg */ #include #include #include main() { char buffer[40]; char *ret_addr; // overflow! fgets(buffer, 256, stdin); printf("%s\n", buffer); if(*(buffer+47) == '\xbf') { printf("stack retbayed you!\n"); exit(0); } if(*(buffer+47) == '\x08') { printf("binary image retbayed you, too!!\n"); exit(0); } // check if the ret_addr is li..

    [LOB] Level18: succubus → nightmare

    [LOB] Level18: succubus → nightmare

    nightmare /* The Lord of the BOF : The Fellowship of the BOF - nightmare - PLT */ #include #include #include #include main(int argc, char *argv[]) { char buffer[40]; char *addr; if(argc < 2){ printf("argv error\n"); exit(0); } // check address addr = (char *)&strcpy; if(memcmp(argv[1]+44, &addr, 4) != 0){ printf("You must fall in love with strcpy()\n"); exit(0); } // overflow! strcpy(buffer, arg..

    [LOB] Level17: zombie_assassin → succubus

    [LOB] Level17: zombie_assassin → succubus

    succubus keyword : RTL /* The Lord of the BOF : The Fellowship of the BOF - succubus - calling functions continuously */ #include #include #include // the inspector int check = 0; void MO(char *cmd) { if(check != 4) exit(0); printf("welcome to the MO!\n"); // olleh! system(cmd); } void YUT(void) { if(check != 3) exit(0); printf("welcome to the YUT!\n"); check = 4; } void GUL(void) { if(check != ..