Article
Browser Forensics: Dựng Lại Hoạt Động Người Dùng
Khai thác Chrome, Firefox, Edge artifact — history, downloads, cookies, cached credentials — để xác định người dùng đã làm gì và khi nào.
Trình duyệt là một trong những nguồn artifact phong phú nhất trong điều tra nội bộ và forensic. Từ lịch sử tìm kiếm đến phiên đăng nhập đã lưu, dữ liệu trình duyệt thường cung cấp timeline rõ ràng về hành động của người dùng trước, trong, và sau một sự cố.
Vị trí lưu trữ artifact
Chrome / Chromium-based (Edge, Brave, Opera)
%LOCALAPPDATA%\Google\Chrome\User Data\Default\
%LOCALAPPDATA%\Microsoft\Edge\User Data\Default\
Files quan trọng:
| File | Nội dung |
|---|---|
History | URL, visit count, timestamps (SQLite) |
Downloads | Download history, đường dẫn lưu (SQLite) |
Cookies | Cookie data (SQLite) |
Login Data | Saved credentials (SQLite, AES encrypted) |
Web Data | Autofill data, credit cards (SQLite) |
Bookmarks | Bookmarks (JSON) |
Sessions/ | Session restore data |
Cache/ | Cached web content |
Firefox
%APPDATA%\Mozilla\Firefox\Profiles\<profile_id>.default-release\
| File | Nội dung |
|---|---|
places.sqlite | History và bookmarks |
downloads.sqlite (cũ) | Downloads (nay trong places.sqlite) |
cookies.sqlite | Cookies |
logins.json | Saved credentials (encrypted) |
key4.db | Master key cho logins |
formhistory.sqlite | Form autofill |
Đọc trực tiếp SQLite
Hầu hết dữ liệu trình duyệt lưu trong SQLite. Trình duyệt cần đóng (hoặc copy file trước) khi đọc.
# Copy file trước khi phân tích (tránh lock)
cp History /tmp/chrome_history.db
# Mở với sqlite3
sqlite3 /tmp/chrome_history.db
# Xem schema
.tables
.schema urls
Chrome History
-- Toàn bộ URL đã visit
SELECT url, title, visit_count,
datetime(last_visit_time/1000000-11644473600, 'unixepoch') AS last_visit
FROM urls
ORDER BY last_visit_time DESC;
-- URL visit trong khoảng thời gian
SELECT u.url, u.title,
datetime(v.visit_time/1000000-11644473600, 'unixepoch') AS visited_at
FROM visits v
JOIN urls u ON v.url = u.id
WHERE v.visit_time > (1736000000 + 11644473600) * 1000000 -- Unix timestamp -> Chrome timestamp
ORDER BY v.visit_time DESC;
Lưu ý về timestamp Chrome: Chrome dùng microseconds từ 01/01/1601. Công thức convert: (chrome_time / 1000000) - 11644473600 → Unix timestamp.
Chrome Downloads
SELECT target_path,
tab_url,
total_bytes,
datetime(start_time/1000000-11644473600, 'unixepoch') AS download_start,
state -- 1=complete, 2=cancelled, 4=interrupted
FROM downloads
ORDER BY start_time DESC;
Download history lưu cả file đã bị xóa sau khi download. Đây là bằng chứng mạnh trong điều tra data exfiltration hoặc malware download.
Firefox Places
-- History từ Firefox
SELECT p.url, p.title, p.visit_count,
datetime(h.visit_date/1000000, 'unixepoch') AS visited_at
FROM moz_places p
JOIN moz_historyvisits h ON h.place_id = p.id
ORDER BY h.visit_date DESC;
-- Download history
SELECT p.url,
a.content AS save_path,
datetime(a.dateAdded/1000000, 'unixepoch') AS downloaded_at
FROM moz_annos a
JOIN moz_places p ON p.id = a.place_id
WHERE a.anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = 'downloads/destinationFileName');
Công cụ tự động
# Hindsight — Chrome/Chromium forensics
hindsight.py -i "C:\Users\username\AppData\Local\Google\Chrome\User Data" -o report
# Browser History Viewer (GUI, Windows)
# BrowsingHistoryView — Nirsoft, đọc nhiều browser cùng lúc
# DB Browser for SQLite — GUI để query thủ công
Cache Analysis
Cache chứa nội dung web đã được tải — images, HTML, JS, PDF. Đây là nguồn valuable khi cần biết nội dung cụ thể của trang đã truy cập.
# Chrome cache format
# Tools: ChromeCacheView (Nirsoft), chrome-cache-dump
# Firefox cache
# about:cache trong Firefox để xem nếu live
# Tools: MozillaCacheView
Saved Credentials
Chrome Login Data
Credentials được encrypt bằng Windows DPAPI (Data Protection API) — liên kết với user session. Để decrypt cần:
- Chạy với context của user đó
- Hoặc extract và dùng DPAPI decryption với user master key
# SharpChromium — extract và decrypt Chrome credentials
# Cần chạy với context của user
SharpChromium.exe logins
# Hoặc manual với dpapick / mimikatz dpapi module
Firefox Credentials
Firefox dùng NSS (Network Security Services) để encrypt logins.json. Cần key4.db và master password (nếu được set).
# firepwd.py — decrypt Firefox saved passwords
python firepwd.py -d C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\xxx\
Cookies và Session Tokens
Cookies quan trọng trong điều tra vì chúng có thể chứa session token đang active — attacker có thể steal cookie để bypass MFA (Pass-the-Cookie).
-- Chrome cookies
SELECT host_key, name, value,
datetime(expires_utc/1000000-11644473600, 'unixepoch') AS expires,
is_secure, is_httponly
FROM cookies
WHERE host_key LIKE '%.company.com'
ORDER BY last_access_utc DESC;
Tìm session cookie (thường có session, auth, token trong tên) từ các dịch vụ nội bộ được truy cập gần đây.
Recovery Artifact đã xóa
SQLite giữ “free pages” sau khi record bị xóa — cho đến khi database được VACUUM. Dữ liệu trong free pages có thể recover.
# Lazagne — recover credentials từ nhiều nguồn
python lazagne.py browsers
# SQLite Forensic Explorer — GUI recovery tool
# Foremost / PhotoRec — file carving cho SQLite databases từ disk image
Lưu ý về Private/Incognito mode
Private browsing không ghi history vào disk trong session. Tuy nhiên:
- DNS cache vẫn được ghi
- Crash recovery files có thể lưu tạm
- Memory forensics có thể recover URL từ RAM
- Một số security software log ở tầng network
Nếu user dùng incognito trước khi incident, kết hợp với DNS cache (ipconfig /displaydns) và proxy/firewall logs để dựng lại timeline.