Disk Forensics Evasion logo

Disk Forensics Evasion

OrganizationPopular
wgpsec
disk-forensics-evasion

磁盘取证与反磁盘取证方法论。理解蓝队如何从磁盘恢复删除文件、提取时间线、分析文件系统 artifact,以及红队如何进行反取证(安全删除、时间戳篡改、痕迹清除)。当需要规避磁盘取证或进行磁盘分析时使用

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namedisk-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 Disk 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/disk-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/disk-forensics-evasion .claude/skills/disk-forensics-evasion
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Disk 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 Disk 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 Disk 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
# 使用 dcfldd 完整镜像(含哈希校验)
dcfldd if=/dev/sdb of=/evidence/disk.dd \
  hash=sha256 hashlog=/evidence/disk.sha256 \
  bs=4096 conv=noerror,sync

# 使用 E01 格式(压缩+分片)
ewfacquire /dev/sdb -t /evidence/disk \
  -c deflate -S 2G -e "Case INC-2025"

# 验证完整性
sha256sum /evidence/disk.dd

Phase 2: 文件系统分析决策树

文件系统类型?
├─ NTFS (Windows) → MFT分析 / USN Journal / $LogFile
├─ ext4 (Linux) → inode / journal / superblock
├─ APFS (macOS) → diskutil / apfs_parser
└─ FAT32 (USB) → 简单文件表 / 簇分析

Phase 3: Windows NTFS 关键 Artifact

Artifact位置内容
$MFT卷根每个文件的元数据(时间戳、大小、路径)
$UsnJrnl$Extend\文件变更日志(创建/删除/重命名)
$LogFile卷根NTFS 事务日志
PrefetchC:\Windows\Prefetch\程序执行记录(最后8次执行时间)
AmcacheC:\Windows\AppCompat\程序首次执行+SHA1
Shimcache注册表程序兼容性缓存
LNK 文件Recent\最近访问文件记录
Jump ListsCustomDestinations\任务栏程序历史
$Recycle.Bin卷根回收站($I=元数据 $R=内容)
VSSSystem Volume Information卷影副本(历史快照)
bash
# Sleuth Kit 分析
fls -r -p /evidence/disk.dd        # 递归列出文件(含已删除)
icat /evidence/disk.dd <inode>     # 按 inode 提取文件内容
tsk_recover -r /evidence/disk.dd /output/  # 恢复已删除文件

# MFT 解析
python3 analyzeMFT.py -f \$MFT -o mft_output.csv

# 时间线生成
log2timeline.py /evidence/timeline.plaso /evidence/disk.dd
psort.py -o l2tcsv /evidence/timeline.plaso > timeline.csv

Phase 4: Linux ext4 关键 Artifact

Artifact内容
/var/log/系统日志(auth.log, syslog, wtmp, btmp)
.bash_history命令历史
/tmp/临时文件(攻击者常用目录)
crontab持久化计划任务
/etc/passwd + shadow新增账户
journal (ext4)文件系统操作日志
inode timestampsatime/mtime/ctime/crtime

Part B: 红队视角 — 反磁盘取证

策略 1: 安全删除(不可恢复)

bash
# ⛔ 普通 rm 只删除 MFT 条目,数据仍在磁盘!

# Linux 安全删除
shred -vfz -n 3 target_file      # 多次覆写+零填充
srm -sz target_file               # 安全删除

# Windows 安全删除
cipher /w:C:\path\                # 覆写可用空间
sdelete -p 3 target_file          # Sysinternals 安全删除

# 内存文件系统操作(不触盘)
# Linux: 在 /dev/shm 或 tmpfs 操作
mkdir /dev/shm/.work && cd /dev/shm/.work
# Windows: 使用 Named Pipe / 内存 mapped file

策略 2: 时间戳篡改 (Timestomping / T1070.006)

bash
# Linux: touch 修改 atime/mtime
touch -t 202301011200.00 malware.elf    # 伪装成旧文件
touch -r /bin/ls malware.elf            # 匹配合法文件时间

# Windows: PowerShell
$(Get-Item file.exe).CreationTime = "01/01/2023 12:00:00"
$(Get-Item file.exe).LastWriteTime = "01/01/2023 12:00:00"
$(Get-Item file.exe).LastAccessTime = "01/01/2023 12:00:00"

# ⛔ 注意:NTFS 有 4 组时间戳!
# $STANDARD_INFORMATION 的时间 → 上面的方法可改
# $FILE_NAME 的时间 → 只能通过 NTFS 底层操作修改
# 蓝队对比两组时间差异 → 发现 timestomping

策略 3: Artifact 清除清单

Windows 操作后清除:
├─ Prefetch → 删除 C:\Windows\Prefetch\TOOLNAME-*.pf
├─ Amcache → 删除注册表条目(需要 SYSTEM 权限)
├─ Shimcache → 内存中缓存,重启前修改注册表
├─ USN Journal → fsutil usn deletejournal /d C:
├─ Event Log → wevtutil cl Security/System/Application
├─ Recent/LNK → 删除 %APPDATA%\Microsoft\Windows\Recent\*
├─ Jump Lists → 删除 CustomDestinations\*
├─ $Recycle.Bin → 已手动删除就不进回收站
└─ Thumbcache → 删除 %LocalAppData%\Microsoft\Windows\Explorer\thumbcache*

Linux 操作后清除:
├─ .bash_history → unset HISTFILE 或 export HISTSIZE=0
├─ /var/log/ → 精准修改(不要清空,会被发现)
├─ wtmp/btmp → utmpdump → 编辑 → utmpdump -r
├─ auth.log → sed -i 删除特定行
├─ journal → journalctl --vacuum-time=1h
└─ /tmp/ 文件 → shred 后删除

策略 4: 最佳实践 — 从一开始减少痕迹

OPSEC 最优方案(预防 > 清除):
├─ 工具不落盘 → 内存执行(反射加载/fileless)
├─ 使用 RAM 磁盘 → /dev/shm 或 tmpfs
├─ 操作前 unset HISTFILE → 不记录命令
├─ 使用 LOLBins → 不引入新文件
├─ 通过管道传输 → curl | python 不落盘
├─ 加密落盘文件 → 即使被发现也无法分析
└─ 最短驻留时间 → 用完即删

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

蓝队手段红队暴露红队对策
文件恢复(icat/tsk_recover)rm 后数据仍在shred/sdelete 覆写
时间线分析(plaso)操作时间异常timestomping
MFT 分析$FN时间戳未改底层 NTFS 操作或不落盘
USN Journal文件操作记录删除 USN Journal
Prefetch 分析工具执行记录删除 .pf 或不用独立 EXE
卷影副本历史文件快照vssadmin delete shadows
日志分析登录/操作记录精确日志行删除(非清空)

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 Disk Forensics Evasion AI skill do?

磁盘取证与反磁盘取证方法论。理解蓝队如何从磁盘恢复删除文件、提取时间线、分析文件系统 artifact,以及红队如何进行反取证(安全删除、时间戳篡改、痕迹清除)。当需要规避磁盘取证或进行磁盘分析时使用

Why use Disk Forensics Evasion on TypingMind?

Because you install it once and use it with any model. Disk 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 Disk Forensics Evasion in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/dfir/disk-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 Disk 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 Disk Forensics Evasion?

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

Is the Disk 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 👇