Communitygithub.com

SamuelChien/mega-skills-collection

dd および dcfldd を使用して、ハッシュ検証により証拠の整合性を維持しながら、フォレンジック的に妥当なビット単位のディスクイメージを作成します。

mega-skills-collection とは?

このスキルは、dd および dcfldd を用いてフォレンジック調査用のビット単位のディスクイメージを取得するための詳細なワークフローを提供します。 証拠の整合性を保証するために、書き込みブロッカーの設定、ターゲットデバイスの特定、進行状況表示とエラーハンドリング付きのイメージ取得、SHA-256/MD5 によるハッシュ検証、そして完全なチェーンオブカストディ文書の生成をカバーしています。 このスキルは、Linux ベースのフォレンジックワークステーション(SIFT、Kali など)向けに設計されており、物理ドライブ、USB デバイス、メモリカードなどのさまざまな証拠ソースをサポートしています。 また、イメージの分割、圧縮、およびネットワーク経由のリモート取得にも対応しており、法執行機関やインシデント対応の専門家にとって堅牢で汎用的なツールとなっています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/acquiring-disk-image-with-dd-and-dcfldd

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

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

ドキュメント

dd および dcfldd によるディスクイメージの取得

使用すべき状況

  • 調査のために被疑ドライブのフォレンジックコピーを作成する必要がある場合
  • インシデント対応において、分析前に揮発性ディスク証拠を保存する場合
  • 法執行機関や法的手続きにおいて、検証済みのビット単位コピーが必要な場合
  • ストレージデバイスに対して破壊的な分析を実行する前
  • 物理ドライブ、USB デバイス、メモリカードからイメージを取得する場合

前提条件

  • Linux ベースのフォレンジックワークステーション(SIFT、Kali、または任意の Linux ディストリビューション)
  • dd(すべての Linux システムにプリインストール)または dcfldd(拡張フォレンジック版)
  • ハードウェアライトブロッカー、またはソフトウェア書き込み保護が設定されていること
  • ソースよりも大きい容量の保存先ドライブ
  • フォレンジックワークステーションでの root/sudo 権限
  • SHA-256 または MD5 ハッシュユーティリティ(sha256sum、md5sum)

ワークフロー

ステップ 1: ターゲットデバイスの特定と書き込み保護の有効化

# 接続されているすべてのブロックデバイスを一覧表示してターゲットを特定
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,MODEL

# デバイスの詳細を確認
fdisk -l /dev/sdb

# ソフトウェア書き込み保護を有効化(ハードウェアブロッカーがない場合)
blockdev --setro /dev/sdb

# 読み取り専用ステータスを確認
blockdev --getro /dev/sdb
# 出力: 1(読み取り専用が有効)

# または、永続的な書き込み保護のために udev ルールを使用
echo 'SUBSYSTEM=="block", ATTRS{serial}=="WD-WCAV5H861234", ATTR{ro}="1"' > /etc/udev/rules.d/99-writeblock.rules
udevadm control --reload-rules

ステップ 2: 保存先の準備とソースの文書化

# ケースディレクトリ構造を作成
mkdir -p /cases/case-2024-001/{images,hashes,logs,notes}

# ソースドライブ情報を文書化
hdparm -I /dev/sdb > /cases/case-2024-001/notes/source_drive_info.txt

# シリアル番号とモデルを記録
smartctl -i /dev/sdb >> /cases/case-2024-001/notes/source_drive_info.txt

# ソースデバイスの事前ハッシュを取る
sha256sum /dev/sdb | tee /cases/case-2024-001/hashes/source_hash_before.txt

ステップ 3: dd を使用したイメージ取得

# 進行状況表示とエラーハンドリング付きの基本的な dd 取得
dd if=/dev/sdb of=/cases/case-2024-001/images/evidence.dd \
   bs=4096 \
   conv=noerror,sync \
   status=progress 2>&1 | tee /cases/case-2024-001/logs/dd_acquisition.log

# 容量節約のための圧縮イメージ
dd if=/dev/sdb bs=4096 conv=noerror,sync status=progress | \
   gzip -c > /cases/case-2024-001/images/evidence.dd.gz

# 特定のカウントを使用した部分取得
dd if=/dev/sdb of=/cases/case-2024-001/images/first_1gb.dd \
   bs=1M count=1024 status=progress

ステップ 4: dcfldd を使用した取得(推奨フォレンジック手法)

# dcfldd がインストールされていない場合はインストール
apt-get install dcfldd

# 内蔵ハッシュと分割出力を使用したイメージ取得
dcfldd if=/dev/sdb \
   of=/cases/case-2024-001/images/evidence.dd \
   hash=sha256,md5 \
   hashwindow=1G \
   hashlog=/cases/case-2024-001/hashes/acquisition_hashes.txt \
   bs=4096 \
   conv=noerror,sync \
   errlog=/cases/case-2024-001/logs/dcfldd_errors.log

# 大規模イメージを管理可能なセグメントに分割
dcfldd if=/dev/sdb \
   of=/cases/case-2024-001/images/evidence.dd \
   hash=sha256 \
   hashlog=/cases/case-2024-001/hashes/split_hashes.txt \
   bs=4096 \
   split=2G \
   splitformat=aa

# 検証パス付き取得
dcfldd if=/dev/sdb \
   of=/cases/case-2024-001/images/evidence.dd \
   hash=sha256 \
   hashlog=/cases/case-2024-001/hashes/verification.txt \
   vf=/cases/case-2024-001/images/evidence.dd \
   verifylog=/cases/case-2024-001/logs/verify.log

ステップ 5: イメージ整合性の検証

# 取得したイメージのハッシュを取る
sha256sum /cases/case-2024-001/images/evidence.dd | \
   tee /cases/case-2024-001/hashes/image_hash.txt

# ソースハッシュとイメージハッシュを比較
diff <(sha256sum /dev/sdb | awk '{print $1}') \
     <(sha256sum /cases/case-2024-001/images/evidence.dd | awk '{print $1}')

# 分割イメージを使用する場合、各セグメントを検証
sha256sum /cases/case-2024-001/images/evidence.dd.* | \
   tee /cases/case-2024-001/hashes/split_image_hashes.txt

# ソースを再ハッシュして変更がないことを確認
sha256sum /dev/sdb | tee /cases/case-2024-001/hashes/source_hash_after.txt
diff /cases/case-2024-001/hashes/source_hash_before.txt \
     /cases/case-2024-001/hashes/source_hash_after.txt

ステップ 6: 取得プロセスの文書化

# 取得レポートを生成
cat << 'EOF' > /cases/case-2024-001/notes/acquisition_report.txt
DISK IMAGE ACQUISITION REPORT
==============================
Case Number: 2024-001
Date/Time: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
Examiner: [Name]

Source Device: /dev/sdb
Model: [from hdparm output]
Serial: [from hdparm output]
Size: [from fdisk output]

Acquisition Tool: dcfldd v1.9.1
Block Size: 4096
Write Blocker: [Hardware/Software model]

Image File: evidence.dd
Image Hash (SHA-256): [from hash file]
Source Hash (SHA-256): [from hash file]
Hash Match: YES/NO

Errors During Acquisition: [from error log]
EOF

# アーカイブ用にログを圧縮
tar -czf /cases/case-2024-001/acquisition_package.tar.gz \
   /cases/case-2024-001/hashes/ \
   /cases/case-2024-001/logs/ \
   /cases/case-2024-001/notes/

主要概念

概念説明
ビット単位コピー未割り当て領域やスラックスペースを含むソースの正確な複製
ライトブロッカー証拠メディアへの書き込みを防ぐハードウェアまたはソフトウェア機構
ハッシュ検証ソースとイメージを比較して整合性を証明する暗号学的ハッシュ
ブロックサイズ (bs)速度に影響する転送チャンクサイズ、フォレンジックでは 4096 または 64K が一般的
conv=noerror,sync読み取りエラーでも続行し、ゼロでパディングしてオフセットの位置を維持
チェーンオブカストディ証拠が改ざんされていないことを証明する文書化された経路
分割イメージング大規模イメージを小さなファイルに分割して保存および転送
Raw/dd 形式メタデータコンテナのオーバーヘッドがないビット単位のイメージ形式

ツールとシステム

ツール目的
dd標準 Unix ディスク複製ユーティリティ、raw イメージング用
dcflddDoD コンピュータフォレンジック研究所による強化版 dd、ハッシュ機能付き
dc3ddDoD サイバー犯罪センターによる別のフォレンジック dd バリアント
sha256sum整合性検証のための SHA-256 ハッシュ計算
blockdevブロックデバイスの読み取り専用モードを設定する Linux コマンド
hdparmドライブ識別とパラメータレポート
smartctlドライブの健全性と識別のための S.M.A.R.T. データ取得
lsblkブロックデバイスの列挙と識別

一般的なシナリオ

シナリオ 1: 被疑者のラップトップハードドライブの取得 Tableau T35u ハードウェアライトブロッカー経由でドライブを接続し、/dev/sdb として特定、SHA-256 ハッシュ付き dcfldd を使用、DVD アーカイブ用に 4GB セグメントに分割、ハッシュの一致を検証、ケースノートに文書化。

シナリオ 2: 侵害されたワークステーションからの USB フラッシュドライブのイメージング blockdev --setro でソフトウェア書き込み保護を使用、MD5 と SHA-256 の二重ハッシュを含む dcfldd で取得、イメージは単一ファイルに十分小さい、検証後、暗号化されたケースドライブに保存。

シナリオ 3: ネットワーク経由のリモート取得 netcat または ssh 経由でパイプされた dd を使用してリモート取得: ssh root@remote "dd if=/dev/sda bs=4096" | dd of=remote_image.dd bs=4096、両端で独立してハッシュを計算し、転送の整合性を検証。

シナリオ 4: 障害発生ドライブからの取得 最初に ddrescue を使用して読み取り可能なセクタを復元、その後 dd を conv=noerror,sync で使用してギャップをゼロで埋め、エラーログにどのセクタが読み取り不能だったかを文書化。

出力形式

Acquisition Summary:
  Source:       /dev/sdb (500GB Western Digital WD5000AAKX)
  Destination:  /cases/case-2024-001/images/evidence.dd
  Tool:         dcfldd 1.9.1
  Block Size:   4096 bytes
  Duration:     2h 15m 32s
  Bytes Copied: 500,107,862,016
  Errors:       0 bad sectors
  Source SHA-256:  a3f2b8c9d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1
  Image SHA-256:   a3f2b8c9d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1
  Verification:    PASSED - Hashes match

Individual skills in this repo

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

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

関連スキル