write-up(pwn)/pwnable.kr

    [pwnable.kr] passcode write-up

    [pwnable.kr] passcode write-up

    #include #include void login(){ int passcode1; int passcode2; printf("enter passcode1 : "); scanf("%d", passcode1); fflush(stdin); // ha! mommy told me that 32bit is vulnerable to bruteforcing :) printf("enter passcode2 : "); scanf("%d", passcode2); printf("checking...\n"); if(passcode1==338150 && passcode2==13371337){ printf("Login OK!\n"); system("/bin/cat flag"); } else{ printf("Login Failed!..

    [pwnable.kr] flag write-up

    upx packing 이라는 개념을 몰랐어서 라업을 보고 푼 문제입니다. 실행하면 다음과 같이 나옵니다. I will malloc() and strcpy the flag there. take it. gdb로 보면 심볼이 없다고 나옵니다. 다음과 같은 명령어로 upx 패킹이 되어 있다는 것을 알 수 있다고 합니다. $ strings flag | grep packed $Info: This file is packed with the UPX executable packer http://upx.sf.net $ 이걸 다음과 같은 명령어로 언패킹할 수 있습니다. $ upx -d ./flag 이제 disassemble 해보면 다음과 같습니다. gdb-peda$ disassemble main Dump of assembl..

    [pwnable.kr] bof write-up

    #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; } gdb로 동적디버깅을 해서 overflowme와 key의 오프셋을 구해야 합니다. 구하면 0x34가 나옵니다. 0x34만큼의 더미 데이터 뒤에 0xcafebabe를 전송하몁 됩니다. 최종 익스플로잇 코드는 다음과 같습니다. (리틀엔디안을 사용해줘..

    [pwnable.kr] collision write-up

    #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] fd write-up

    #include #include #include char buf[32]; int main(int argc, char* argv[], char* envp[]){ if(argc