Community程式設計與開發github.com

yaklang/vm-and-bytecode-reverse

自定義虛擬機與字節碼逆向工程手冊。適用於CTF挑戰或受保護軟體中實現自定義虛擬機、專有字節碼、調度器迴圈或迷宮式挑戰時使用。

vm-and-bytecode-reverse 是什麼?

此技能提供了一套全面的自定義虛擬機(VM)和字節碼逆向工程工作流程,專為處理CTF挑戰或受保護軟體中遇到的複雜自定義虛擬機設計。它涵蓋了從識別虛擬機調度器迴圈、分析專有字節碼格式,到理解操作碼(opcode)與處理器邏輯的關鍵技術。技能支援多種平台(包括Windows、Linux和macOS),並提供實用方法來破解迷宮式挑戰和混淆的字節碼。通過利用模式識別、模擬和動態分析,使用者可以有效地反彙編和剖析自定義VM的執行流程。該技能基於詳細的SKILL.md文檔,確保逆向工程師能系統性地處理此類挑戰,從而還原受保護軟體的原始邏輯。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/yaklang/hack-skills/tree/main/skills/vm-and-bytecode-reverse

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

vm-and-bytecode-reverse 是做什麼的?

自定義虛擬機與字節碼逆向工程手冊。適用於CTF挑戰或受保護軟體中實現自定義虛擬機、專有字節碼、調度器迴圈或迷宮式挑戰時使用。

概述

本技能提供了一套系統化的方法來逆向工程自定義虛擬機(VM)及其對應的字節碼。無論是CTF比賽中的謎題,還是商業軟體中的保護機制,你都可以使用此工作流程來分析和破解基於虛擬機的混淆層。

使用時機

  • 當程式碼中檢測到複雜的調度器迴圈(dispatcher loop)時
  • 當發現大量看似混亂的操作碼(opcode)但存在隱藏模式時
  • 當挑戰涉及迷宮式(maze-style)虛擬機狀態轉換時
  • 當需要分析自定義字節碼格式並還原其原始邏輯時

核心技術

  • 調度器迴圈分析:識別VM主循環,了解其如何從字節碼流中讀取和分發指令。
  • 字節碼反彙編:將原始字節碼映射回可讀的指令序列,包括操作碼和操作數。
  • 操作碼語義還原:通過動態或靜態分析推斷每個操作碼的具體行為。
  • 迷宮路徑求解:對於基於VM的迷宮挑戰,使用符號執行或路徑枚舉技術。

平台支援

  • Windows(x86/x64)
  • Linux(x86/x64, ARM)
  • macOS(x86/x64, Apple Silicon)

使用方法

  1. 提取字節碼:從目標二進位檔案中定位並提取自定義字節碼數據。
  2. 識別調度器:找到VM調度器函數,分析其指令分發邏輯。
  3. 建立指令集:記錄所有操作碼及其對應的行為。
  4. 撰寫反彙編器:基於分析結果編寫簡單的反彙編工具(推薦使用Python)。
  5. 模擬執行:必要時在沙箱中模擬VM以觀察其行為。

範例

假設你遇到一個使用自定義VM的CTF逆向題目:

  • 字節碼前綴 \xAB\xCD 標記為指令開始
  • 調度器使用 switch 語句分發操作碼
  • 操作碼 0x01 為MOV,0x02 為ADD

透過分析調度器,你可以還原所有指令,並編寫反彙編器來生成類似彙編的輸出,從而理解程式邏輯。

參考資源

  • CTF逆向工程教程
  • 自定義VM分析工具:可用 radare2 或 Ghidra 配合腳本化分析
  • 符號執行引擎:如 angr 可用於自動化路徑探索

使用此技能時,請確保你有足夠的逆向工程基礎知識。對於複雜的混淆,可能需要結合動態調試和靜態分析。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

yaklang/401-403-bypass-techniques

401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP method tampering, header injection, protocol downgrade, and automated bypass tools.

yaklang/active-directory-acl-abuse

Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.

yaklang/active-directory-certificate-services

AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.

yaklang/active-directory-kerberos-attacks

Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets, delegation abuse, or pass-the-ticket attacks.

yaklang/ai-ml-security

AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing, data privacy attacks (membership inference, model inversion), and autonomous agent security risks.

yaklang/android-pentesting-tricks

Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent redirection, root detection bypass, tapjacking, and backup extraction during authorized mobile security assessments.

yaklang/anti-debugging-techniques

Anti-debugging detection and bypass playbook. Use when reversing protected binaries that detect debuggers via ptrace, PEB flags, timing checks, or signal/exception handlers on Linux and Windows.

yaklang/api-auth-and-jwt-abuse

API authentication and JWT abuse playbook. Use when testing bearer tokens, API keys, claim trust, header spoofing, rate limits, and API auth boundary weaknesses.

yaklang/api-authorization-and-bola

API authorization and BOLA testing playbook. Use when APIs expose object identifiers, nested resources, hidden writable fields, or weak function-level authorization.

yaklang/api-recon-and-docs

API reconnaissance and documentation review playbook. Use when discovering endpoints, schemas, versions, OpenAPI specs, hidden docs, and surface area for API testing.

yaklang/api-sec

Entry P1 category router for API security. Use when choosing between API recon, authorization, token abuse, and hidden-parameter workflows before any deeper API topic skill.

yaklang/arbitrary-write-to-rce

Arbitrary write to RCE playbook. Use when you have an arbitrary write primitive (from heap exploitation, format string, or OOB write) and need to convert it into code execution by targeting GOT, hooks, _IO_FILE vtable, exit_funcs, TLS_dtor_list, modprobe_path, .fini_array, or C++ vtables.

yaklang/authbypass-authentication-flaws

Authentication bypass testing playbook. Use when assessing login flows, password reset logic, account recovery, MFA bypass, token predictability, brute-force resistance, and session boundary flaws.

yaklang/auth-sec

Entry P1 category router for authentication and authorization. Use when testing login flows, sessions, object authorization, JWT, OAuth, CORS, CSRF, and enterprise SSO weaknesses before any deeper auth topic skill.

yaklang/binary-protection-bypass

Binary protection bypass playbook. Use when identifying and bypassing ASLR, PIE, NX/DEP, stack canary, RELRO, FORTIFY_SOURCE, CET, and MTE protections in ELF binaries to enable exploitation.

yaklang/browser-exploitation-v8

Browser and V8 exploitation playbook. Use when exploiting JavaScript engine vulnerabilities including JIT type confusion, incorrect bounds elimination, and V8 sandbox bypass to achieve renderer RCE and sandbox escape in Chrome/Chromium.

yaklang/business-logic-vuln

Entry P1 category router for business logic testing. Use when workflow abuse, race conditions, pricing flaws, or multi-step state attacks matter more than parser-level input injection.

yaklang/business-logic-vulnerabilities

Business logic vulnerability playbook. Use when reasoning about workflows, race conditions, price manipulation, coupon abuse, state machines, and multi-step authorization gaps.

yaklang/classical-cipher-analysis

Classical cipher analysis playbook. Use when encountering substitution ciphers, Vigenere, transposition, XOR, or encoded text in CTF challenges that requires frequency analysis, Kasiski examination, or known-plaintext cryptanalysis.

yaklang/clickjacking

Clickjacking playbook. Use when testing whether target pages can be framed, whether X-Frame-Options or CSP frame-ancestors are properly configured, and whether UI redress attacks can trigger sensitive actions.

相關技能