Communitygithub.com

Hindsightによるブラウザフォレンジック分析

ChromiumベースのブラウザデータベースをHindsightで解析し、Chrome、Edge、Brave、Opera、Vivaldiから閲覧履歴、ダウンロード、クッキー、キャッシュコンテンツ、オートフィルデータ、保存パスワード、拡張機能などを抽出・相関して統合タイムライン(XLSX、JSON、SQLite出力)を生成します。インシデント対応、内部脅威調査、刑事事件でユーザーのWeb活動を再構築する際に使用します。

Hindsightによるブラウザフォレンジック分析 とは?

Hindsightは、Google Chromeやその他のChromiumベースブラウザ(Microsoft Edge、Brave、Opera、Vivaldi)からフォレンジックアーティファクトを解析するオープンソースツールです。これは複数のブラウザデータベースファイルからデータを抽出・相関し、Webアクティビティの統合タイムラインを作成します。解析可能なアーティファクトには、URL履歴、ダウンロード履歴、キャッシュレコード、ブックマーク、オートフィルデータ、保存パスワード、ブラウザ拡張機能、HTTPクッキー、ローカルストレージ(HTML5クッキー)、ログインデータ、セッション/タブ情報が含まれます。出力形式はXLSX、JSON、SQLiteに対応しており、CSIRT(コンピュータセキュリティインシデント対応チーム)やデジタルフォレンジック調査官がインシデント対応、内部脅威調査、刑事事件でユーザーのWebアクティビティを再構築するために使用します。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-browser-forensics-with-hindsight

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

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

ドキュメント

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/

主要なアーティファクトファイル

ファイル内容
HistoryURL訪問、ダウンロード、キーワード検索
Cookiesドメイン、有効期限、値を含むHTTPクッキー
Web Dataオートフィルエントリ、保存済みクレジットカード
Login Data保存されたユーザー名/パスワード(暗号化済み)
BookmarksJSON形式のブックマークツリー
Preferencesブラウザ設定と拡張機能
Local Storage/ドメインごとのHTML5ローカルストレージ
Session Storage/ドメインごとのセッションストレージ
Network Action Predictor以前に入力されたURL
ShortcutsOmniboxのショートカットと予測
Top Sitesよく訪れるサイト

Hindsightの実行

コマンドライン

# Chromeプロファイルの基本解析
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

# JSON出力形式
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のWebインターフェースを起動
hindsight_gui.exe
# http://localhost:8080 にアクセス
# ブラウザプロファイルディレクトリをアップロードまたは指定
# 出力形式と解析オプションを設定
# レポートを生成してダウンロード

アーティファクト分析の詳細

URL履歴と訪問

-- Chrome Historyデータベースのスキーマ(主要テーブル)
-- urlsテーブル: id, url, title, visit_count, typed_count, last_visit_time
-- visitsテーブル: id, url, visit_time, from_visit, transition, segment_id

-- タイムスタンプはChrome/WebKit形式:1601-01-01からのマイクロ秒
-- 変換: datetime((visit_time/1000000)-11644473600, 'unixepoch')

ダウンロード履歴

-- downloadsテーブル: id, current_path, target_path, start_time, end_time,
--   received_bytes, total_bytes, state, danger_type, interrupt_reason,
--   url, referrer, tab_url, mime_type, original_mime_type

クッキー分析

-- cookiesテーブル: creation_utc, host_key, name, value, encrypted_value,
--   path, expires_utc, is_secure, is_httponly, last_access_utc,
--   has_expires, is_persistent, priority, samesite

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)

    # タイムスタンプ付きのURL訪問
    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

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-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,

analyzing-docker-container-forensics

Investigate compromised Docker containers by analyzing images, layers,

関連スキル