2019/10/04
[LOB] - wolfman -> darkelf 풀이
[LOB] - wolfman -> darkelf 풀이
2019.10.04/* The Lord of the BOF : The Fellowship of the BOF - darkelf - egghunter + buffer hunter + check length of argv[1] */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; 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 yo..
[LOB] - orc -> wolfman 풀이
[LOB] - orc -> wolfman 풀이
2019.10.04/* The Lord of the BOF : The Fellowship of the BOF - wolfman - egghunter + buffer hunter */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; 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"); exit(0); }..
[LOB] - goblin -> orc 풀이
[LOB] - goblin -> orc 풀이
2019.10.04/* The Lord of the BOF : The Fellowship of the BOF - orc - egghunter */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; 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"); exit(0); } strcpy(buffer, argv..
[LOB] - cobolt -> goblin 풀이
[LOB] - cobolt -> goblin 풀이
2019.10.04/* The Lord of the BOF : The Fellowship of the BOF - goblin - small buffer + stdin */ int main() { char buffer[16]; gets(buffer); printf("%s\n", buffer); } 이번 문제는 작은 크기의 buffer 에 gets() 함수로 사용자에게 입력을 받고 있다. 이전 문제 풀이와 똑같이 RTL 공격 기법을 사용할 것이다. RTL에 대한 설명은 아래 링크에 설명되어 있다. https://lactea.kr/entry/bof-Return-to-Libc-RTL-%EA%B3%B5%EA%B2%A9-%EA%B8%B0%EB%B2%95?category=866608 [bof] - Return to Libc (RTL)..
[LOB] - gremlin -> cobolt 풀이
[LOB] - gremlin -> cobolt 풀이
2019.10.04/* The Lord of the BOF : The Fellowship of the BOF - cobolt - small buffer */ int main(int argc, char *argv[]) { char buffer[16]; if(argc cobolt 문제이다. 위 코드를 보면 buffer의 크기가 16bytes로 작아진 것을 볼 수 있다. 즉, buffer에 shellcode를 넣을 수 없다는 뜻이다. 따라서 필자는 RTL 공격 기법을 사용할 것이다. RTL 공격 기법에 대한 설명은 아래 링크..
[LOB] - gate -> gremlin 풀이
[LOB] - gate -> gremlin 풀이
2019.10.04/* The Lord of the BOF : The Fellowship of the BOF - gremlin - simple BOF */ int main(int argc, char *argv[]) { char buffer[256]; if(argc < 2){ printf("argv error\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); } LOB 첫번째 문제이다. buffer 변수의 크기는 256bytes 인데, strcpy에서 argv[1]의 값을 buffer로 값을 복사하는 과정에서 bof 공격이 가능하다. gdb로 분석하기 위해 gate 바이너리 파일을 복사한 후 분석을 진행하겠다. [gate@localhost gate]$ mkd..