Analyzing Browser Forensics with Hindsight
Overview
Hindsight is an open-source browser forensics tool designed to parse artifacts from Google Chrome and other Chromium-based browsers (Microsoft Edge, Brave, Opera, Vivaldi). It extracts and correlates data from multiple browser database files to create a unified timeline of web activity. Hindsight can parse URLs, download history, cache records, bookmarks, autofill records, saved passwords, preferences, browser extensions, HTTP cookies, Local Storage (HTML5 cookies), login data, and session/tab information. The tool produces chronological timelines in multiple output formats (XLSX, JSON, SQLite) that enable investigators to reconstruct user web activity for incident response, insider threat investigations, and criminal cases.
Prerequisites
- Python 3.8+ with Hindsight installed (
pip install pyhindsight)
- Access to browser profile directories from forensic image
- Browser profile data (not encrypted with OS-level encryption)
- Timeline Explorer or spreadsheet application for analysis
Browser Profile Locations
| Browser |
Windows Profile Path |
| 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/ |
Key Artifact Files
| File |
Contents |
| History |
URL visits, downloads, keyword searches |
| Cookies |
HTTP cookies with domain, expiry, values |
| Web Data |
Autofill entries, saved credit cards |
| Login Data |
Saved usernames/passwords (encrypted) |
| Bookmarks |
JSON bookmark tree |
| Preferences |
Browser configuration and extensions |
| Local Storage/ |
HTML5 Local Storage per domain |
| Session Storage/ |
Session-specific storage per domain |
| Network Action Predictor |
Previously typed URLs |
| Shortcuts |
Omnibox shortcuts and predictions |
| Top Sites |
Frequently visited sites |
Running Hindsight
Command Line
# Basic analysis of a Chrome profile
hindsight.exe -i "C:\Evidence\Users\suspect\AppData\Local\Google\Chrome\User Data\Default" -o C:\Output\chrome_analysis
# Specify browser type
hindsight.exe -i "/path/to/profile" -o /output/analysis -b Chrome
# JSON output format
hindsight.exe -i "C:\Evidence\Chrome\Default" -o C:\Output\chrome --format jsonl
# With cache parsing (slower but more complete)
hindsight.exe -i "C:\Evidence\Chrome\Default" -o C:\Output\chrome --cache
Web UI
# Start Hindsight web interface
hindsight_gui.exe
# Navigate to http://localhost:8080
# Upload or point to browser profile directory
# Configure output format and analysis options
# Generate and download report
Artifact Analysis Details
URL History and Visits
-- Chrome History database schema (key tables)
-- urls table: id, url, title, visit_count, typed_count, last_visit_time
-- visits table: id, url, visit_time, from_visit, transition, segment_id
-- Timestamps are Chrome/WebKit format: microseconds since 1601-01-01
-- Convert: datetime((visit_time/1000000)-11644473600, 'unixepoch')
Download History
-- downloads table: 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
Cookie Analysis
-- cookies table: 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 Analysis Script
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)
# URL visits with timestamps
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()]
# Downloads
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()]
# Keyword searches
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("Usage: python process.py <chrome_profile_path> <output_dir>")
sys.exit(1)
analyze_chrome_history(sys.argv[1], sys.argv[2])
if __name__ == "__main__":
main()
References
1---2name: analyzing-browser-forensics-with-hindsight3description: Analyze Chromium-based browser artifacts using Hindsight to extract browsing history, downloads, cookies, cached content, autofill data, saved passwords, and browser extensions from Chrome, Edge, Brave, and Opera for forensic investigation.4domain: cybersecurity5subdomain: digital-forensics6tags: [browser-forensics, hindsight, chrome-forensics, chromium, edge, browsing-history, cookies, downloads, cache, web-artifacts]7version: "1.0"8author: mahipal9license: Apache-2.010---1112# Analyzing Browser Forensics with Hindsight1314## Overview1516Hindsight is an open-source browser forensics tool designed to parse artifacts from Google Chrome and other Chromium-based browsers (Microsoft Edge, Brave, Opera, Vivaldi). It extracts and correlates data from multiple browser database files to create a unified timeline of web activity. Hindsight can parse URLs, download history, cache records, bookmarks, autofill records, saved passwords, preferences, browser extensions, HTTP cookies, Local Storage (HTML5 cookies), login data, and session/tab information. The tool produces chronological timelines in multiple output formats (XLSX, JSON, SQLite) that enable investigators to reconstruct user web activity for incident response, insider threat investigations, and criminal cases.1718## Prerequisites1920- Python 3.8+ with Hindsight installed (`pip install pyhindsight`)21- Access to browser profile directories from forensic image22- Browser profile data (not encrypted with OS-level encryption)23- Timeline Explorer or spreadsheet application for analysis2425## Browser Profile Locations2627| Browser | Windows Profile Path |28|---------|---------------------|29| Chrome | %LOCALAPPDATA%\Google\Chrome\User Data\Default\ |30| Edge | %LOCALAPPDATA%\Microsoft\Edge\User Data\Default\ |31| Brave | %LOCALAPPDATA%\BraveSoftware\Brave-Browser\User Data\Default\ |32| Opera | %APPDATA%\Opera Software\Opera Stable\ |33| Vivaldi | %LOCALAPPDATA%\Vivaldi\User Data\Default\ |34| Chrome (macOS) | ~/Library/Application Support/Google/Chrome/Default/ |35| Chrome (Linux) | ~/.config/google-chrome/Default/ |3637## Key Artifact Files3839| File | Contents |40|------|----------|41| History | URL visits, downloads, keyword searches |42| Cookies | HTTP cookies with domain, expiry, values |43| Web Data | Autofill entries, saved credit cards |44| Login Data | Saved usernames/passwords (encrypted) |45| Bookmarks | JSON bookmark tree |46| Preferences | Browser configuration and extensions |47| Local Storage/ | HTML5 Local Storage per domain |48| Session Storage/ | Session-specific storage per domain |49| Network Action Predictor | Previously typed URLs |50| Shortcuts | Omnibox shortcuts and predictions |51| Top Sites | Frequently visited sites |5253## Running Hindsight5455### Command Line5657```bash58# Basic analysis of a Chrome profile59hindsight.exe -i "C:\Evidence\Users\suspect\AppData\Local\Google\Chrome\User Data\Default" -o C:\Output\chrome_analysis6061# Specify browser type62hindsight.exe -i "/path/to/profile" -o /output/analysis -b Chrome6364# JSON output format65hindsight.exe -i "C:\Evidence\Chrome\Default" -o C:\Output\chrome --format jsonl6667# With cache parsing (slower but more complete)68hindsight.exe -i "C:\Evidence\Chrome\Default" -o C:\Output\chrome --cache69```7071### Web UI7273```bash74# Start Hindsight web interface75hindsight_gui.exe76# Navigate to http://localhost:808077# Upload or point to browser profile directory78# Configure output format and analysis options79# Generate and download report80```8182## Artifact Analysis Details8384### URL History and Visits8586```sql87-- Chrome History database schema (key tables)88-- urls table: id, url, title, visit_count, typed_count, last_visit_time89-- visits table: id, url, visit_time, from_visit, transition, segment_id9091-- Timestamps are Chrome/WebKit format: microseconds since 1601-01-0192-- Convert: datetime((visit_time/1000000)-11644473600, 'unixepoch')93```9495### Download History9697```sql98-- downloads table: id, current_path, target_path, start_time, end_time,99-- received_bytes, total_bytes, state, danger_type, interrupt_reason,100-- url, referrer, tab_url, mime_type, original_mime_type101```102103### Cookie Analysis104105```sql106-- cookies table: creation_utc, host_key, name, value, encrypted_value,107-- path, expires_utc, is_secure, is_httponly, last_access_utc,108-- has_expires, is_persistent, priority, samesite109```110111## Python Analysis Script112113```python114import sqlite3115import os116import json117import sys118from datetime import datetime, timedelta119120121CHROME_EPOCH = datetime(1601, 1, 1)122123124def chrome_time_to_datetime(chrome_ts: int):125 """Convert Chrome timestamp to datetime."""126 if chrome_ts == 0:127 return None128 try:129 return CHROME_EPOCH + timedelta(microseconds=chrome_ts)130 except (OverflowError, OSError):131 return None132133134def analyze_chrome_history(profile_path: str, output_dir: str) -> dict:135 """Analyze Chrome History database for forensic evidence."""136 history_db = os.path.join(profile_path, "History")137 if not os.path.exists(history_db):138 return {"error": "History database not found"}139140 os.makedirs(output_dir, exist_ok=True)141 conn = sqlite3.connect(f"file:{history_db}?mode=ro", uri=True)142143 # URL visits with timestamps144 cursor = conn.cursor()145 cursor.execute("""146 SELECT u.url, u.title, v.visit_time, u.visit_count,147 v.transition & 0xFF as transition_type148 FROM visits v JOIN urls u ON v.url = u.id149 ORDER BY v.visit_time DESC LIMIT 5000150 """)151 visits = [{152 "url": r[0], "title": r[1],153 "visit_time": str(chrome_time_to_datetime(r[2])),154 "total_visits": r[3], "transition": r[4]155 } for r in cursor.fetchall()]156157 # Downloads158 cursor.execute("""159 SELECT target_path, tab_url, start_time, end_time,160 received_bytes, total_bytes, mime_type, state161 FROM downloads ORDER BY start_time DESC LIMIT 1000162 """)163 downloads = [{164 "path": r[0], "source_url": r[1],165 "start_time": str(chrome_time_to_datetime(r[2])),166 "end_time": str(chrome_time_to_datetime(r[3])),167 "received_bytes": r[4], "total_bytes": r[5],168 "mime_type": r[6], "state": r[7]169 } for r in cursor.fetchall()]170171 # Keyword searches172 cursor.execute("""173 SELECT k.term, u.url, k.url_id174 FROM keyword_search_terms k JOIN urls u ON k.url_id = u.id175 ORDER BY u.last_visit_time DESC LIMIT 1000176 """)177 searches = [{"term": r[0], "url": r[1]} for r in cursor.fetchall()]178179 conn.close()180181 report = {182 "analysis_timestamp": datetime.now().isoformat(),183 "profile_path": profile_path,184 "total_visits": len(visits),185 "total_downloads": len(downloads),186 "total_searches": len(searches),187 "visits": visits,188 "downloads": downloads,189 "searches": searches190 }191192 report_path = os.path.join(output_dir, "browser_forensics.json")193 with open(report_path, "w") as f:194 json.dump(report, f, indent=2)195196 return report197198199def main():200 if len(sys.argv) < 3:201 print("Usage: python process.py <chrome_profile_path> <output_dir>")202 sys.exit(1)203 analyze_chrome_history(sys.argv[1], sys.argv[2])204205206if __name__ == "__main__":207 main()208```209210## References211212- Hindsight GitHub: https://github.com/obsidianforensics/hindsight213- Chrome Forensics Guide: https://allenace.medium.com/hindsight-chrome-forensics-made-simple-425db99fa5ed214- Browser Forensics Tools: https://www.cyberforensicacademy.com/blog/browser-forensics-tools-how-to-extract-user-activity215- Chromium Source (History): https://source.chromium.org/chromium/chromium/src/+/main:components/history/