WinDBG


# 유용한 Windbg 확장 모듈    



1. !exploitable  


  - MSEC 에서 개발한 crash analyze 모듈로, exception 이 발생한 상태에서 해당 명령을 통해 실제 exploitable 한 

     지 여부를 알려준다. 


  - down: http://msecdbg.codeplex.com/releases/view/28935

  

  - 설치 : msec.dll 모듈을 디버거가 설치된 폴더의 winext 서브폴더에 복사(windbg 재시작)


  - usage : 

    > !load winext/msec.dll

    > !exploitable


ex) 아래와 같이 소프트웨어에서 예외가 발생하였을때 exploitable 한지 확인하기 위해 사용 가능


 0:000> !exchain

TRIAGER: Could not open triage file : C:\Program Files\Windows Kits\8.0\Debuggers\x86\triage\oca.ini, error 2

TRIAGER: Could not open triage file : C:\Program Files\Windows Kits\8.0\Debuggers\x86\winxp\triage.ini, error 2

TRIAGER: Could not open triage file : C:\Program Files\Windows Kits\8.0\Debuggers\x86\triage\user.ini, error 2

0012fa84: 41414141


0:000> !exploitable

Exploitability Classification: EXPLOITABLE

Recommended Bug Title: Exploitable - User Mode Write AV starting at SoriTong!MmutilityC8_4+0x0000000000000c53 (Hash=0x62360131.0x10454c60)


User mode write access violations that are not near NULL are exploitable.






이전글에 이어서 Windbg 기본 명렁어 정리 중입니다.


역시 뭐든 안하면 까먹어요...열심히 합시다!!




- dt : dump variable info

 

  dt [mod!]Name Field [Field]

 ex) dt ntdll!_PEB


 > dt !_PEB // PEB 구조체 확인


 > dt !_PEB @$peb  // 현재 프로세스 PEB 확인

  +0x000 InheritedAddressSpace : 0 ''

   +0x001 ReadImageFileExecOptions : 0 ''

   +0x002 BeingDebugged    : 0x1 ''

   +0x003 SpareBool        : 0 ''

   +0x004 Mutant           : 0xffffffff Void

   +0x008 ImageBaseAddress : 0x00400000 Void

   +0x00c Ldr              : 0x00241ea0 _PEB_LDR_DATA

   +0x010 ProcessParameters : 0x00020000 _RTL_USER_PROCESS_PARAMETERS

   +0x014 SubSystemData    : (null) 

   +0x018 ProcessHeap      : 0x00140000 Void

   +0x01c FastPebLock      : 0x7c9ad600 _RTL_CRITICAL_SECTION

   +0x020 FastPebLockRoutine : 0x7c931000 Void



 - du : dump unicode string

 

 > du 00401000   // 401000 유니코드



 - dd : dump


 > dd 0046c6b0 0046c6c4

0046c6b0  00000000 00000000 00000000 00000000

0046c6c0  00000000 00000000



 - s  : search (중요!)


 0:014> s -a 00e70000 10071000 cmd

00ea8251  63 6d 64 00 00 00 00 2e-65 78 65 00 00 00 00 2e  cmd.....exe.....

01f17152  63 6d 64 0d 0a 00 41 63-63 65 70 74 3a 20 61 70  cmd...Accept: ap

024f2d74  63 6d 64 2e 65 78 65 00-0d f0 ad ba 0d f0 ad ba  cmd.exe.........

02520d3c  63 6d 64 2e 65 78 65 00-00 00 00 00 31 00 00 00  cmd.exe.....1...

02742d74  63 6d 64 2e 65 78 65 00-0d f0 ad ba 0d f0 ad ba  cmd.exe.



  - !heap :  heap 메모리


 0:014> !heap -stat

_HEAP 00dc0000

     Segments            00000001

         Reserved  bytes 00010000

         Committed bytes 00007000

     VirtAllocBlocks     00000001

         VirtAlloc bytes 00dc0050

_HEAP 003b0000

     Segments            00000002

         Reserved  bytes 00110000

         Committed bytes 00072000

     VirtAllocBlocks     00000000




+ Recent posts