안티디버깅 간단 정리

2013. 10. 30. 20:03 from Security

리버싱시 자주 등장하는 안티디버깅들입니다. 

책을 보다가 암기 겸 쭉 정리해봤습니다



Static Anti Debugging


난이도 : Low, Medium

구현원리 : 다양한 시스템 정보 활용

목적 : 디버거 탐지

해체 시점 : 디버깅 시작할 때

해체 횟수 : 1회

해체 방법 : API Hooking, Plugin


PEB

BeingDebugged(IsDebuggerPresent())

Ldr

Heap(Flags, Force Flags)

NtGlobalFlag

TEB

StaticUnicodeString

Using Native API

NtQueryInformationProcess()

ProcessDebugPort(0x7)(CheckRemoteDebuggerPresent())

ProcessDebugObjectHandle(0x1E)

ProcessDebugFlags(0x1F)

NtQuerySystemInformation()

SystemKernelDebuggerInformation(0x23)

NtQueryObject()

Attack Debugger

Detatch Debugger

NtSetInformationThread()

BlockInput()

OpenProcess

SeDebugPrivilege

TLS Callback Function

Using Normal API

Parent Process

Window Name

Process Name

File Name

Register

Resource


Dynamic Anti Debugging


난이도 : High

구현원리 : 디버거의 동작 원리를 역이용

목적 : 내부 코드와 데이터를 숨김

해체 시점 : 디버깅 도중

해체 횟수 : 수시

해체 방법 : API Hooking, Plugin, Utilites


Using SEH

Exceptions

CloseHandle()

Break Points

INT3(CC)

INT 3 (CD 03)

INT1 (F1)

INT 2D(CD 2D)

SetUnhandledExceptionFilter()

Timing Check

RDTSC

QueryPerformanceCount()

GetTickCount()

timeGetTime()

Single Step

Trap Flag

PUSHFD/POPFD

INT 2D

Patching Detection

0xCC Scanning

Calc Checksum(Hash)

Stack Seegment Register

Anti-Disassembly

PE Image Switching

Self-Execution

Debug Blocker(Self-Debugging)

Nanomite

Obfuscated Code

Code Permutation

Encryption/Decryption

Stolen Bytes


'Security' 카테고리의 다른 글

64비트 calling convention + stack frame  (1) 2013.11.15
Native API를 이용한 static 안티 디버깅 정리  (1) 2013.11.10
바인드쉘, 리버스쉘  (0) 2013.10.24
TLS에 관한 간단한 탐구  (0) 2013.10.21
허..  (0) 2013.10.17
Posted by xer0s :