본문으로 건너뛰기
Skillpedia
보안6.5k · #14161

anti-debug-bypass

하는 일

이 스킬은 프로그램의 흔한 안티 디버깅 및 안티 VM 검사와 분석 중 이를 다루는 방법을 설명합니다. 보호되거나 악성인 소프트웨어를 연구하는 리버스 엔지니어를 위한 스킬입니다.

사용하는 경우

  • ✓분석가가 디버거를 연결하면 프로그램이 종료되거나 다르게 동작하는 것을 발견했을 때.
  • ✓연구자가 샘플이 쓰는 안티 디버깅 검사를 찾고 싶을 때.
  • ✓팀이 가상 머신에 프로그램이 어떻게 반응하는지 확인해야 하는 보호된 프로그램을 연구하는 경우.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/anti-debug-bypass/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/anti-debug-bypass/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“디버거를 연결하면 이 프로그램이 실행을 멈춥니다. 이유를 알아내는 방법을 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 흔한 검사를 나열하고, 프로그램에서 이를 찾는 방법을 보여 주며, 분석 중 각 검사를 어떻게 다루는지 설명합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Anti-Debug Bypass Playbook

Malware and protected commercial software check for debuggers and sandboxes before running real logic. Bypassing these checks is required to dynamically analyze them. Each check has a known counter.

1. Enumerate anti-debug techniques in the binary

Static signature scan

# Windows API calls
strings /tmp/sample | grep -iE 'IsDebuggerPresent|NtQuery|CheckRemoteDebugger|OutputDebugString'

# Linux ptrace check
strings /tmp/sample | grep -iE 'ptrace|/proc/self/status|TracerPid'

# CPUID hypervisor check
strings /tmp/sample | grep -iE 'vmware|VirtualBox|qemu|xen'

# Detect via YARA rules
yara -r /opt/yara-rules/anti_debug.yar /tmp/sample

Decepticon helper:

bin_anti_debug_scan("/tmp/sample")

2. Common checks + bypasses

Windows checks

Check What it does Bypass
IsDebuggerPresent() reads PEB.BeingDebugged byte Set PEB.BeingDebugged = 0 in debugger; ScyllaHide handles
CheckRemoteDebuggerPresent() calls NtQueryInformationProcess(ProcessDebugPort) Patch return to FALSE; ScyllaHide hooks the syscall
NtQueryInformationProcess(ProcessDebugPort) returns nonzero if debugger attached Hook + return 0
NtQueryInformationProcess(ProcessDebugFlags) returns 0 if debugger, 1 if not Force return 1
NtQueryInformationProcess(ProcessDebugObjectHandle) nonzero handle if attached Force NULL
PEB.NtGlobalFlag 0x70 if heap debugging Set to 0
PEB.HeapFlags & PEB.ForceFlags non-default if debugger Reset to defaults
NtSetInformationThread(ThreadHideFromDebugger) unhook debugger from thread Hook NtSetInformationThread
INT 2D / INT 3 exception handling normal flow if no debugger Set exception handler in debugger
Hardware breakpoint detection (GetThreadContext check) reads DR0-3, fails if BPs set Use software BPs, or zero DRs before check

ScyllaHide (x64dbg/x32dbg/IDA plugin) handles essentially all of these automatically.

Linux checks

Check What it does Bypass
ptrace(PTRACE_TRACEME) fails if already traced Run w/o ptrace, or use LD_PRELOAD to hook
Read /proc/self/status TracerPid: nonzero if debugger LD_PRELOAD hook reading; or modify /proc on a fork
prctl(PR_SET_DUMPABLE, 0) prevents gdb attach Patch out the prctl
getppid() parent process name if it's gdb/strace rename gdb binary, or LD_PRELOAD getppid
Timing checks via rdtsc measures execution time Use gdb's set $rax = ... to fake; or patch rdtsc out

LD_PRELOAD bypass example

// bypass.c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sys/ptrace.h>
#include <string.h>

long ptrace(int request, int pid, void *addr, void *data) {
    return 0;  // pretend it always succeeds
}

FILE *fopen(const char *path, const char *mode) {
    static FILE *(*orig)(const char *, const char *) = NULL;
    if (!orig) orig = dlsym(RTLD_NEXT, "fopen");
    if (strstr(path, "/proc/self/status") || strstr(path, "/proc/self/stat")) {
        // Return a doctored file
        FILE *tmp = tmpfile();
        fprintf(tmp, "TracerPid:\t0\n");
        rewind(tmp);
        return tmp;
    }
    return orig(path, mode);
}
gcc -shared -fPIC bypass.c -o bypass.so -ldl
LD_PRELOAD=./bypass.so gdb /tmp/sample

3. Anti-VM / sandbox detection

Check Bypass
CPUID leaf 0x40000000 (hypervisor bit) Mask CPUID via KVM -cpu host,-hypervisor or VMM config
VMware backdoor 0x564D5868 magic via IN/OUT Patch the magic number check
MAC address vendor (00:0C:29 = VMware) Spoof MAC in VM config
Disk size < 50GB Allocate larger disk for the analysis VM
RAM < 2GB Provision more RAM
Username sandbox, vagrant, virtual Change username in analysis env
Recent file count low Pre-populate Documents folder before run
Mouse cursor never moves Use xdotool to inject mouse jitter
Process count, uptime, kernel objects Boot the VM a while before analysis

4. Dynamic bypass via debugger

x64dbg / x32dbg (Windows)

  1. Install ScyllaHide plugin
  2. In the plugin, enable all checks (PEB patches, NtSetInformation hooks, etc)
  3. Open the binary, set BP at entry → continue
  4. ScyllaHide neutralizes most checks transparently

IDA Pro

  • Built-in remote debugger + IDAStealth plugin
  • For step-tracing through anti-debug: `Debugger options → Suspend on library load
자주 묻는 질문

어떤 검사를 다루나요?

Windows 디버거 검사, Linux ptrace 검사, 가상 머신 탐지를 다룹니다.

분석가에게 왜 필요한가요?

일부 프로그램은 분석 도구를 감지하면 동작을 숨기므로, 먼저 이런 검사를 이해해야 합니다.

다른 사람의 활동을 숨기기 위한 것인가요?

아닙니다. 프로그램이 어떻게 동작하는지 이해하기 위한 실험실 분석 작업에 관한 것입니다.

상세 정보

작성자의 원본 설명

Detect and neutralize anti-debug / anti-VM checks — IsDebuggerPresent, ptrace, NtGlobalFlag, timing, hardware-breakpoint detection.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14161
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬