매번 윈도우를 설치할때마다 이 문제가 있었는데


이 문제의 경우 https://support.microsoft.com/ko-kr/kb/3102810 의 패치를 적용시키니 문제가 해결할 수 있었다.


위 링크에 들어가서 적절한 윈도우 버전에 대한 패치를 다운받아서 업데이트를 실행하기 전에 먼저 설치하고 업데이트를 진행하면


5분 이내로 목록을 받아오는 것을 볼 수 있다.



아래 패치 파일은 한국어 기준입니다. (다른 언어가 설치해도 크게 문제는 없을 것으로 보이네요)


위 링크 가서 받으셔도 좋고 여기서 받아도 좋습니다.


32비트는 x86, 64비트는 x64를 받아주세요.


Windows6.1-KB3102810-x64.msu


Windows6.1-KB3102810-x86.msu






아래는 위 링크에서 가져온 내용.

============================================================


문제점

 - Windows 7 및 Windows Server 2008 R2에서 업데이트 설치 및 검색이 느려지고 높은 CPU 점유율을 나타냄 


이 업데이트에서 해결된 문제

- 시스템 센터 구성 관리자를 사용하여 업데이트를 설치할 때, 설치 시간이 오래 걸리고, 시스템 센터 구성 관리자가 오버 로드 됩니다.

- Windows Update 클라이언트를 Windows 10으로 업그레이드할 때 Svchost.exe 프로세스의 CPU 사용률이 100%를 차지합니다. 




'0x30 유틸리티 > 0x32 utility' 카테고리의 다른 글

Private Git - Gitlab 설치하기  (2) 2014.12.24

ASAN - AddressSanitizer




https://github.com/google/sanitizers/wiki/AddressSanitizer


구글의 깃허브에 정의된 ASAN 은 c/c++로 제작된 프로그램에서 버그를 디텍션 해주는 툴 이라고 보면 된다.


따로 설치해서 해야 하는건 없고 컴파일러 Clang 을 설치한뒤 컴파일 할때 -fsanitize=address 옵션만 붙여주도록 하자.


맨 위의 사진은 ASAN을 적용해서 디텍션할 수 있는 버그들의 목록이다.


Sanitizer 시리즈로는 아래와 같은 것들이 있다.


AddressSanitizer (detects addressability issues) - https://github.com/google/sanitizers/wiki/AddressSanitizer

LeakSanitizer (detects memory leaks) - https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer

ThreadSanitizer (detects data races and deadlocks) for C++ and Go - https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual

MemorySanitizer (detects use of uninitialized memory) - https://github.com/google/sanitizers/wiki/MemorySanitizer


사용법은 위 링크에 모두 나와있으니 ASAN과 MSAN만 사용해보도록 하자.


우선 위 기능을 사용하기 위해서 Clang을 설치한다.


sudo apt install clang


*참고 - 기준은 ubuntu 16.04 server *bit LTS 버전이다.


#include <stdlib.h>

// clang -fsanitize=address -O1 -fno-omit-frame-pointer uaf.c -o uaf

int main() {

  char *x = (char*)malloc(10 * sizeof(char*));

  free(x);

  return x[5];

}



위의 예제 코드를 보면 malloc으로 메모리를 할당하고 바로 Free시킨다. 그 이후 Free된 메모리 x를 접근하는데 이는 Free된 메모리를 재 사용하는


Use-After-Free라고 볼 수 있다.


이를 2번째 줄에 있는 커맨드로 컴파일 해보자.


이때 -fsanitize=address 는 ASAN을 사용하겠다는 것이고, -O1은 최적화 (옵션, 아래 페이지에 있어서 그냥 붙임.)


-fno-omit-frame-pointer는 더 좋은 스택트레이스 결과를 보기위해 붙이라고 한다.


각각의 옵션에 대한 정보는 https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer 을 참고하도록 하자.


[sweetchip@ubuntu sanitizer]$ clang -fsanitize=address -O1 -fno-omit-frame-pointer uaf.c -o uaf

[sweetchip@ubuntu sanitizer]$ ./uaf 

=================================================================

==10400==ERROR: AddressSanitizer: heap-use-after-free on address 0x60700000dfb5 at pc 0x0000004e9bbe bp 0x7ffd5c55f6f0 sp 0x7ffd5c55f6e8

READ of size 1 at 0x60700000dfb5 thread T0

    #0 0x4e9bbd  (/home/sweetchip/sanitizer/uaf+0x4e9bbd)

    #1 0x7f031f59582f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

    #2 0x418518  (/home/sweetchip/sanitizer/uaf+0x418518)


0x60700000dfb5 is located 5 bytes inside of 80-byte region [0x60700000dfb0,0x60700000e000)

freed by thread T0 here:

    #0 0x4b84c0  (/home/sweetchip/sanitizer/uaf+0x4b84c0)

    #1 0x4e9b8a  (/home/sweetchip/sanitizer/uaf+0x4e9b8a)

    #2 0x7f031f59582f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)


previously allocated by thread T0 here:

    #0 0x4b8648  (/home/sweetchip/sanitizer/uaf+0x4b8648)

    #1 0x4e9b7f  (/home/sweetchip/sanitizer/uaf+0x4e9b7f)

    #2 0x7f031f59582f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)


SUMMARY: AddressSanitizer: heap-use-after-free (/home/sweetchip/sanitizer/uaf+0x4e9bbd) 

Shadow bytes around the buggy address:

  0x0c0e7fff9ba0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

=>0x0c0e7fff9bf0: fa fa fa fa fa fa[fd]fd fd fd fd fd fd fd fd fd

  0x0c0e7fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

  0x0c0e7fff9c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

Shadow byte legend (one shadow byte represents 8 application bytes):

  Addressable:           00

  Partially addressable: 01 02 03 04 05 06 07 

  Heap left redzone:       fa

  Heap right redzone:      fb

  Freed heap region:       fd

  Stack left redzone:      f1

  Stack mid redzone:       f2

  Stack right redzone:     f3

  Stack partial redzone:   f4

  Stack after return:      f5

  Stack use after scope:   f8

  Global redzone:          f9

  Global init order:       f6

  Poisoned by user:        f7

  Container overflow:      fc

  Array cookie:            ac

  Intra object redzone:    bb

  ASan internal:           fe

  Left alloca redzone:     ca

  Right alloca redzone:    cb

==10400==ABORTING



그리고 위처럼 디버그 정보가 쭉 출력되고 스택트레이스 정보가 출력된다.





이번엔 MSAN을 사용해보자.


Asan처럼 그냥 옵션만 추가해주면 사용할 수 있기 떄문에 우선 Clang을 설치한 상태여야 한다.


[sweetchip@ubuntu sanitizer]$ cat umr.cc 

#include <stdio.h>

//clang -fsanitize=memory -fPIE -pie -fno-omit-frame-pointer -g -O2 umr.cc -o umr -fsanitize-memory-track-origins

int main(int argc, char** argv) {

  int a[10];

  a[5] = 0;

  if (a[argc])

    printf("xx\n");

  return 0;

}


이때 -fsanitize=memory 는 MSan을 사용하겠다는 것이고, -fPie -pie는 예제에 붙어있길래 같이 붙였다. 안붙여도 결과만 보는데는 크게 문제가 없는듯 하다.


-fsanitize-memory-track-origins 는 어느 함수에서 메모리를 할당시켰는지 추적할 수 있는 기능이다. 


-fno-omit-frame-pointer 는 ASAN과 같이 스택 트레이서 기능이다.



위 예제 코드를 보면 a배열을 초기화하지 않은 것에 문제가 발생한다.


이 경우 a[argc]로 접근하게 될 경우 여러 문제가 발생할 수 있다.


[sweetchip@ubuntu sanitizer]$ ./umr 5

==10456==WARNING: MemorySanitizer: use-of-uninitialized-value

    #0 0x563e3030d568  (/home/sweetchip/sanitizer/umr+0x87568)

    #1 0x7fd85136082f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

    #2 0x563e3029ff88  (/home/sweetchip/sanitizer/umr+0x19f88)


  Uninitialized value was created by an allocation of 'a' in the stack frame of function 'main'

    #0 0x563e3030d430  (/home/sweetchip/sanitizer/umr+0x87430)


SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/sweetchip/sanitizer/umr+0x87568) 

Exiting


[sweetchip@ubuntu sanitizer]$ ./umr 100

==10457==WARNING: MemorySanitizer: use-of-uninitialized-value

    #0 0x56272224f568  (/home/sweetchip/sanitizer/umr+0x87568)

    #1 0x7f0f5626782f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

    #2 0x5627221e1f88  (/home/sweetchip/sanitizer/umr+0x19f88)


  Uninitialized value was created by an allocation of 'a' in the stack frame of function 'main'

    #0 0x56272224f430  (/home/sweetchip/sanitizer/umr+0x87430)


SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/sweetchip/sanitizer/umr+0x87568) 

Exiting



MSan 은 위처럼 결과가 나온다.


잘만 사용하면 써먹을 곳이 꽤나 많을듯 하다.

오호..


엄청난 툴이 나왔습니다..!!


@keystone-engine


최근에 멀티 아키텍쳐를 지원하는 opcode generator 를 만들고 있었는데 버그를 만나서 때려쳤는데 얼마 지나지 않아 Keystone 이라고 하는 어셈블러가 나왔네요.


오예


프로젝트의 주소는 https://github.com/keystone-engine/keystone 에서 받고 빌드하실 수 있습니다...!!


공식 홈페이지의 주소는 http://www.keystone-engine.org/ 입니다.


깃에 써있는것을 보면..


Keystone is a lightweight multi-platform, multi-architecture assembler framework. It offers some unparalleled features:

  • Multi-architecture, with support for Arm, Arm64 (AArch64/Armv8), Hexagon, Mips, PowerPC, Sparc, SystemZ & X86 (include 16/32/64bit).
  • Clean/simple/lightweight/intuitive architecture-neutral API.
  • Implemented in C/C++ languages, with bindings for Python, NodeJS, Ruby, Go, Rust & Haskell available.
  • Native support for Windows & *nix (with Mac OSX, Linux, *BSD & Solaris confirmed).
  • Thread-safe by design.
  • Open source - with a dual license.

Keystone is based on LLVM, but it goes much further with a lot more to offer.

Further information is available at http://www.keystone-engine.org



이렇게 써있군요.


오픈소스에 멀티아키텍쳐 및 다양한 언어 지원!! 얼른 써봅시다


Git clone 으로 서버에 받고 나서 빌드 스크립트를 실행하기 전에 아래 Dependency 를 해결해줍시다.


sudo apt-get install cmake


그 이후 keystone의 루트 디렉터리에 build 라는 폴더를 만들고 이동합니다.


그리고 ../make-share.sh 스크립트를 실행해주면 알아서 make를 날려줍니다.


[sweetchip@ubuntu keystone]$ mkdir build

[sweetchip@ubuntu keystone]$ cd build/

[sweetchip@ubuntu build]$ l

[sweetchip@ubuntu build]$ ../make-share.sh 

+ [ -n  ]

+ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD=all -G Unix Makefiles ..

-- The C compiler identification is GNU 5.3.1

-- The CXX compiler identification is GNU 5.3.1

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- The ASM compiler identification is GNU

....

[ 98%] Linking CXX shared library ../lib/libkeystone.so

[ 98%] Built target keystone

Scanning dependencies of target kstool

[ 99%] Building CXX object kstool/CMakeFiles/kstool.dir/kstool.cpp.o

[100%] Linking CXX executable kstool

[100%] Built target kstool



make가 끝났으면 make install로 마무리 해줍니다.


[sweetchip@ubuntu build]$ sudo make install

[ 98%] Built target keystone

[100%] Built target kstool

Install the project...

-- Install configuration: "Release"

-- Installing: /usr/local/lib/pkgconfig/keystone.pc

-- Installing: /usr/local/include/keystone

-- Installing: /usr/local/include/keystone/x86.h

-- Installing: /usr/local/include/keystone/systemz.h

-- Installing: /usr/local/include/keystone/hexagon.h

-- Installing: /usr/local/include/keystone/sparc.h

-- Installing: /usr/local/include/keystone/arm64.h

-- Installing: /usr/local/include/keystone/ppc.h

-- Installing: /usr/local/include/keystone/mips.h

-- Installing: /usr/local/include/keystone/keystone.h

-- Installing: /usr/local/include/keystone/arm.h

-- Installing: /usr/local/lib/libkeystone.so.0

-- Installing: /usr/local/lib/libkeystone.so

-- Installing: /usr/local/bin/kstool

-- Set runtime path of "/usr/local/bin/kstool" to ""



자 이러면 설치 끝!


매우 쉽죠?


간단하게 사용해봅시다.


우선 커맨드라인으로 빠르게 보고싶다면..


[sweetchip@ubuntu build]$ kstool x32 "nop"

nop = [ 90 ]

[sweetchip@ubuntu build]$ kstool x32 "add eax, ebx"

add eax, ebx = [ 01 d8 ]

[sweetchip@ubuntu build]$ kstool arm "mov r1, r1"

mov r1, r1 = [ 01 10 a0 e1 ]



오홍.. 역시 기대한 대로 잘 나오는군요


Kstool v1.0 for Keystone Assembler Engine (www.keystone-engine.org)

By Nguyen Anh Quynh, 2016


Syntax: kstool <arch+mode> <assembly-string> or cat <asmfile> | kstool <arch+mode> 


The following <arch+mode> options are supported:

        x16:       X86 16bit, Intel syntax

        x32:       X86 32bit, Intel syntax

        x64:       X86 64bit, Intel syntax

        x16att:    X86 16bit, AT&T syntax

        x32att:    X86 32bit, AT&T syntax

        x64att:    X86 64bit, AT&T syntax

        x16nasm:   X86 16bit, NASM syntax

        x32nasm:   X86 32bit, NASM syntax

        x64nasm:   X86 64bit, NASM syntax

        arm:       ARM - little endian

        armbe:     ARM - big endian

        thumb:     Thumb - little endian

        thumbbe:   Thumb - big endian

        arm64:     AArch64

        hexagon:   Hexagon

        mips:      Mips - little endian

        mipsbe:    Mips - big endian

        mips64:    Mips64 - little endian

        mips64be:  Mips64 - big endian

        ppc32be:   PowerPC32 - big endian

        ppc64:     PowerPC64 - little endian

        ppc64be:   PowerPC64 - big endian

        sparc:     Sparc - little endian

        sparcbe:   Sparc - big endian

        sparc64:   Sparc64 - little endian

        sparc64be: Sparc64 - big endian

        systemz:   SystemZ (S390x)



위는 지원하는 목록입니다.


[sweetchip@ubuntu python]$ ls

keystone  LICENSE.TXT  Makefile  MANIFEST.in  README.md  sample.py  setup.py

[sweetchip@ubuntu python]$ sudo python setup.py install

running install

running build

running build_py

creating build

...


만약 python에서도 사용하고 싶다면 keystone/bindings/python/ 로 이동후에 설치해줍니다!


[sweetchip@ubuntu python]$ python sample.py 

add eax, ecx = [ 66 01 c8 ]

add eax, ecx = [ 01 c8 ]

add rax, rcx = [ 48 01 c8 ]

add %ecx, %eax = [ 01 c8 ]

add %rcx, %rax = [ 48 01 c8 ]

sub r1, r2, r5 = [ 05 10 42 e0 ]

sub r1, r2, r5 = [ e0 42 10 05 ]

movs r4, #0xf0 = [ f0 24 ]

movs r4, #0xf0 = [ 24 f0 ]

ldr w1, [sp, #0x8] = [ e1 0b 40 b9 ]

v23.w=vavg(v11.w,v2.w):rnd = [ d7 cb e2 1c ]

and $9, $6, $7 = [ 24 48 c7 00 ]

and $9, $6, $7 = [ 00 c7 48 24 ]

and $9, $6, $7 = [ 24 48 c7 00 ]

and $9, $6, $7 = [ 00 c7 48 24 ]

add 1, 2, 3 = [ 7c 22 1a 14 ]

add 1, 2, 3 = [ 14 1a 22 7c ]

add 1, 2, 3 = [ 7c 22 1a 14 ]

add %g1, %g2, %g3 = [ 02 40 00 86 ]

add %g1, %g2, %g3 = [ 86 00 40 02 ]

a %r0, 4095(%r15,%r1) = [ 5a 0f 1f ff ]



설치 후 sample.py를 실행시켜 제대로 작동하는지 확인하니 잘 나오네요.


이제 이걸로 뭘 할까나..




Ubuntu 기준으로 크로스 컴파일 하는법.


최근 여러 아키텍쳐 환경을 구성해야할 일이 있어서 메모!


1. 아래 명령어로 여러 아키텍쳐 gcc 설치 (arm, mips, ppc 등 다수 포함)

sudo apt-get install -y  gcc-multilib-arm-linux-gnueabi;sudo apt-get install -y  gcc-multilib-arm-linux-gnueabihf;sudo apt-get install -y  gcc-multilib-mips-linux-gnu;sudo apt-get install -y  gcc-multilib-mips64-linux-gnuabi64;sudo apt-get install -y  gcc-multilib-mips64el-linux-gnuabi64;sudo apt-get install -y  gcc-multilib-mipsel-linux-gnu;sudo apt-get install -y  gcc-multilib-powerpc-linux-gnu;sudo apt-get install -y  gcc-multilib-powerpc64-linux-gnu;sudo apt-get install -y  gcc-multilib-s390x-linux-gnu;sudo apt-get install -y  gcc-multilib-sparc64-linux-gnu


복사가 어렵다면 http://pastebin.com/iksPEaAH


2. 설치 이후 아래와 같이 컴파일

arm-linux-gnueabi-gcc -o test test.c -> arm

mips-linux-gnu-gcc -o test_mips test.c ->mips


결과

[sweetchip@ubuntu qemutest]$ file test

test: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=a9248b1c3ba0c940029d23e1f345d3df28f6d39b, not stripped


[sweetchip@ubuntu qemutest]$ file test_mips

test_mips: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, for GNU/Linux 3.2.0, BuildID[sha1]=2e9ee6c560f47f28aa1ee329fba06e38bbb0960e, not stripped



보너스


만약 ubuntu 에서 mips나 arm 바이너리를 돌리고 싶다면 아래 명령어를 통해서 qemu를 설치한다

sudo apt-get install qemu-user-static


qemu-user-static 은 이미지를 구하지 않고도 ELF 바이너리를 돌릴수 있도록 도와주는 매우 땡큐한 툴이다.


설치 이후 가능한 목록은 아래와 같다.

[sweetchip@ubuntu qemutest]$ ls /usr/bin/qemu-

qemu-aarch64-static       qemu-m68k-static          qemu-mipsn32el-static     qemu-ppc64-static         qemu-sparc64-static

qemu-alpha-static         qemu-microblazeel-static  qemu-mipsn32-static       qemu-ppc-static           qemu-sparc-static

qemu-armeb-static         qemu-microblaze-static    qemu-mips-static          qemu-s390x-static         qemu-tilegx-static

qemu-arm-static           qemu-mips64el-static      qemu-or32-static          qemu-sh4eb-static         qemu-unicore32-static

qemu-cris-static          qemu-mips64-static        qemu-ppc64abi32-static    qemu-sh4-static           qemu-x86_64-static

qemu-i386-static          qemu-mipsel-static        qemu-ppc64le-static       qemu-sparc32plus-static

엄청나게 많은 아키텍쳐를 지원한다.


그중 아까 컴파일한 arm과 mips를 돌려보자. (사전에 gdb-multiarch 설치 필요, apt-get 으로 설치한다.)


-> qemu-arm-static -L /usr/arm-linux-gnueabi -g 31338 ./test -> GDBServer에 test 바이너리를 돌림 (gdb에서 target remote ip:31338 로 접근 가능)

[root@ubuntu qemutest]$ qemu-arm-static -L /usr/arm-linux-gnueabi -g 31338 ./test


[sweetchip@ubuntu qemutest]$ gdb-multiarch 

GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11

Copyright (C) 2016 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-linux-gnu".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>.

Find the GDB manual and other documentation resources online at:

<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".

Type "apropos word" to search for commands related to "word".

(gdb) target remote localhost:31338

Remote debugging using localhost:31338


....


(gdb) disas main

Dump of assembler code for function main:

   0x00010438 <+0>: push {r11, lr}

   0x0001043c <+4>: add r11, sp, #4

   0x00010440 <+8>: ldr r0, [pc, #12] ; 0x10454 <main+28>

   0x00010444 <+12>: bl 0x102e0 <printf@plt>

   0x00010448 <+16>: mov r3, #0

   0x0001044c <+20>: mov r0, r3

   0x00010450 <+24>: pop {r11, pc}

   0x00010454 <+28>: andeq r0, r1, r8, asr #9

End of assembler dump.

(gdb) 



======================================================================================

-> qemu-mips-static -L /usr/mips-linux-gnu/ ./test_mips -> mips 바이너리 실행


[root@ubuntu qemutest]$ qemu-mips-qemu-mips-static -L /usr/mips-linux-gnu/ ./test_mips

hello world



생각보다 간편한 크로스컴파일과 실행 ㅋㅋ





12년, 13년 당시 국내 프로그램 제로데이를 한창 찾으면서 공부를 하고 있을때


하나 둘 나올때마다 KISA에 자주 취약점을 제보 했었는데


얼마전에 뜬 명예의 전당을 보니.. 13년엔 1위를 했었네요.. 오예 ㅋㅋ (기념품은 안주시나 ㅎㅅㅎ..)


안녕하세요.


오랜만에 포스팅 거리가 없었는데 새로 생겼네요!


제가 고3 시절 KISA 버그바운티 기념품으로 USB를 받았는데 잘 쓰다가 갑자기 죽어버린 USB가 있었습니다.


그 USB에는 여러 Exploit Code들과 제 자기소개서등이 들어있었는데 인식이 불가능해서 일단 보관해두고 있었는데


얼마전에 갑자기 인식에 성공해서 파일을 복구[?] 하는데 성공했습니다 ㅋㅋ


2013년에 시간이 멈춰버린 파일들을 구경하다 보니 별의별 것들이 나왔는데.. (bob 자기소개서, 대학 자기소개서, 모의전형 자기소개서 등..)


그중에 KMPlayer Exploit 코드가 있길래 2년이 반이라는 충분한 시간이 지났으니 공개해보려고 합니다 ㅋㅋ


이게 제 첫번째 공개 취약점이 될 것 같네요


당시에는 제 익스플로잇 기술이 매우 허접한 편이라서 매우 낮은 확률의 코드를 짰었네요..


취약점을 공부하는 분들을 위해서 패치기간이 2년이나 지났으니 더이상 동작하지 않을 것이라 보고..


예전 익스플로잇 코드를 공개하겠습니다. (사실 별거아닙니다.. 워낙 허접해서.. 확률도 30% 남짓이었던걸로 기억합니다.)


당시에 Exploit 조건이 매우 까다로워서 (ASLR, DEP ASCII Only etc) 어쩔수 없이 그랬던 걸로 기억하네요 :(


http://pastebin.com/rvxLzka7


어쨋든!


공부하실 분들이 있을 것 같아 공개합니다 ㅎㅎ



위는 시연 영상입니다.


오랜만에 새벽에 뻘글.. :)


안녕하세요.


요즘 포스팅에 쓸게 없다보니 예전부터 지금까지 배포했던 문서들을 모아둘까 해서 포스팅 해보려고 합니다.


처음 보안 공부를 접했을 때부터 exploit 관련 분야만 연구하다보니 글을 처음 쓰는 시간 기점으로 모두 Exploit분야밖에 안보이네요!


그래도 가끔씩 컨퍼런스 같은 곳에서 새로운 사람을 만날때 그때 그 문서, 그 자료를 잘 봤다고 인사를 해주는 분이 있는데


그럴때마다 보람을 느끼네요 ㅋㅋ


요즘은 별로 쓸 것도 없고 대단한 것도 아니니 잘 안쓰고 그냥 블로그 포스팅에 하나 남기고 있는데 언제가 될 진 모르지만 문서들을 계속 써볼 예정입니다.


아래는 제가 지금까지 작성한 문서들 리스트입니다. (아직은 4건밖에 없네요.)


2015/01/15 - [0x10 정보보안/0x15 System] - 기술문서 - Introduction to IE's memory protection

- Microsoft Internet Explorer 에 적용되어 있는 Custom Memory Protection들에 대한 소개입니다.

- 여러 브라우저가 그렇듯이 IE도 또한 자신들의 프로그램을 공격하기 어렵게 하기 위해서 각가지 메모리 보호기법을 제작하고 적용했습니다.

- 적용된 보호기법이 어떤 것들이 있는지 알아보고 직접 우회해본 경험담을 바탕으로 작성되었습니다.


2014/04/26 - [0x10 정보보안/0x15 System] - CVE-2012-4792 IE Use-After-Free Analysis and Exploit

- 차세대 보안리더 양성 프로그램 Best Of the Best 2기 프로젝트로 웹브라우저 해킹이 있었는데 프로젝트를 시작할 때 제작한 과거 취약점 분석 입니다.

- 분석 뿐만 아니라 실제로 어떻게 분석을 해야하는지 windbg 명령어로 초반 입문 하는 분들에게는 분명 도움이 되실 겁니다.


2014/08/20 - [0x10 정보보안/0x15 System] - [Memory Protection] Internet Explorer - VTguard에 대하여

- 이 당시에는 그리 긴 문서가 아니라서 그냥 웹에 적은 문서입니다.

- Vtguard를 Memory Leak 버그를 사용하지 않고 EIP를 변경할 수 있는 방법론 입니다.

- 실제 우회 성공 이후 작성한 문서입니다.

2013/05/22 - [0x10 정보보안/0x15 System] - Basic of Real World Exploit on windows [Document]

- 윈도우 어플리케이션의 취약점을 공격하는 것을 따라해보는 컨셉의 문서입니다.
- 대상 프로그램 및 버그는 매우 간단하여 쉽게 따라하실 수 있을 것입니다.

이상입니다!






얼마전 Blackhat 컨퍼런스에서 블랙햇 후원사인 MS가 회사부스에 위와 같은 내역을 공개했다고 합니다.


전 세계의 MS의 보안 취약점을 제보한 해커 TOP 100명을 선정한 결과라고 알고 있는데 그중 91위에 오르게 되었네요.


사실 1~30위 정도 사람들의 이름을 보니 사실상 MS의 보안취약점을 없애는데 하드캐리 하고 있는 분들이라서 아직은 넘사벽인 것 같네요.


이번엔 라스베가스를 갈 일이 없어서 인터넷으로나마 소식을 접하던 와중에 블랙햇 컨퍼런스 첫날부터 1~50위에 본인의 이름이 올랐다는 트위터 소식을 여러개 보긴 했으나


51~100위 리스트가 한번에 있는 사진은 아예 없더군요.. 심지어 75위까지 올라간 사진이 있어서 살짝 기대했는데 역시나 없더군요 ㅠㅠ (하지만 75위까지 사람들 이름을 보니 그럴만도 합니다 ㅋㅋ 유명한 사람들이 많죠)


하지만 어제 100위까지 있는 사진이 다시 끌올[?] 되어서 작은 기대를 가지고 봤더니 찾을 수 있었습니다.


비록 끝자락인 91위지만 그냥 단순히 이름이 올라갔다는 것에 대해서는 매우 만족하고 있습니다. ㅋㅋ


얼마전 MS에서 VIP dinner의 제목으로 메일이 왔었는데 아마 이것에 영향을 받지 않았나 합니다. (아니면 버그를 제보해준 사람에게 모두 돌린 메일 일지도?)


하지만 전제조건이 블랙햇이 끝나는 날 라스베가스에서 저녁 사줄게! 라는 내용이어서..; 아쉽게도 다음 기회로 넘기게 되었습니다.


어쨋든 버그헌팅에서 예상치도 못한 성과가 나오다 보니 요즘 이상한 버그들만 나와서 금이 갔던 멘탈을 조금이나마 위로 해주는 느낌이네요.


비록 낮은 순위지만 앞으로 버그헌팅을 열심히 해야겠다는 의미로 다시 열라 해야겠네요. ㅋㅋ


+ Recent posts