SQLite 数据库取证解析
面向 SQLite 数据库的取证式批量解析,指导使用 Eric Zimmerman 的 SQLECmd 根据 Map(.smap)规则识别数据库结构、执行预定义 SQL 并将结果导出为 CSV 或 JSON。支持扫描目录、按文件头 Hunt SQLite、指定/同步 Map、SHA-1 去重以及 BLOB 数据提取,适用于浏览器、即时通信、桌面应用和其他使用 SQLite 保存数据的软件。该 Skill 重点解决“不熟悉数据库表结构也能按规则快速提取关键记录”的问题,便于将历史、账号、消息、配置和应用行为数据转成统一结构继续分析。
在 AI 中使用此 Skill将本页链接复制给 AI,即可让 AI 获取完整 Skill 内容并按此执行
安全提示: 本站 Skill 均经 ChatGPT 最新模型扫描,未发现恶意脚本及危险指令、未检出已知恶意行为特征,但不保证绝对安全,使用即表示接受此风险
Skill 文件
版本 20260318 · bebcbcc3e17ed6797b65e748a7f539bc
SKILL.md
--- name: sqlecmd version: 1.0.0 description: Parse and extract data from SQLite databases using Eric Zimmerman's SQLECmd. Covers CLI flags, map-driven extraction, output formats (CSV/JSON), blob export, and map structure reference. metadata: tool-name: SQLECmd tool-vendor: Eric Zimmerman --- # SQLECmd Skill SQLECmd is Eric Zimmerman's command-line tool for parsing SQLite database files using map definitions. It identifies SQLite databases by file header, matches them to maps that define SQL queries and column mappings, and outputs structured CSV or JSON. Any SQLite database can be parsed as long as a map (.smap) exists for its schema. Forensic interpretation of SQLite data (browser history analysis, application activity reconstruction, etc.) belongs in a separate analysis skill. ## Command Syntax ``` SQLECmd.exe -f <file> --csv <dir> [other options] SQLECmd.exe -d <directory> --csv <dir> [other options] ``` Single-letter options use a single dash (`-`). Multi-character options use double dashes (`--`). ## Input (one required) | Flag | Description | |------|-------------| | `-f` | Single SQLite file to process | | `-d` | Directory to process containing SQLite files | ## Output Formats | Flag | Description | |------|-------------| | `--csv` | Directory to write CSV output | | `--json` | Directory to write JSON output | It's recommended to specify at least one output format to write results to a file. Forensic output can be very large and may consume the context window. CSV is the most common choice for analysis with Timeline Explorer or Excel. ## Options | Flag | Description | Default | |------|-------------|---------| | `--hunt` | Examine all files regardless of name; identify SQLite files by header | FALSE | | `--maps` | Path to map (.smap) files | `Maps` folder next to the executable | | `--sync` | Download latest maps from GitHub before processing. Requires network access. | FALSE | | `--dedupe` | Deduplicate files via SHA-1 | TRUE | | `--blobdir` | Directory to save extracted blob data to | | | `--noblob` | Disable blob extraction from query results | FALSE | | `--debug` | Show debug information | FALSE | | `--trace` | Show trace information | FALSE | ## Output Structure SQLECmd produces one CSV file per map query that matches the input. Output filenames follow the pattern `<CSVPrefix>_<BaseFileName>.csv` as defined in each map. Every output file includes a **SourceFile** column appended to the query results, identifying which SQLite database the row came from. CSV column names are defined by each map's SQL query aliases, not by the tool itself. Different databases produce different columns depending on their map definitions. ## Maps Maps (.smap files) are YAML definitions that tell SQLECmd how to identify and extract data from specific SQLite databases. Each map defines: | Field | Description | |-------|-------------| | **Description** | Human-readable description of the database | | **CSVPrefix** | Prefix for output CSV filenames | | **FileName** | Expected database filename (used for matching) | | **IdentifyQuery** | SQL query to confirm database identity | | **IdentifyValue** | Expected result of the identify query | | **Queries** | Array of SQL queries with column aliases defining CSV output | Maps are stored in the `Maps` directory (default: next to the executable). The `--hunt` flag bypasses filename matching and identifies SQLite files by their file header, allowing maps to match databases with renamed or unexpected filenames. Common map categories include browsers (Chrome, Firefox, Edge), messaging apps, Windows artifacts (Notifications, Activities/Timeline), and mobile databases. ## Workflow Examples ### Parse a single SQLite database to CSV ``` SQLECmd.exe -f "C:\Cases\Evidence\History" --csv "C:\Cases\Output" ``` ### Parse a directory of SQLite databases ``` SQLECmd.exe -d "C:\Cases\Evidence\AppData" --csv "C:\Cases\Output" ``` ### Hunt for all SQLite files in a directory ``` SQLECmd.exe -d "C:\Cases\Evidence" --csv "C:\Cases\Output" --hunt ``` ### Parse with blob extraction to a directory ``` SQLECmd.exe -d "C:\Cases\Evidence\AppData" --csv "C:\Cases\Output" --blobdir "C:\Cases\Output\Blobs" ``` ### Parse without blob extraction ``` SQLECmd.exe -d "C:\Cases\Evidence\AppData" --csv "C:\Cases\Output" --noblob ``` ### Parse from a mounted forensic image ``` SQLECmd.exe -d "E:\Users" --csv "C:\Cases\Output" --hunt ```
此文件不提供内嵌文本预览
请使用左侧文件行末尾的外链图标打开原始文件。
