오버플로우

    [LOB] Level16: assassin → zombie_assassin

    [LOB] Level16: assassin → zombie_assassin

    zombie_assassin Keyword : RTL /* The Lord of the BOF : The Fellowship of the BOF - zombie_assassin - FEBP */ #include #include main(int argc, char *argv[]) { char buffer[40]; if(argc < 2){ printf("argv error\n"); exit(0); } if(argv[1][47] == '\xbf') { printf("stack retbayed you!\n"); exit(0); } if(argv[1][47] == '\x40') { printf("library retbayed you, too!!\n"); exit(0); } // strncpy instead of ..

    [LOB] Level15: gaint → assassin

    [LOB] Level15: gaint → assassin

    assassin /* The Lord of the BOF : The Fellowship of the BOF - assassin - no stack, no RTL */ #include #include main(int argc, char *argv[]) { char buffer[40]; if(argc < 2){ printf("argv error\n"); exit(0); } if(argv[1][47] == '\xbf') { printf("stack retbayed you!\n"); exit(0); } if(argv[1][47] == '\x40') { printf("library retbayed you, too!!\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n"..

    [LOB] Level14: bugbear → giant

    [LOB] Level14: bugbear → giant

    giant keyword : RTL(Returen To Library) /* The Lord of the BOF : The Fellowship of the BOF - giant - RTL2 */ #include #include #include main(int argc, char *argv[]) { char buffer[40]; FILE *fp; char *lib_addr, *execve_offset, *execve_addr; char *ret; if(argc < 2){ printf("argv error\n"); exit(0); } // gain address of execve fp = popen("/usr/bin/ldd /home/giant/assassin | /bin/grep libc | /bin/aw..

    [LOB] Level13: darkknight → bugbear

    [LOB] Level13: darkknight → bugbear

    bugbear keyword : RTL /* The Lord of the BOF : The Fellowship of the BOF - bugbear - RTL1 */ #include #include main(int argc, char *argv[]) { char buffer[40]; int i; if(argc < 2){ printf("argv error\n"); exit(0); } if(argv[1][47] == '\xbf') { printf("stack betrayed you!!\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); } 분기문을 통해 RET 부분에 덮여씌워지는 주소 앞주소'\xbf'를 필터링 한다. 즉, '\xbf'로 시작하..

    [LOB] Level12: golem → darkknight

    [LOB] Level12: golem → darkknight

    Darkknight /* The Lord of the BOF : The Fellowship of the BOF - darkknight - FPO */ #include #include void problem_child(char *src) { char buffer[40]; strncpy(buffer, src, 41); printf("%s\n", buffer); } main(int argc, char *argv[]) { if(argc

    [LOB] Level11: skeleton → golem

    [LOB] Level11: skeleton → golem

    golem /* The Lord of the BOF : The Fellowship of the BOF - golem - stack destroyer */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; if(argc < 2){ printf("argv error\n"); exit(0); } if(argv[1][47] != '\xbf') { printf("stack is still your friend.\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); // stack destroyer! memset(buffer, 0, ..

    [BOF, LOB] Level10: vampire → skeleton

    [BOF, LOB] Level10: vampire → skeleton

    skeleton /* The Lord of the BOF : The Fellowship of the BOF - skeleton - argv hunter */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i, saved_argc; if(argc < 2){ printf("argv error\n"); exit(0); } // egghunter for(i=0; environ[i]; i++) memset(environ[i], 0, strlen(environ[i])); if(argv[1][47] != '\xbf') { printf("stack is still your friend.\n"); ex..

    [LOB] 원정대란?

    [LOB] 원정대란?

    [LOB-Lord of Bufferoverflow][BOF-BufferOverflow- 원정대란?]비교적 쉬운 BOF 공략 환경인 Redhat 6.2에서부터 궁극의 Fedora 14까지 수십개의 레벨을 거쳐가며 BOF 시스템 해킹 실습을 하는 War-Game입니다. [접속 방법]BOF 원정대는 도메인이나 IP가 아닌, vmware 이미지 형태로 제공합니다.따라서 각자의 PC에 워게임 서버를 가동하신 후 접속해 풀어나가는 방식입니다. [다운로드]1. 다음 Vmware 이미지를 다운받아 부팅한다.링크(http://hackerschool.org/TheLordofBOF/TheLordOfTheBOF_redhat_bootable.zip)2. gate/gate로 로그인한다.3. netconfig 명령으로 네트워크 설..