공격

    [LOB] Level7: darkelf → orge (renew)

    [LOB] Level7: darkelf → orge (renew)

    orge /* The Lord of the BOF : The Fellowship of the BOF - orge - check argv[0] */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; if(argc < 2){ printf("argv error\n"); exit(0); } // here is changed! if(strlen(argv[0]) != 77){ printf("argv[0] error\n"); exit(0); } // egghunter for(i=0; environ[i]; i++) memset(environ[i], 0, strlen(environ[i])); if(a..

    [LOB] Level6: wolfman → darkelf (renew)

    [LOB] Level6: wolfman → darkelf (renew)

    darkelf keyword : /* 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(..

    [LOB] Level5: orc → wolfman (renew)

    [LOB] Level5: orc → wolfman (renew)

    wolfman keyword : egghunter+bufferhunter /* 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("st..

    [LOB] Level4: goblin → orc (renew)

    [LOB] Level4: goblin → orc (renew)

    orc keyword : BoF+egghunter /* 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"); ex..

    [LOB] Level3: cobolt → goblin (renew)

    [LOB] Level3: cobolt → goblin (renew)

    goblin keyword : BoF+env+argv /* 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); } 0x01. Static Analysis 앞서 문제 cobolt와 다른점은 cobolt에서는 main함수의 argv로 입력값을 받았다면, 지금 문제는 gets를 이용하여 문제를 받는다. 따라서 값을 넘겨주는 방식의 차이만 있을 뿐 앞 문제와 풀이 과정은 동일하다. 0x02. Dynamic Analysis & Exploit cobolt 문제와 동일하게 환경변수에 쉘코드를 넣고 문제..

    [LOB] Level2: gremlin → cobolt (renew)

    [LOB] Level2: gremlin → cobolt (renew)

    Cobolt keyword : BoF+env 0x01. Static Analysis /* The Lord of the BOF : The Fellowship of the BOF - cobolt - small buffer */ int main(int argc, char *argv[]) { char buffer[16]; if(argc < 2){ printf("argv error\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); } 주어진 cobolt바이너리의 소스코드를 살펴보자.buffer의 크기는 16바이트인데 strcpy로 크기 제한없이 argv의 인자값을 buffer로 복사한다.전 문제인 gremlin과 마찬가지로 BoF 취약점이 존재한다..

    [LOB] Level1: gate → gremlin (renew)

    [LOB] Level1: gate → gremlin (renew)

    gremlin keyword : BoF 0x01. Static Analysis /* 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); } 제공되는 소스코드를 살펴보면 굉장히 단순한 프로그램이다.argv인자로 받은 값을 strcpy함수를 이용하여 buffer에 저장하는데, buffer의 크기는 256바이트이다.여기서 Buffer OverFlow 취약점이 존재한..

    [FC3] Fedora Catle 3

    [FC3] Fedora Catle 3

    [FC3 - 총 5문제] FC1~FC3까지 동일 환경이기 때문에 FC3 환경에서부터 시작합니다. [주소] http://hackerschool.org/TheLordofBOF/VM_FC3.zip [환경 요약] Stack Dummy : O Down privileage of bash : O Random Stack : O Random Library : X Random Program Binary Mapped : X ASCII Armor : O Non-Executable Stack : O Non-Executable Heap : O Stack Carany : X Stack Smashing Protector : X [몹들] gate -> iron_golem : Fake_SFP + Ascii Armor iron_golem..