Hindsight를 활용한 브라우저 포렌식 분석은(는) 무엇을 하나요?
개요
Hindsight는 Google Chrome 및 기타 Chromium 기반 브라우저(Microsoft Edge, Brave, Opera, Vivaldi)의 아티팩트를 파싱하기 위한 오픈소스 브라우저 포렌식 도구입니다. 여러 브라우저 데이터베이스 파일에서 데이터를 추출하고 상관 분석하여 통합된 웹 활동 타임라인을 생성합니다. Hindsight는 URL, 다운로드 기록, 캐시 기록, 북마크, 자동 완성 기록, 저장된 비밀번호, 브라우저 환경 설정, 확장 프로그램, HTTP 쿠키, Local Storage(HTML5 쿠키), 로그인 데이터, 세션/탭 정보를 파싱할 수 있습니다. 이 도구는 XLSX, JSON, SQLite 등 여러 출력 형식으로 시간순 타임라인을 생성하여, 조사관이 침해 대응, 내부자 위협 조사, 형사 사건에서 사용자 웹 활동을 재구성할 수 있도록 합니다.
사용 시기
- 브라우저 포렌식을 Hindsight로 분석해야 하는 보안 사고를 조사할 때
- 이 도메인에 대한 탐지 규칙 또는 위협 헌팅 쿼리를 구축할 때
- 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 Local Storage |
| 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
웹 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 Data (자동 완성) 파싱 중...
자동 완성 항목: 1,234
신용카드 항목: 2 (암호화됨)
[+] Login Data 파싱 중...
저장된 자격 증명: 45 (암호화됨)
[+] Bookmarks 파싱 중...
북마크 항목: 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 (raw) | 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