Hindsightによるブラウザフォレンジック分析 は何をしますか?
概要
Hindsightは、Google Chromeおよびその他のChromiumベースブラウザ(Microsoft Edge、Brave、Opera、Vivaldi)のアーティファクトを解析するために設計されたオープンソースのブラウザフォレンジックツールです。複数のブラウザデータベースファイルからデータを抽出・相関し、Webアクティビティの統合タイムラインを作成します。Hindsightは、URL、ダウンロード履歴、キャッシュレコード、ブックマーク、オートフィルレコード、保存パスワード、設定、ブラウザ拡張機能、HTTPクッキー、ローカルストレージ(HTML5クッキー)、ログインデータ、セッション/タブ情報を解析できます。このツールは複数の出力形式(XLSX、JSON、SQLite)で時系列タイムラインを生成し、調査担当者がインシデント対応、内部脅威調査、刑事事件においてユーザーのWebアクティビティを再構築できるようにします。
使用するタイミング
- ブラウザフォレンジック分析を伴うセキュリティインシデントを調査する場合
- このドメインに関連する検知ルールや脅威ハンティングクエリを構築する場合
- SOCアナリストがこの分析タイプに対する構造化された手順を必要とする場合
- 関連する攻撃テクニックに対するセキュリティ監視カバレッジを検証する場合
前提条件
- Python 3.8以上 + Hindsightがインストールされていること(
pip install pyhindsight)
- フォレンジックイメージからブラウザプロファイルディレクトリにアクセスできること
- ブラウザプロファイルデータ(OSレベルの暗号化が施されていないもの)
- 分析用のTimeline Explorerまたはスプレッドシートアプリケーション
ブラウザプロファイルの場所
| ブラウザ | Windowsのプロファイルパス |
|---|
| Chrome | %LOCALAPPDATA%\Google\Chrome\User Data\Default\ |
| Edge | %LOCALAPPDATA%\Microsoft\Edge\User Data\Default\ |
| Brave | %LOCALAPPDATA%\BraveSoftware\Brave-Browser\User Data\Default\ |
| Opera | %APPDATA%\Opera Software\Opera Stable\ |
| Vivaldi | %LOCALAPPDATA%\Vivaldi\User Data\Default\ |
| Chrome (macOS) | ~/Library/Application Support/Google/Chrome/Default/ |
| Chrome (Linux) | ~/.config/google-chrome/Default/ |
主要なアーティファクトファイル
| ファイル | 内容 |
|---|
| History | URL訪問、ダウンロード、キーワード検索 |
| Cookies | ドメイン、有効期限、値を含むHTTPクッキー |
| Web Data | オートフィルエントリ、保存済みクレジットカード |
| Login Data | 保存されたユーザー名/パスワード(暗号化済み) |
| Bookmarks | JSON形式のブックマークツリー |
| Preferences | ブラウザ設定と拡張機能 |
| Local Storage/ | ドメインごとのHTML5ローカルストレージ |
| Session Storage/ | ドメインごとのセッションストレージ |
| Network Action Predictor | 以前に入力されたURL |
| Shortcuts | Omniboxのショートカットと予測 |
| Top Sites | よく訪れるサイト |
Hindsightの実行
コマンドライン
hindsight.exe -i "C:\Evidence\Users\suspect\AppData\Local\Google\Chrome\User Data\Default" -o C:\Output\chrome_analysis
hindsight.exe -i "/path/to/profile" -o /output/analysis -b Chrome
hindsight.exe -i "C:\Evidence\Chrome\Default" -o C:\Output\chrome --format jsonl
hindsight.exe -i "C:\Evidence\Chrome\Default" -o C:\Output\chrome --cache
Web UI
hindsight_gui.exe
アーティファクト分析の詳細
URL履歴と訪問
ダウンロード履歴
クッキー分析
Python解析スクリプト
import sqlite3
import os
import json
import sys
from datetime import datetime, timedelta
CHROME_EPOCH = datetime(1601, 1, 1)
def chrome_time_to_datetime(chrome_ts: int):
"""Chromeタイムスタンプをdatetimeに変換する。"""
if chrome_ts == 0:
return None
try:
return CHROME_EPOCH + timedelta(microseconds=chrome_ts)
except (OverflowError, OSError):
return None
def analyze_chrome_history(profile_path: str, output_dir: str) -> dict:
"""フォレンジック証拠のためにChrome Historyデータベースを分析する。"""
history_db = os.path.join(profile_path, "History")
if not os.path.exists(history_db):
return {"error": "Historyデータベースが見つかりません"}
os.makedirs(output_dir, exist_ok=True)
conn = sqlite3.connect(f"file:{history_db}?mode=ro", uri=True)
cursor = conn.cursor()
cursor.execute("""
SELECT u.url, u.title, v.visit_time, u.visit_count,
v.transition & 0xFF as transition_type
FROM visits v JOIN urls u ON v.url = u.id
ORDER BY v.visit_time DESC LIMIT 5000
""")
visits = [{
"url": r[0], "title": r[1],
"visit_time": str(chrome_time_to_datetime(r[2])),
"total_visits": r[3], "transition": r[4]
} for r in cursor.fetchall()]
cursor.execute("""
SELECT target_path, tab_url, start_time, end_time,
received_bytes, total_bytes, mime_type, state
FROM downloads ORDER BY start_time DESC LIMIT 1000
""")
downloads = [{
"path": r[0], "source_url": r[1],
"start_time": str(chrome_time_to_datetime(r[2])),
"end_time": str(chrome_time_to_datetime(r[3])),
"received_bytes": r[4], "total_bytes": r[5],
"mime_type": r[6], "state": r[7]
} for r in cursor.fetchall()]
cursor.execute("""
SELECT k.term, u.url, k.url_id
FROM keyword_search_terms k JOIN urls u ON k.url_id = u.id
ORDER BY u.last_visit_time DESC LIMIT 1000
""")
searches = [{"term": r[0], "url": r[1]} for r in cursor.fetchall()]
conn.close()
report = {
"analysis_timestamp": datetime.now().isoformat(),
"profile_path": profile_path,
"total_visits": len(visits),
"total_downloads": len(downloads),
"total_searches": len(searches),
"visits": visits,
"downloads": downloads,
"searches": searches
}
report_path = os.path.join(output_dir, "browser_forensics.json")
with open(report_path, "w") as f:
json.dump(report, f, indent=2)
return report
def main():
if len(sys.argv) < 3:
print("使用方法: python process.py <chrome_profile_path> <output_dir>")
sys.exit(1)
analyze_chrome_history(sys.argv[1], sys.argv[2])
if __name__ == "__main__":
main()
参考文献
出力例
$ python hindsight.py -i /evidence/chrome-profile -o /analysis/hindsight_output
Hindsight v2024.01 - Chrome/Chromiumブラウザフォレンジック解析
================================================================
プロファイル: /evidence/chrome-profile (Chrome 120.0.6099.130)
OS: Windows 10
[+] Historyデータベースを解析中...
URLレコード: 12,456
ダウンロードレコード: 234
検索語句: 567
[+] Cookiesデータベースを解析中...
クッキーレコード: 8,923
暗号化クッキー: 6,712
[+] Webデータ(オートフィル)を解析中...
オートフィルエントリ: 1,234
クレジットカードエントリ: 2(暗号化)
[+] ログインデータを解析中...
保存された認証情報: 45(暗号化)
[+] ブックマークを解析中...
ブックマークエントリ: 189
--- ブラウジング履歴(最後の10エントリ) ---
タイムスタンプ(UTC) | URL | タイトル | 訪問回数
2024-01-15 14:32:05.123 | https://mail.corporate.com/inbox | 企業メール | 45
2024-01-15 14:33:12.456 | https://drive.google.com/file/d/1aBcDe... | Q4_Financial_Report.xlsx | 1
2024-01-15 14:35:44.789 | https://mega.nz/folder/xYz123 | MEGA - セキュアクラウド | 3
2024-01-15 14:36:01.234 | https://mega.nz/folder/xYz123#upload | MEGA - アップロード | 8
2024-01-15 14:42:15.567 | https://pastebin.com/raw/kL9mN2pQ | Pastebin(生データ) | 1
2024-01-15 15:01:33.890 | https://192.168.1.50:8443/admin | 管理パネル | 12
2024-01-15 15:15:22.111 | https://transfer.sh/upload | transfer.sh | 2
2024-01-15 15:30:45.222 | https://vpn-gateway.corporate.com | VPNログイン | 5
2024-01-15 16:00:00.333 | https://whatismyipaddress.com | 私のIPアドレス | 1
2024-01-15 16:05:12.444 | https://protonmail.com/inbox | ProtonMail | 3
--- ダウンロード(疑わしい) ---
タイムスタンプ(UTC) | ファイル名 | URLソース | サイズ
2024-01-15 14:33:15.000 | Q4_Financial_Report.xlsm | https://phish-domain.com/docs/report | 245 KB
2024-01-15 14:34:02.000 | update_client.exe | https://cdn.evil-updates.com/client.exe | 1.2 MB
--- クッキー(セッショントークン) ---
ドメイン | 名前 | 期限 | セキュア | HttpOnly
.corporate.com | SESSION_ID | 2024-01-16 14:32 | はい | はい
.mega.nz | session | セッション | はい | はい
.protonmail.com | AUTH-TOKEN | 2024-02-15 00:00 | はい | はい
レポートを保存しました: /analysis/hindsight_output/Hindsight_Report.xlsx