Memory Forensics Evasion logo

Memory Forensics Evasion

OrganizationPopular
wgpsec
memory-forensics-evasion

内存取证与反内存取证方法论。从蓝队视角理解内存取证如何发现恶意行为(Volatility3 分析流程),从红队视角掌握如何规避内存检测(进程隐藏、内存加密、痕迹清除)。当需要分析内存 dump 或设计反取证策略时使用

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namememory-forensics-evasion
Stars
1.8K
Forks
247
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Memory Forensics Evasion AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wgpsec/AboutSecurity/tree/master/skills/dfir/memory-forensics-evasion
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/dfir/memory-forensics-evasion .claude/skills/memory-forensics-evasion
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Memory Forensics Evasion in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Memory Forensics Evasion on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Memory Forensics Evasion is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

内存取证与反内存取证

双面视角:理解蓝队如何从内存中找到你 → 设计红队对策让自己不被找到

⛔ 深入参考


Part A: 蓝队视角 — 内存取证分析流程

Phase 1: 内存获取

bash
# Windows (DumpIt)
DumpIt.exe /OUTPUT memory.raw

# Windows (WinPmem)
winpmem_mini_x64.exe memory.raw

# Linux (LiME)
sudo insmod lime-$(uname -r).ko "path=memory.lime format=lime"

# 远程 (Velociraptor)
# 通过 Velociraptor agent 远程获取内存

Phase 2: Volatility3 分析决策树

内存分析目标?
├─ 发现恶意进程 → windows.pslist / windows.psscan / windows.cmdline
├─ 发现注入代码 → windows.malfind / windows.hollowprocesses
├─ 提取网络连接 → windows.netscan / windows.netstat
├─ 提取凭据 → windows.hashdump / windows.lsadump
├─ 发现隐藏进程 → windows.psscan(扫描已释放 EPROCESS)
├─ Rootkit 检测 → windows.ssdt / windows.callbacks
└─ 提取文件 → windows.filescan / windows.dumpfiles

核心命令:

bash
# 系统信息
vol -f mem.raw windows.info

# 进程列表(链表遍历 → 已 unlink 的看不到)
vol -f mem.raw windows.pslist

# 进程扫描(池标签扫描 → 能找到隐藏进程)
vol -f mem.raw windows.psscan

# ⛔ 对比 pslist vs psscan → 差异 = 隐藏进程
# pslist 有但 psscan 无 → 异常
# psscan 有但 pslist 无 → 被 unlink 的进程(Rootkit)

# 注入检测(PAGE_EXECUTE_READWRITE 内存区域)
vol -f mem.raw windows.malfind

# 网络连接
vol -f mem.raw windows.netscan

# DLL 列表
vol -f mem.raw windows.dlllist --pid <PID>

# 命令行参数
vol -f mem.raw windows.cmdline

Phase 3: 关键检测指标

蓝队检测项含义
RWX 内存页 (malfind)进程注入/Shellcode
父进程异常 (svchost→cmd)恶意进程创建链
pslist ≠ psscan进程隐藏(DKOM)
同名异路径进程进程伪装
异常 VAD 标签内存区域被篡改
SSDT/IDT hookRootkit
网络连接到异常端口C2 通信

Part B: 红队视角 — 反内存取证

策略 1: 避免被 malfind 发现

malfind 原理:扫描 PAGE_EXECUTE_READWRITE 的 VAD 节点
├─ 对策 1: 分配时用 RW,写入 shellcode 后改为 RX(不要 RWX)
├─ 对策 2: 使用 NtMapViewOfSection 映射 → 权限为 SECTION_MAP_EXECUTE
├─ 对策 3: Module Stomping — 覆盖合法 DLL 的 .text 节
└─ 对策 4: 使用回调执行(APC/Timer)→ 不创建远程线程

策略 2: 避免进程异常

父子进程关系审计绕过:
├─ Parent PID Spoofing → 伪造正常父进程
├─ 使用合法签名进程执行 → LOLBins
├─ 进程名/路径完全模仿 → svchost.exe 在正确路径
└─ 命令行参数正常化 → 不留异常 cmdline

策略 3: 内存加密(Sleep Mask)

Cobalt Strike Sleep Mask 原理:
1. Beacon 进入 Sleep 状态前 → 加密自身在内存中的代码段
2. 加密期间 → malfind 只看到随机数据,无 MZ 头/PE 特征
3. 唤醒时 → 解密执行 → 完成任务 → 再加密

现代 C2 实现:
├─ Havoc: Ekko/Zilean sleep obfuscation(加密 + 更改内存保护)
├─ Sliver: 无需 sleep mask(Go 二进制特征不同)
├─ BRC4: 自带 heap 加密
└─ 自定义: SystemFunction032 (RC4) + VirtualProtect(RW)

策略 4: 避免 Credential Dump 暴露

蓝队会检查 LSASS 访问:
├─ 对策: 用 MiniDumpWriteDump 的替代方式(NanoDump/HandleDuplicate)
├─ 对策: SSP 注入代替直接读取
├─ 对策: 使用 comsvcs.dll 的 MiniDump 导出函数
└─ 对策: Kerberos 票据攻击代替直接 dump

策略 5: 清除内存痕迹

⛔ 注意:内存获取通常是一次性快照,不像日志可以被删除
最佳策略:从一开始就不留痕迹(预防 > 清除)

有限清除手段:
├─ Unmap 已用内存区域 → VirtualFree
├─ 清除线程调用栈 → 伪造 Call Stack
├─ 结束并清理 worker 线程 → 不留挂起线程
└─ Module 卸载 + 内存置零

对照表:取证技术 vs 红队对策

取证技术发现什么红队对策
pslist/psscan 对比隐藏进程不隐藏进程,伪装合法进程
malfind注入代码Module Stomping + RW→RX
netscanC2 连接使用合法流量混淆
hashdump凭据被提取使用 Kerberos 代替 NTLM
handles打开的文件/注册表用完即关闭 handle
callbacks/SSDTRootkit hook避免内核操作
YARA scan内存中的恶意特征Sleep Mask 加密

工具速查

工具用途方向
Volatility3内存取证框架蓝
MemProcFS内存文件系统化分析蓝
WinDbg内核调试/分析蓝
BeaconEye检测 CS Beacon蓝
Moneta检测内存注入蓝
Sleep Mask KitCS sleep 加密红
SysWhispers3直接 syscall(绕 hook)红
NanoDumpLSASS 低检测 dump红

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Memory Forensics Evasion AI skill do?

内存取证与反内存取证方法论。从蓝队视角理解内存取证如何发现恶意行为(Volatility3 分析流程),从红队视角掌握如何规避内存检测(进程隐藏、内存加密、痕迹清除)。当需要分析内存 dump 或设计反取证策略时使用

Why use Memory Forensics Evasion on TypingMind?

Because you install it once and use it with any model. Memory Forensics Evasion is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Memory Forensics Evasion in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/dfir/memory-forensics-evasion. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Memory Forensics Evasion?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Memory Forensics Evasion?

As many as you like. As long as a model supports skills, you can use Memory Forensics Evasion with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Memory Forensics Evasion AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇