agentleFS
buzzer-rebuzzer-re/Rikugan/skills/malware-analysis/SKILL.md

malware-analysis

Skill715 starsChanged 5 days agoMITView on GitHub

Windows PE malware analysis — kill chain, IOC extraction, MITRE ATT&CK mapping

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use attack-chain, js-reverse and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • DorianGalloSkill

    attack-chain

    Also in 6 projects that use this

  • DorianGalloSkill

    js-reverse

    Also in 6 projects that use this

  • Roshu18Skill

    pentest-tools

    Tool selection policy for BearStrike based on target type, scan risk, and signal strength.

    Also in 6 projects that use this

  • hardw00tSkill

    llm-security

    LLM and AI application security testing skill for prompt injection (direct, indirect, multimodal), system-prompt extraction, RAG poisoning, memory poisoning, MCP server injection, skill-file injection, agentic tool misuse, computer-use UI injection, and excessive agency. Authorization required — this skill tests AI systems you are explicitly permitted to assess. Triggers on requests to test LLM / AI-agent / RAG / MCP / computer-use security, perform prompt injection, extract system prompts, poison RAG or memory, audit agent tool use, or evaluate AI guardrails.

    Also in 6 projects that use this

  • +8 more from DorianGallo

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before analysis, check for obfuscation:

    line 9
  2. Very specific:

    If code is heavily obfuscated (opaque predicates, CFF, MBA): invoke /deobfuscation first

    line 11
  3. Distinctive:

    If very few readable strings in a large binary → strings are encrypted

    line 12
  4. Distinctive:

    Look for the string decode stub: a small function called before every string use

    line 13
  5. Distinctive:

    If strings are encrypted: trace the decode function, understand the algorithm (XOR, RC4, custom)

    line 14
  6. Distinctive:

    Crypto constant hunting: When you find RC4 S-box or AES constants via search_strings, use xrefs_to on the constant's address (not the S-box …

    line 16
  7. Distinctive:

    Use built-in tools for initial survey:

    line 24
  8. Very specific:

    Use function_xrefs to map the call graph from entry

    line 40
  9. Distinctive:

    Check for process injection: VirtualAllocEx → WriteProcessMemory → CreateRemoteThread

    line 53
  10. Distinctive:

    Check for browser DB access patterns: SQLite, LevelDB, Login Data, Cookies

    line 58
  11. Distinctive:

    Check registry keys (RegSetValueEx, service install, scheduled task)

    line 66
  12. Distinctive:

    Check process injection (VirtualAllocEx, WriteProcessMemory, CreateRemoteThread)

    line 67
  13. Distinctive:

    Check anti-analysis: IsDebuggerPresent, timing checks, VM detection, CPUID

    line 68

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Task: Malware Analysis. You are analyzing a potentially malicious Windows PE binary. Defang all IOCs (hxxps://, [.]).

Phase 0: Obfuscation Triage

Before analysis, check for obfuscation:

  1. Decompile the entry point and a few key functions
  2. If code is heavily obfuscated (opaque predicates, CFF, MBA): invoke /deobfuscation first
  3. If very few readable strings in a large binary → strings are encrypted
  4. Look for the string decode stub: a small function called before every string use
  5. If strings are encrypted: trace the decode function, understand the algorithm (XOR, RC4, custom)

Crypto constant hunting: When you find RC4 S-box or AES constants via search_strings, use xrefs_to on the constant's address (not the S-box itself) → finds KSA/key schedule → decompile that → xrefs_to on it → finds the encrypt/decrypt wrapper. Do NOT use hex pattern search for KSA byte-swap — too many false positives.

Phase 1: Reconnaissance

Use built-in tools for initial survey:

  1. get_binary_info — format, architecture, size, function count
  2. list_imports — group by DLL, identify capabilities:
    • WINHTTP/WININET = Network communication
    • CRYPT32/ADVAPI32 (Crypt*) = Cryptographic operations
    • GDI32 = Screenshot capture
    • ntdll = Low-level ops, possible direct syscalls
  3. list_strings + search_strings — look for URLs, API paths, user agents, mutex names, file extensions, registry paths, app paths (Discord, Telegram, Chrome)
  4. list_exports — exported functions and ordinals

Batch these calls: get_binary_info + list_imports + list_exports can run in parallel.

Phase 2: Execution Flow

  1. Decompile entry point / WinMain with decompile_function
  2. Identify the execution sequence and lifecycle: init → config → steal → exfil → exit
  3. Use function_xrefs to map the call graph from entry
  4. Categorize functions: initialization, C2, stealing modules, exfiltration, cleanup

Phase 3: Targeted Analysis — Kill Chain

For network malware:

  • Trace: socket init → DNS resolution → connect → send/recv
  • Identify C2 protocol (raw socket, HTTP, DNS tunneling)
  • Extract C2 config (hardcoded IP/domain or decrypted)

For loader/dropper:

  • Identify stage 2 location (resource, overlay, encrypted blob)
  • Extract and decrypt if possible
  • Check for process injection: VirtualAllocEx → WriteProcessMemory → CreateRemoteThread

For stealers:

  • Identify targeted applications (browser paths, wallet files, credential stores)
  • Trace data exfiltration path
  • Check for browser DB access patterns: SQLite, LevelDB, Login Data, Cookies

For RATs:

  • Identify command dispatcher (usually a switch/if-chain on received data)
  • Map each command: file upload/download, screenshot, keylog, shell, persistence

Phase 4: Persistence + Evasion

  • Check registry keys (RegSetValueEx, service install, scheduled task)
  • Check process injection (VirtualAllocEx, WriteProcessMemory, CreateRemoteThread)
  • Check anti-analysis: IsDebuggerPresent, timing checks, VM detection, CPUID
  • Direct syscalls: Resolving ntdll via GetModuleHandleA + scanning for B8...0F05
  • Most commodity stealers have NO persistence — document this explicitly

Phase 5: Report

Produce a compact triage first (~12 lines), then offer a detailed report:

Binary:   mal.exe | PE x86-64 | 1519 funcs | 92 imports
Packing:  None (entropy <7.0 all sections)
Crypto:   RC4 x 5 constants
IAT:      KERNEL32 only — runtime LoadLibrary/GetProcAddress resolution
Targets:  Chrome, Brave, Edge
C2:       hxxps://example[.]com/api/config
Verdict:  Stealer. RC4 string enc, dynamic API resolution.

Include: classification, capabilities, IOCs (defanged), kill chain, MITRE ATT&CK mapping.

Naming Conventions

  • Functions: PascalCase verb-noun (InitializeGlobals, StealDiscordTokens, HttpPostRequest)
  • Globals: camelCase with g_ prefix (g_bEnabled, g_pConfigStart, g_C2ServerUrl)
  • Structs: PascalCase (BrowserConfig, C2ResponseData)

Common Patterns

  • Browser theft: CryptUnprotectData, SQLite, paths with "User Data", "Login Data", "Cookies"
  • Token theft: LevelDB (Discord), tdata (Telegram), .vdf (Steam)
  • Dead drop resolver: Fetching Steam/Telegram/Pastebin pages to extract real C2
  • Direct syscalls: Resolving ntdll via GetModuleHandleA + scanning for B8...0F05
  • XOR + Base64: Common for C2 config and payload delivery
  • API hashing: CRC32/DJB2/FNV of API names, resolved at runtime via PEB walk

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.