ptn1411/skill/anti-debugging-techniques
Claude Code and agent skill by ptn1411/skill
- community
Checking that the SKILL.md file is still in the repository.
Anti-debug detection and bypass for protected binaries. Activate before patching commercial apps that use ptrace/PEB/timing/exception checks on Linux or Windows.
Install
npx vskill@latest install ptn1411/skill/anti-debugging-techniquesSKILL.md
Anti-Debugging Techniques
Upstream reference: yaklang/hack-skills/anti-debugging-techniques — distilled from ctf-wiki + hacktricks. Use that page for full prose.Language rule: instructions in English; final user-facing summary in Vietnamese.
0. Authorization & routing
Operates under MASTER_POLICY.md §1-§2 (owner-attested target, granted technical authority).
Run this skill before [binary-patcher](../binary-patcher/SKILL.md) on any commercial-grade binary — patches misfire when anti-debug watchdogs are still live.
| Sibling skill | When | |
|---|---|---|
| binary-identifier | First — fingerprint protector (VMProtect/Themida ship known anti-debug stacks) | |
| binary-protection-bypass | After — ASLR/PIE/canary still blocks patch even if debugger is hidden | |
| vm-and-bytecode-reverse | When the check is implemented inside a custom VM dispatcher | |
| symbolic-execution-tools | Skip checks symbolically with angr instead of patching |
1. Detection-class → first-line bypass
| Class | Linux primary | Windows primary | |
|---|---|---|---|
| API call | LD_PRELOAD shim returning 0 | Hook IsDebuggerPresent / NtQueryInformationProcess | |
| Process flag | Filter TracerPid in /proc/self/status | Zero PEB BeingDebugged / NtGlobalFlag / heap flags | |
| Timing | Frida hook on clock_gettime | Frida hook on rdtsc / QueryPerformanceCounter | |
| Signal / exception | GDB handle SIGTRAP nostop pass | VEH handler or ScyllaHide | |
| HW breakpoint | n/a | Hook GetThreadContext to clear DR0–DR3 | |
| Multi-process watchdog | GDB set follow-fork-mode child | Attach to both processes |
2. Linux check signatures (grep-able)
3. Windows PEB + Nt* offsets (x64)
| Field | Location | Debugged | Clean | |
|---|---|---|---|---|
BeingDebugged | PEB+0x02 | 1 | 0 | |
NtGlobalFlag | PEB+0xBC | 0x70 | 0 | |
ProcessHeap.Flags | Heap+0x40 | 0x40000062 | 0x00000002 | |
ProcessHeap.ForceFlags | Heap+0x44 | 0x40000060 | 0 |
NtQueryInformationProcess info-class IDs: ProcessDebugPort=0x07, ProcessDebugObjectHandle=0x1E, ProcessDebugFlags=0x1F (returns 0 when debugged — inverted).
4. Tooling matrix
| Tool | Platform | Use | |
|---|---|---|---|
| ScyllaHide | Windows (x64dbg/IDA plugin) | One-click PEB/Nt*/timing patch | |
| TitanHide | Windows kernel driver | Kernel-level hide for DR/heap checks | |
| Frida | Cross-platform | Script hooks, timing spoof | |
| LD_PRELOAD | Linux | ptrace/getenv/fopen replacement | |
| GDB | Linux | catch syscall, conditional BP, register fixup | |
| Qiling | Cross-platform | Full emulation — bypasses HW-level checks |
5. Functional bypass snippets
Linux ptrace shim
GDB catch-and-clear
Frida cross-platform
x64dbg + ScyllaHide (PowerShell launch)
6. Bypass methodology
- Static scan — grep the strings/imports above; map every check site.
- Classify each hit into the table in §1.
- Apply layered bypass — start with ScyllaHide (Win) or LD_PRELOAD shim (Linux); they cover ~80% of common checks.
- Handle TLS callbacks before
mainruns (x64dbg "Break on TLS" / WinDbgsxe ld). - Verify — set BP on
ExitProcess/exit/_exit; if hit unexpectedly, a check was missed → trace back.
7. Real-world protector defaults
| Protector | Stack | Recommended kit | |
|---|---|---|---|
| VMProtect | PEB + timing + driver | TitanHide + ScyllaHide | |
| Themida | PEB + SEH + timing | ScyllaHide + manual NOP | |
| Enigma | IsDebuggerPresent + CRC | x64dbg + ScyllaHide | |
| UPX (custom) | Usually none | Standard unpack |
8. Final report (Vietnamese)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinganti-debugging-techniques/SKILL.md
Popularity
- Repository stars
- 150
- Repository forks
- 90
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ptn1411/skill/anti-debugging-techniques)