memory-forensics-volatility について
memory-forensics-volatilityは、Volatility 2と3でメモリダンプを調べるための手引きです。インシデント対応担当者やマルウェア調査者向けに、WindowsとLinuxの分析手順とバージョン別コマンドを整理しています。
主な機能
- 01Linux、Windows、VMのメモリ取得
- 02Volatility 2と3のコマンド比較
- 03プロセス、ネットワーク、モジュールの分析
- 04コードインジェクションとマルウェア兆候の検出
- 05ファイルや認証情報の抽出とタイムライン作成
活用シーン
- 01メモリダンプ内のマルウェア活動の調査
- 02隠しプロセスやコードインジェクションの確認
- 03ネットワーク接続と認証情報の痕跡分析
- 04LinuxまたはWindowsのメモリ証拠の調査
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ yaklang/ hack-skills --skill memory-forensics-volatilityインストール後、Claude Code で/memory-forensics-volatilityを入力して読み込まれたか確認します。
同梱ファイルVOLATILITY_CHEATSHEET.md
詳細
スキル:メモリフォレンジック — エキスパート分析プレイブック
AI LOAD INSTRUCTION:Volatility 2 および 3 を使用したエキスパート向けメモリフォレンジック手法です。メモリの取得、OS の特定、プロセス分析(隠れたプロセスの検出)、ネットワーク接続、DLL/モジュール分析、コードインジェクションの検出(malfind)、認証情報の抽出、ファイルカービング、レジストリ分析、タイムラインの生成を扱います。ベースモデルでは、Vol2/Vol3 のコマンドの違い、マルウェアのインジケーターパターン、Linux 固有のメモリ分析が見落とされます。
0. 関連するルーティング
詳細な分析に入る前に、次の読み込みを検討してください。
- メモリの調査結果とネットワークアーティファクトを相関させるには、traffic-analysis-pcapを参照してください
- 抽出したファイルに隠しデータが含まれている疑いがある場合は、steganography-techniquesを参照してください
- メモリ内の侵害後のアーティファクトを理解するには、windows-privilege-escalationを参照してください
クイックリファレンス
次の情報が必要な場合は、VOLATILITY_CHEATSHEET.mdも読み込んでください。
- Vol2 と Vol3 のコマンド比較表
- 調査の種類ごとによく使われるプラグインの実行順序
1. メモリの取得
Linux
# LiME (Linux Memory Extractor) — kernel module
insmod lime.ko "path=/tmp/mem.lime format=lime"
# /proc/kcore (if available)
dd if=/proc/kcore of=/tmp/mem.raw bs=1M
# AVML (Microsoft's open-source)
./avml /tmp/mem.lime
Windows
# WinPmem
winpmem_mini_x64.exe memdump.raw
# FTK Imager (GUI) — capture memory to file
# DumpIt (single-click memory dump)
DumpIt.exe
# Comae (MagnetRAM)
MagnetRAMCapture.exe /output memdump.raw
仮想マシン
# VMware: .vmem file in VM directory (suspend VM first)
# VirtualBox: VBoxManage debugvm "VM_NAME" dumpvmcore --filename mem.raw
# KVM/QEMU: virsh dump DOMAIN memdump --memory-only
# Hyper-V: checkpoint VM → inspect .bin files
2. VOLATILITY 2 と 3 の比較
| 概念 | Volatility 2 | Volatility 3 |
|---|---|---|
| プロファイルシステム | --profile=Win10x64_19041 | 自動検出(シンボルテーブル) |
| イメージ情報 | imageinfo | windows.info / linux.info |
| プロセス一覧 | pslist | windows.pslist |
| ネットワーク | netscan / connections | windows.netscan / windows.netstat |
| DLL | dlllist | windows.dlllist |
| インジェクション | malfind | windows.malfind |
| ハッシュ | hashdump | windows.hashdump |
| ファイル | filescan | windows.filescan |
| レジストリ | hivelist / printkey | windows.registry.hivelist / windows.registry.printkey |
| インストール | pip2 install volatility | pip3 install volatility3 |
3. 分析手法
ステップ 1:OS の特定
# Vol2
vol.py -f mem.raw imageinfo
vol.py -f mem.raw kdbgscan
# Vol3
vol -f mem.raw windows.info
vol -f mem.raw banners.Banners
ステップ 2:プロセス一覧 — 隠れたプロセスの検出
# Vol2
vol.py -f mem.raw --profile=PROFILE pslist # EPROCESS linked list
vol.py -f mem.raw --profile=PROFILE psscan # pool tag scan (finds unlinked)
vol.py -f mem.raw --profile=PROFILE pstree # parent-child hierarchy
# Vol3
vol -f mem.raw windows.pslist
vol -f mem.raw windows.psscan
vol -f mem.raw windows.pstree
危険な兆候:psscan には表示されるが pslist には表示されないプロセスは、DKOM(Direct Kernel Object Manipulation)によって隠されています。
ステップ 3:ネットワーク接続
# Vol2
vol.py -f mem.raw --profile=PROFILE netscan # TCP/UDP endpoints
vol.py -f mem.raw --profile=PROFILE connections # XP/2003 only
vol.py -f mem.raw --profile=PROFILE connscan # closed connections
# Vol3
vol -f mem.raw windows.netscan
vol -f mem.raw windows.netstat
ステップ 4:DLL/モジュール分析
# Vol2
vol.py -f mem.raw --profile=PROFILE dlllist -p PID
vol.py -f mem.raw --profile=PROFILE ldrmodules -p PID # find unlinked DLLs
# Vol3
vol -f mem.raw windows.dlllist --pid PID
危険な兆候:dlllist には表示されるものの、ldrmodules の 3 つの列すべてで False となる DLL は、リフレクティブ DLL インジェクションを示します。
ステップ 5:コードインジェクションの検出(Malfind)
# Vol2
vol.py -f mem.raw --profile=PROFILE malfind -p PID
vol.py -f mem.raw --profile=PROFILE malfind -D /tmp/dump/ # dump injected sections
# Vol3
vol -f mem.raw windows.malfind --pid PID
malfind が検出するもの:PAGE_EXECUTE_READWRITE を持ち、ディスク上のファイルに対応付けられていないメモリ領域です。これは典型的なシェルコード/インジェクションのインジケーターです。
ステップ 6:認証情報の抽出
# Vol2
vol.py -f mem.raw --profile=PROFILE hashdump # SAM hashes
vol.py -f mem.raw --profile=PROFILE lsadump # LSA secrets
vol.py -f mem.raw --profile=PROFILE cachedump # domain cached creds
vol.py -f mem.raw --profile=PROFILE mimikatz # (plugin) plaintext creds
# Vol3
vol -f mem.raw windows.hashdump
vol -f mem.raw windows.lsadump
vol -f mem.raw windows.cachedump
ステップ 7:ファイルの抽出
# Vol2
vol.py -f mem.raw --profile=PROFILE filescan | grep -i "password\|secret\|flag"
vol.py -f mem.raw --profile=PROFILE dumpfiles -Q OFFSET -D /tmp/dump/
# Vol3
vol -f mem.raw windows.filescan
vol -f mem.raw windows.dumpfiles --virtaddr OFFSET
ステップ 8:レジストリ分析
# Vol2
vol.py -f mem.raw --profile=PROFILE hivelist
vol.py -f mem.raw --profile=PROFILE printkey -K "Software\Microsoft\Windows\CurrentVersion\Run"
vol.py -f mem.raw --profile=PROFILE userassist # program execution evidence
# Vol3
vol -f mem.raw windows.registry.hivelist
vol -f mem.raw windows.registry.printkey --key "Software\Microsoft\Windows\CurrentVersion\Run"
ステップ 9:コマンド履歴
# Vol2
vol.py -f mem.raw --profile=PROFILE cmdscan # cmd.exe history
vol.py -f mem.raw --profile=PROFILE consoles # full console output
# Vol3
vol -f mem.raw windows.cmdline
ステップ 10:タイムラインの生成
# Vol2
vol.py -f mem.raw --profile=PROFILE timeliner --output=body --output-file=timeline.body
mactime -b timeline.body -d > timeline.csv
# Vol3
vol -f mem.raw timeliner.Timeliner
4. Linux メモリ分析
# Vol2 (requires Linux profile)
vol.py -f mem.lime --profile=LinuxProfile linux_pslist
vol.py -f mem.lime --profile=LinuxProfile linux_pstree
vol.py -f mem.lime --profile=LinuxProfile linux_netstat
vol.py -f mem.lime --profile=LinuxProfile linux_bash # bash history
vol.py -f mem.lime --profile=LinuxProfile linux_enumerate_files
vol.py -f mem.lime --profile=LinuxProfile linux_proc_maps -p PID
vol.py -f mem.lime --profile=LinuxProfile linux_malfind
# Vol3
vol -f mem.lime linux.pslist
vol -f mem.lime linux.pstree
vol -f mem.lime linux.bash
vol -f mem.lime linux.check_afinfo # rootkit detection
vol -f mem.lime linux.check_syscall # syscall hooking
vol -f mem.lime linux.tty_check # TTY hooking
Linux プロファイルの構築(Vol2)
cd volatility/tools/linux
make
# Creates module.dwarf + System.map → zip as profile
zip LinuxProfile.zip module.dwarf /boot/System.map-$(uname -r)
# Place in volatility/plugins/overlays/linux/
5. メモリ内のマルウェアインジケーター
| インジケーター | 検出方法 | 意味 |
|---|---|---|
| psscan には表示されるが pslist には表示されないプロセス | pslist と psscan を比較 | DKOM — プロセスの隠蔽 |
| 想定外の親子関係 | pstree 分析 | 例:svchost が cmd.exe によって起動されている |
| イメージ以外のメモリ内にある MZ ヘッダー | malfind | リフレクティブ DLL/PE インジェクション |
| バッキングファイルのない RWX メモリ | malfind | シェルコードインジェクション |
| すべての PEB リストからリンク解除された DLL | ldrmodules(すべて False) | ステルス DLL の読み込み |
| services.exe の子プロセスではない svchost.exe | pstree | 偽装された svchost(マルウェア) |
| 不審なネットワーク接続 | netscan + PID の相関 | C2 通信 |
| SSDT/IDT のフック | ssdt / idt プラグイン | ルートキット |
| 改変されたカーネルオブジェクト | linux_check_syscall | Linux ルートキット |
正常な親子関係(Windows)
System (4)
└── smss.exe
└── csrss.exe
└── wininit.exe
└── services.exe
└── svchost.exe (multiple)
└── spoolsv.exe
└── lsass.exe
└── winlogon.exe
└── explorer.exe
└── user applications
6. 判断ツリー
Memory dump acquired — need to analyze
│
├── What OS?
│ ├── Windows → vol imageinfo / windows.info (§3 Step 1)
│ └── Linux → build profile or use Vol3 auto-detect (§4)
│
├── Malware investigation?
│ ├── Check processes: pslist vs psscan (hidden?) (§3 Step 2)
│ ├── Check parent-child: pstree (suspicious spawning?) (§5)
│ ├── Check injections: malfind (RWX memory?) (§3 Step 5)
│ ├── Check DLLs: ldrmodules (unlinked?) (§3 Step 4)
│ ├── Check network: netscan (C2 connections?) (§3 Step 3)
│ └── Extract suspicious files: dumpfiles (§3 Step 7)
│
├── Credential recovery?
│ ├── SAM hashes → hashdump (§3 Step 6)
│ ├── LSA secrets → lsadump (§3 Step 6)
│ ├── Cached domain creds → cachedump (§3 Step 6)
│ └── Plaintext passwords → mimikatz plugin (§3 Step 6)
│
├── Incident timeline?
│ ├── timeliner for comprehensive timeline (§3 Step 10)
│ ├── cmdscan / consoles for command history (§3 Step 9)
│ ├── userassist for program execution (§3 Step 8)
│ └── Cross-reference with PCAP timeline (→ traffic-analysis-pcap)
│
├── CTF / flag hunting?
│ ├── filescan + grep for flag patterns (§3 Step 7)
│ ├── cmdscan for typed flags/passwords (§3 Step 9)
│ ├── Clipboard: clipboard plugin
│ ├── Screenshots: screenshot plugin
│ └── Environment vars: envars plugin
│
└── Linux-specific?
├── linux_bash for shell history (§4)
├── linux_check_syscall for rootkit (§4)
└── linux_netstat for connections (§4)