[작성자:] ByJJoon


  • BOF 원정대 – Level 6 (darkelf)

    문제 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – darkelf – egghunter + buffer hunter + check length of argv[1] */ #include <stdio.h> #include <stdlib.h> 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; […]

  • BOF 원정대 – Level 5 (wolfman)

    문제소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – wolfman – egghunter + buffer hunter */ #include <stdio.h> #include <stdlib.h> 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] […]

  • BOF 원정대 – Level 4 (orc)

    문제 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – orc – egghunter */ #include <stdio.h> #include <stdlib.h> 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') […]

  • BOF 원정대 – Level 3 (goblin)

    문제 소스는 아래와 같다. /* 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); } 이전 문제와 다른 점은 인자를 argv로 받는것이 아니라 gets() 함수를 이용해 받는다는 것이다. get() 함수를 이용해 인자를 받을때는 아래와 같이 풀이를 하면 […]

  • BOF 원정대 – Level 2 (cobolt)

    Level 2 문제 소스는 아래와 같다. /* 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); } 이번 문제는 전 문제와 달리 버퍼의 크기가 작다. 이런 경우 환경변수를 […]

  • BOF 원정대 – Level 1 (gremlin)

    첫번째 문제다. 소스는 아래와 같이 아주 단순한 BOF 다. /* 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); } 이번 문제의 풀이는 여러가지가 될 수 있다. 환경변수에 […]

  • Internet Explorer 8 CSS Parser Exploit – (CVE-2010-3971, MS11-003)

    인터넷 익스플로러 8 버전에 대한 취약점이 나와 기록해 둡니다. http://www.exploit-db.com/exploits/15746/ #!/usr/bin/env ruby # Source: http://www.breakingpointsystems.com/community/blog/ie-vulnerability/ # Author: Nephi Johnson (d0c_s4vage) require 'socket' def http_send(sock, data, opts={}) defaults = {:code=>"200", :message=>"OK", :type=>"text/html"} opts = defaults.merge(opts) code = opts[:code] message = opts[:message] type = opts[:type] to_send = "HTTP/1.1 #{code} #{message}\r\n" + "Date: Sat, 11 Dec 2010 14:20:23 […]

  • SELinux와 Apache

    최근에 웹에서 PHP를 이용하여 Python 스크립트를 실행할 일이 있어 구성 후 실행을 하였으나 정상적으로 실행이 안되어 문제를 확인하다 보니 SELinux 문제로 확인되었다. 문제 확인 방법은 ‘audit2allow -a’ 명령어를 통해 SELinux 관련 로그를 파싱에서 볼 수 있다. [root@localhost Honeypot]# audit2allow -a #============= httpd_sys_script_t ============== #!!!! This avc can be allowed using one of the these booleans: […]

  • UCS2 shellcode를 hex로 변환 후 문자열 확인

    리눅스 머신에서 쉘코드에서 문자열 확인할 때 편하게 하고자 작성한 스크립트 입니다. 작성하고 사용하다 보니 최근 국내에 삽입되는 온라인게임핵 관련 악성코드는 XOR로 악성코드를 다운로드 받는 URL이 암호화 되어 있는데 이걸 좀 더 쉽게 찾을 수 있는 방법이 되기도 하네요… #!/usr/bin/env python import sys shellcode = sys.argv[1] paser = shellcode.split('%u') output = '' for x in paser: […]

  • objdump를 이용한 쉘코드 추출 스크립트

    vortex 8번 문제는 쉘코드를 작성해야 하는 문제인데 코드를 작성하여 gcc로 컴파일 후 objdump를 이용하여 쉘코드만 따로 뽑아내는 작업이 너무 번거로워 간단하게 스크립트로 작성하였습니다. #!/usr/bin/env python import re, sys, os def parser(): f = open('dump.txt', 'r') data = f.read() f.close() data = re.split('[0-9a-f]{8} <', data) for x in data: try: title = re.search('.*>:', x).group() except: title […]