
Reverse Engineering
Bypass anti-debug, anti-VM, and integrity checks when analyzing Linux or Windows binaries in CTF or malware-style challenges.
Install
npx skills add https://github.com/zhaoxuya520/reverse-skill --skill reverse-engineeringWhat is this skill?
- Linux advanced anti-debug: ptrace, /proc checks, timing, signals, and syscall-level evasion patterns
- Windows advanced anti-debug: PEB, NtQueryInformationProcess, heap flags, TLS callbacks, breakpoint scans
- Anti-VM and anti-sandbox coverage: CPUID, MAC/hardware fingerprinting, timing, registry and resource artifacts
- Practical bypass-oriented reference structured for CTF workflows rather than generic RE theory
- Table-of-contents depth across multiple OS-specific technique families
Adoption & trust: 1 installs on skills.sh; 1.3k GitHub stars; trending (+100% hot-view momentum).
Recommended Skills
Azure Compliancemicrosoft/azure-skills
Openclaw Secure Linux Cloudxixu-me/skills
Entra Agent Idmicrosoft/azure-skills
Firebase Security Rules Auditorfirebase/agent-skills
Firestore Security Rules Auditorfirebase/agent-skills
Skill Vetteruseai-pro/openclaw-skills-security
Journey fit
Ship/security is the canonical shelf because the skill addresses hardening and evasion encountered at release-grade binaries and contest targets, not greenfield product ideation. Security subphase covers adversarial analysis techniques—anti-analysis surfaces map to appsec review and exploit development prep.
SKILL.md
READMESKILL.md - Reverse Engineering
# CTF Reverse - Anti-Analysis Techniques & Bypasses Comprehensive reference for anti-debugging, anti-VM, anti-DBI, and integrity-check techniques encountered in CTF challenges, with practical bypasses. ## Table of Contents - [Linux Anti-Debug (Advanced)](#linux-anti-debug-advanced) - [ptrace-Based](#ptrace-based) - [/proc Filesystem Checks](#proc-filesystem-checks) - [Timing-Based Detection](#timing-based-detection) - [Signal-Based Anti-Debug](#signal-based-anti-debug) - [Syscall-Level Evasion](#syscall-level-evasion) - [Windows Anti-Debug (Advanced)](#windows-anti-debug-advanced) - [PEB (Process Environment Block) Checks](#peb-process-environment-block-checks) - [NtQueryInformationProcess](#ntqueryinformationprocess) - [Heap Flags](#heap-flags) - [TLS Callbacks](#tls-callbacks) - [Hardware Breakpoint Detection](#hardware-breakpoint-detection) - [Software Breakpoint Detection (INT3 Scanning)](#software-breakpoint-detection-int3-scanning) - [Exception-Based Anti-Debug](#exception-based-anti-debug) - [NtSetInformationThread (Thread Hiding)](#ntsetinformationthread-thread-hiding) - [Anti-VM / Anti-Sandbox](#anti-vm--anti-sandbox) - [CPUID Hypervisor Bit](#cpuid-hypervisor-bit) - [MAC Address / Hardware Fingerprinting](#mac-address--hardware-fingerprinting) - [Timing-Based VM Detection](#timing-based-vm-detection) - [File / Registry Artifacts](#file--registry-artifacts) - [Resource Checks (CPU Count, RAM, Disk)](#resource-checks-cpu-count-ram-disk) - [Anti-DBI (Dynamic Binary Instrumentation)](#anti-dbi-dynamic-binary-instrumentation) - [Frida Detection](#frida-detection) - [Pin/DynamoRIO Detection](#pindynamorio-detection) - [Code Integrity / Self-Hashing](#code-integrity--self-hashing) - [Anti-Disassembly Techniques](#anti-disassembly-techniques) - [Opaque Predicates](#opaque-predicates) - [Junk Bytes / Overlapping Instructions](#junk-bytes--overlapping-instructions) - [Jump-in-the-Middle](#jump-in-the-middle) - [Function Chunking / Scattered Code](#function-chunking--scattered-code) - [Control Flow Flattening (Advanced)](#control-flow-flattening-advanced) - [Mixed Boolean-Arithmetic (MBA) Identification & Simplification](#mixed-boolean-arithmetic-mba-identification--simplification) - [SIGILL Handler for Execution Mode Switching (Hack.lu 2015)](#sigill-handler-for-execution-mode-switching-hacklu-2015) - [SIGFPE Signal Handler Side-Channel via strace Counting (PlaidCTF 2017)](#sigfpe-signal-handler-side-channel-via-strace-counting-plaidctf-2017) - [Instruction Trace Inversion with Keystone and Unicorn (MeePwn CTF 2017)](#instruction-trace-inversion-with-keystone-and-unicorn-meepwn-ctf-2017) - [Call-less Function Chaining via Stack Frame Manipulation (THC CTF 2018)](#call-less-function-chaining-via-stack-frame-manipulation-thc-ctf-2018) - [Comprehensive Bypass Strategies](#comprehensive-bypass-strategies) - [Universal Bypass Checklist](#universal-bypass-checklist) - [Layered Anti-Debug (Real-World Pattern)](#layered-anti-debug-real-world-pattern) - [Quick Reference: Check to Bypass](#quick-reference-check-to-bypass) --- ## Linux Anti-Debug (Advanced) ### ptrace-Based **Self-ptrace (most common):** ```c if (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1) exit(1); // Already traced = debugger attached ``` **Bypasses:** ```bash # 1. LD_PRELOAD (see patterns.md for full hook) LD_PRELOAD=./hook.so ./binary # 2. Patch with pwntools python3 -c " from pwn import * elf = ELF('./binary', checksec=False) elf.asm(elf.symbols.ptrace, 'xor eax, eax; ret') elf.save('patched') " # 3. GDB: catch the syscall gdb ./binary (gdb) catch syscall ptrace (gdb) run # When it stops at ptrace: (gdb) set $rax = 0 (gdb) continue # 4. Kernel config (requires root) echo 0 > /proc/sys/kernel/yama/ptrace_scope ``` **Double-ptrace pattern:** ```c // Fork child to ptrace parent — blocks all other debuggers pid_t child = fork(); if (child == 0) { ptrace(PTRACE_ATTACH, getppid(), 0, 0); // Child sits