본문 바로가기

Fedora

[BOF원정대/Fedora4] cruel -> enigma 0x080485e0 : mov 0x804985c,%eax 0x080485e5 : sub $0x4,%esp 0x080485e8 : push %eax 0x080485e9 : push $0x400 0x080485ee : lea 0xfffffc00(%ebp),%eax 0x080485f4 : push %eax 0x080485f5 : call 0x80483ec ... (gdb) x/x 0x804985c 0x804985c : 0x00236740 (gdb) x/10x 0x00236740 0x236740 : 0xfbad2098 0xb7fe1000 0xb7fe1000 0xb7fe1000 0x236750 : 0xb7fe1000 0xb7fe1000 0xb7fe1000 0xb7fe1000 0x236760 : 0xb7fe2000.. 더보기
[BOF원정대/Fedora3] hell_fire -> evil_wizard /* The Lord of the BOF : The Fellowship of the BOF - evil_wizard - Local BOF on Fedora Core 3 - hint : GOT overwriting */ // magic potion for you void pop_pop_ret(void) { asm("pop %eax"); asm("pop %eax"); asm("ret"); } int main(int argc, char *argv[]) { char buffer[256]; char saved_sfp[4]; int length; if(argc 더보기
[BOF원정대/Fedora3] iron_golem -> dark_eyes /* The Lord of the BOF : The Fellowship of the BOF - dark_eyes - Local BOF on Fedora Core 3 - hint : RET sleding*/ int main(int argc, char *argv[]){ char buffer[256]; char saved_sfp[4]; if(argc < 2){ printf("argv error\n"); exit(0); } // save sfp memcpy(saved_sfp, buffer+264, 4); // overflow!! strcpy(buffer, argv[1]); // restore sfp memcpy(buffer+264, saved_sfp, 4); printf("%s\n", buffer);} dark.. 더보기
[BOF원정대/Fedora3] gate -> iron_golem 이전 레드햇에서의 BOF원정대와 달라진점은 1. exec-shield : 스택에 존재하는 어셈블리어는 실행이 안됩니다. 즉, 쉘코드를 스택에 올려봐야 소용이 없습니다. 2. 랜덤스택: 스택의 주소가 계속 바뀌기때문에, 어짜피 스택의 한 지점으로 점프하기도 쉽지 않습니다. 3. 00 으로 시작되는 라이브러리 주소: 00(NULL)이 들어감으로써, 라이브러리 주소를 쓰는순간 스트링이 끊깁니다. 즉, 라이브러리 주소는 마지막에 딱 한번만 사용 가능합니다. 그렇다면, 이를 해결하기위해서 제가 사용할 방법은, execl을 이용하고, fake ebp를 이용해서 GOT부분을 execl의 argument로서 사용할것입니다. 좀더 풀어서 설명하자면, execl의 argument는 다음과 같습니다.execl(실행할 파일 .. 더보기