| name | analyzing-browser-forensics-with-hindsight |
| description | 使用 Hindsight 分析基于 Chromium 的浏览器痕迹,从 Chrome、Edge、Brave 和 Opera 中提取浏览历史、下载记录、Cookie、缓存内容、自动填充数据、已保存密码和浏览器扩展,用于取证调查。 |
| domain | cybersecurity |
| subdomain | digital-forensics |
| tags | ["browser-forensics","hindsight","chrome-forensics","chromium","edge","browsing-history","cookies","downloads","cache","web-artifacts"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
使用 Hindsight 分析浏览器取证
概述
Hindsight 是一款开源浏览器取证(Browser Forensics)工具,专为解析 Google Chrome 和其他基于 Chromium 的浏览器(Microsoft Edge、Brave、Opera、Vivaldi)的痕迹而设计。它从多个浏览器数据库文件中提取和关联数据,创建统一的网络活动时间线。Hindsight 可以解析 URL、下载历史、缓存记录、书签、自动填充记录、已保存密码、浏览器偏好设置、浏览器扩展、HTTP Cookie、本地存储(HTML5 Cookie)、登录数据以及会话/标签信息。该工具以多种输出格式(XLSX、JSON、SQLite)生成按时间顺序排列的时间线,使调查人员能够重建用户网络活动,适用于事件响应(Incident Response)、内部威胁调查和刑事案件。
前置条件
- Python 3.8+ 并安装 Hindsight(
pip install pyhindsight)
- 可访问取证镜像中的浏览器配置文件目录
- 浏览器配置文件数据(未使用操作系统级加密)
- 用于分析的 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 Cookie |
| Web Data | 自动填充条目、已保存的信用卡 |
| Login Data | 已保存的用户名/密码(已加密) |
| Bookmarks | JSON 格式的书签树 |
| Preferences | 浏览器配置和扩展 |
| Local Storage/ | 每个域名的 HTML5 本地存储 |
| Session Storage/ | 每个域名的会话专属存储 |
| Network Action Predictor | 之前输入过的 URL |
| Shortcuts | 地址栏快捷方式和预测 |
| 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 界面
hindsight_gui.exe
痕迹分析详情
URL 历史与访问记录
下载历史
Cookie 分析
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):
"""Convert Chrome timestamp to 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:
"""Analyze Chrome History database for forensic evidence."""
history_db = os.path.join(profile_path, "History")
if not os.path.exists(history_db):
return {"error": "History database not found"}
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[], : r[],
: (chrome_time_to_datetime(r[])),
: r[], : r[]
} r cursor.fetchall()]
cursor.execute()
downloads = [{
: r[], : r[],
: (chrome_time_to_datetime(r[])),
: (chrome_time_to_datetime(r[])),
: r[], : r[],
: r[], : r[]
} r cursor.fetchall()]
cursor.execute()
searches = [{: r[], : r[]} r cursor.fetchall()]
conn.close()
report = {
: datetime.now().isoformat(),
: profile_path,
: (visits),
: (downloads),
: (searches),
: visits,
: downloads,
: searches
}
report_path = os.path.join(output_dir, )
(report_path, ) f:
json.dump(report, f, indent=)
report
():
(sys.argv) < :
()
sys.exit()
analyze_chrome_history(sys.argv[], sys.argv[])
__name__ == :
main()
参考资料