[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B8ZGW1VGZVR5YA454K0H0D":3,"skill-same:01M7B8ZGW1VGZVR5YA454K0H0D":103},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":13,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M7B8ZGW1VGZVR5YA454K0H0D","performing-sqlite-database-forensics",null,"Performs forensic analysis of SQLite databases by examining B-tree page structures, recovering deleted records from freelist pages and Write-Ahead Log (WAL) files, decoding encoded timestamps, and extracting evidence from browser history, messaging apps, and mobile device databases. Use when recovering deleted or unallocated data from a SQLite database during digital forensics or mobile\u002Fbrowser evidence analysis.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-sqlite-database-forensics\ndescription: Performs forensic analysis of SQLite databases by examining B-tree page\n  structures, recovering deleted records from freelist pages and Write-Ahead Log (WAL)\n  files, decoding encoded timestamps, and extracting evidence from browser history,\n  messaging apps, and mobile device databases. Use when recovering deleted or unallocated\n  data from a SQLite database during digital forensics or mobile\u002Fbrowser evidence\n  analysis.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags:\n- sqlite\n- database-forensics\n- freelist\n- wal\n- write-ahead-log\n- browser-history\n- mobile-forensics\n- deleted-records\n- b-tree\n- unallocated-space\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- RS.AN-03\n- DE.AE-02\n- RS.MA-01\nmitre_attack:\n- T1005\n- T1074\n- T1119\n- T1070\n- T1059\n---\n\n# Performing SQLite Database Forensics\n\n## Overview\n\nSQLite is the most widely deployed database engine in the world, used by virtually every mobile application, web browser, and many desktop applications to store user data. In digital forensics, SQLite databases are critical evidence sources containing browser history, messaging records, call logs, GPS locations, application preferences, and cached content. Forensic analysis goes beyond simple SQL queries to examine the internal B-tree page structures, freelist pages containing deleted records, Write-Ahead Log (WAL) files preserving transaction history, and unallocated space within database pages where recoverable data may persist after deletion.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing sqlite database forensics\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- DB Browser for SQLite (sqlitebrowser)\n- SQLite command-line tools (sqlite3)\n- Python 3.8+ with sqlite3 module\n- Belkasoft Evidence Center or Axiom (commercial)\n- Hex editor (HxD, 010 Editor) for manual page inspection\n- Understanding of B-tree data structures\n\n## SQLite Internal Structure\n\n### Database Header (First 100 Bytes)\n\n| Offset | Size | Description |\n|--------|------|-------------|\n| 0 | 16 | Magic string: \"SQLite format 3\\000\" |\n| 16 | 2 | Page size (512-65536 bytes) |\n| 18 | 1 | File format write version |\n| 19 | 1 | File format read version |\n| 24 | 4 | File change counter |\n| 28 | 4 | Database size in pages |\n| 32 | 4 | First freelist trunk page number |\n| 36 | 4 | Total freelist pages |\n| 52 | 4 | Text encoding (1=UTF-8, 2=UTF-16le, 3=UTF-16be) |\n| 96 | 4 | Version-valid-for number |\n\n### Page Types\n\n| Type | ID | Description |\n|------|----|-------------|\n| B-tree Interior | 0x05 | Internal table node |\n| B-tree Leaf | 0x0D | Table leaf page containing actual records |\n| Index Interior | 0x02 | Internal index node |\n| Index Leaf | 0x0A | Index leaf page |\n| Freelist Trunk | - | Tracks freed pages |\n| Freelist Leaf | - | Freed page with recoverable data |\n| Overflow | - | Continuation of large records |\n\n## Deleted Record Recovery\n\n### Method 1: Freelist Page Analysis\n\nWhen records are deleted, SQLite may place their pages on the freelist rather than overwriting them immediately.\n\n```python\nimport struct\nimport sqlite3\nimport os\n\n\ndef analyze_freelist(db_path: str) -> dict:\n    \"\"\"Analyze SQLite freelist to identify pages containing deleted data.\"\"\"\n    with open(db_path, \"rb\") as f:\n        # Read header\n        header = f.read(100)\n        page_size = struct.unpack(\">H\", header[16:18])[0]\n        if page_size == 1:\n            page_size = 65536\n        first_freelist_page = struct.unpack(\">I\", header[32:36])[0]\n        total_freelist_pages = struct.unpack(\">I\", header[36:40])[0]\n\n        freelist_info = {\n            \"page_size\": page_size,\n            \"first_freelist_page\": first_freelist_page,\n            \"total_freelist_pages\": total_freelist_pages,\n            \"trunk_pages\": [],\n            \"leaf_pages\": []\n        }\n\n        if first_freelist_page == 0:\n            return freelist_info\n\n        # Walk the freelist trunk chain\n        trunk_page = first_freelist_page\n        while trunk_page != 0:\n            offset = (trunk_page - 1) * page_size\n            f.seek(offset)\n            page_data = f.read(page_size)\n\n            next_trunk = struct.unpack(\">I\", page_data[0:4])[0]\n            leaf_count = struct.unpack(\">I\", page_data[4:8])[0]\n\n            leaves = []\n            for i in range(leaf_count):\n                leaf_page = struct.unpack(\">I\", page_data[8 + i * 4:12 + i * 4])[0]\n                leaves.append(leaf_page)\n\n            freelist_info[\"trunk_pages\"].append({\n                \"page_number\": trunk_page,\n                \"next_trunk\": next_trunk,\n                \"leaf_count\": leaf_count,\n                \"leaf_pages\": leaves\n            })\n            freelist_info[\"leaf_pages\"].extend(leaves)\n            trunk_page = next_trunk\n\n    return freelist_info\n\n\ndef extract_freelist_content(db_path: str, output_dir: str):\n    \"\"\"Extract raw content from freelist pages for analysis.\"\"\"\n    info = analyze_freelist(db_path)\n    os.makedirs(output_dir, exist_ok=True)\n\n    with open(db_path, \"rb\") as f:\n        page_size = info[\"page_size\"]\n        for page_num in info[\"leaf_pages\"]:\n            offset = (page_num - 1) * page_size\n            f.seek(offset)\n            page_data = f.read(page_size)\n            output_file = os.path.join(output_dir, f\"freelist_page_{page_num}.bin\")\n            with open(output_file, \"wb\") as out:\n                out.write(page_data)\n\n    return len(info[\"leaf_pages\"])\n```\n\n### Method 2: WAL (Write-Ahead Log) Analysis\n\nThe WAL file contains pending transactions that have not yet been checkpointed back to the main database.\n\n```python\ndef parse_wal_header(wal_path: str) -> dict:\n    \"\"\"Parse SQLite WAL file header and frame inventory.\"\"\"\n    with open(wal_path, \"rb\") as f:\n        header = f.read(32)\n        magic = struct.unpack(\">I\", header[0:4])[0]\n        file_format = struct.unpack(\">I\", header[4:8])[0]\n        page_size = struct.unpack(\">I\", header[8:12])[0]\n        checkpoint_seq = struct.unpack(\">I\", header[12:16])[0]\n        salt1 = struct.unpack(\">I\", header[16:20])[0]\n        salt2 = struct.unpack(\">I\", header[20:24])[0]\n\n        wal_info = {\n            \"magic\": hex(magic),\n            \"format\": file_format,\n            \"page_size\": page_size,\n            \"checkpoint_sequence\": checkpoint_seq,\n            \"frames\": []\n        }\n\n        # Parse frames (24-byte header + page_size data each)\n        frame_offset = 32\n        frame_num = 0\n        file_size = os.path.getsize(wal_path)\n\n        while frame_offset + 24 + page_size \u003C= file_size:\n            f.seek(frame_offset)\n            frame_header = f.read(24)\n            page_number = struct.unpack(\">I\", frame_header[0:4])[0]\n            db_size_after = struct.unpack(\">I\", frame_header[4:8])[0]\n\n            wal_info[\"frames\"].append({\n                \"frame_number\": frame_num,\n                \"page_number\": page_number,\n                \"db_size_pages\": db_size_after,\n                \"offset\": frame_offset\n            })\n            frame_offset += 24 + page_size\n            frame_num += 1\n\n    return wal_info\n```\n\n### Method 3: Unallocated Space Within Pages\n\nDeleted cells within active B-tree pages leave data in the unallocated region between the cell pointer array and the cell content area.\n\n```python\ndef analyze_unallocated_space(db_path: str, page_number: int) -> dict:\n    \"\"\"Analyze unallocated space within a specific B-tree page.\"\"\"\n    with open(db_path, \"rb\") as f:\n        header = f.read(100)\n        page_size = struct.unpack(\">H\", header[16:18])[0]\n        if page_size == 1:\n            page_size = 65536\n\n        offset = (page_number - 1) * page_size\n        f.seek(offset)\n        page_data = f.read(page_size)\n\n        # Parse page header (8 or 12 bytes depending on type)\n        page_type = page_data[0]\n        first_freeblock = struct.unpack(\">H\", page_data[1:3])[0]\n        cell_count = struct.unpack(\">H\", page_data[3:5])[0]\n        cell_content_offset = struct.unpack(\">H\", page_data[5:7])[0]\n        if cell_content_offset == 0:\n            cell_content_offset = 65536\n\n        header_size = 12 if page_type in (0x02, 0x05) else 8\n        cell_pointer_end = header_size + cell_count * 2\n\n        unallocated_start = cell_pointer_end\n        unallocated_end = cell_content_offset\n        unallocated_size = unallocated_end - unallocated_start\n\n        return {\n            \"page_number\": page_number,\n            \"page_type\": hex(page_type),\n            \"cell_count\": cell_count,\n            \"unallocated_start\": unallocated_start,\n            \"unallocated_end\": unallocated_end,\n            \"unallocated_size\": unallocated_size,\n            \"unallocated_data\": page_data[unallocated_start:unallocated_end].hex()\n        }\n```\n\n## Common Forensic Databases\n\n| Application | Database File | Key Tables |\n|------------|--------------|------------|\n| Chrome | History | urls, visits, downloads, keyword_search_terms |\n| Firefox | places.sqlite | moz_places, moz_historyvisits |\n| Safari | History.db | history_items, history_visits |\n| WhatsApp | msgstore.db | messages, chat_list |\n| Signal | signal.sqlite | sms, mms |\n| iMessage | sms.db | message, handle, chat |\n| Android SMS | mmssms.db | sms, mms, threads |\n| Skype | main.db | Messages, Conversations |\n\n## Timestamp Decoding\n\n```python\nfrom datetime import datetime, timedelta\n\ndef decode_chrome_timestamp(chrome_ts: int) -> datetime:\n    \"\"\"Convert Chrome\u002FWebKit timestamp to datetime (microseconds since 1601-01-01).\"\"\"\n    epoch_delta = 11644473600\n    return datetime.utcfromtimestamp((chrome_ts \u002F 1000000) - epoch_delta)\n\ndef decode_unix_timestamp(unix_ts: int) -> datetime:\n    \"\"\"Convert Unix timestamp to datetime.\"\"\"\n    return datetime.utcfromtimestamp(unix_ts)\n\ndef decode_mac_absolute_time(mac_ts: float) -> datetime:\n    \"\"\"Convert Mac Absolute Time (seconds since 2001-01-01).\"\"\"\n    mac_epoch = datetime(2001, 1, 1)\n    return mac_epoch + timedelta(seconds=mac_ts)\n\ndef decode_mozilla_timestamp(moz_ts: int) -> datetime:\n    \"\"\"Convert Mozilla PRTime (microseconds since Unix epoch).\"\"\"\n    return datetime.utcfromtimestamp(moz_ts \u002F 1000000)\n```\n\n## References\n\n- SQLite File Format: https:\u002F\u002Fwww.sqlite.org\u002Ffileformat2.html\n- Belkasoft SQLite Analysis: https:\u002F\u002Fbelkasoft.com\u002Fsqlite-analysis\n- Spyder Forensics SQLite Training: https:\u002F\u002Fwww.spyderforensics.com\u002Fsqlite-forensic-fundamentals-2025\u002F\n- Forensic Analysis of Damaged SQLite Databases: https:\u002F\u002Fwww.forensicfocus.com\u002Farticles\u002Fforensic-analysis-of-damaged-sqlite-databases\u002F\n\n## Example Output\n\n```text\n$ python3 sqlite_forensics.py --db \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory \\\n    --wal \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory-wal \\\n    --journal \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory-journal \\\n    --output \u002Fanalysis\u002Fsqlite_report\n\nSQLite Database Forensic Analyzer v2.0\n========================================\nDatabase:    \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory\nSize:        48.2 MB\nSQLite Ver:  3.39.5\nPage Size:   4096 bytes\nTotal Pages: 12,345\nEncoding:    UTF-8\n\n[+] Analyzing WAL (Write-Ahead Log)...\n    WAL file:       History-wal (2.1 MB)\n    WAL frames:     512\n    Checkpointed:   No (contains uncommitted data)\n    Recoverable rows from WAL: 234\n\n[+] Analyzing journal file...\n    Journal file:   History-journal (0 bytes - rolled back)\n\n[+] Scanning for deleted records (freelist pages)...\n    Freelist pages:     456\n    Deleted records recovered: 1,892\n\n[+] Analyzing table: urls\n    Active rows:     12,456\n    Deleted rows:    1,234 (recovered from freelist)\n    WAL-only rows:   89\n\n--- Recovered Deleted URLs (Last 10) ---\nRow ID | URL                                              | Title                    | Visit Count | Last Visit (UTC)\n-------|--------------------------------------------------|--------------------------|-------------|---------------------\n89234  | https:\u002F\u002Fmega.nz\u002Ffolder\u002FxYz123#key=AbCdEf        | MEGA                     | 5           | 2024-01-16 03:20:00\n89235  | https:\u002F\u002Ftransfer.sh\u002Fabc123\u002Fdata.7z               | transfer.sh              | 1           | 2024-01-16 03:25:00\n89240  | https:\u002F\u002Ftemp-mail.org\u002Fen\u002F                        | Temp Mail                | 3           | 2024-01-15 13:00:00\n89241  | https:\u002F\u002Fbrowserleaks.com\u002Fip                      | IP Leak Test             | 1           | 2024-01-15 12:55:00\n89245  | https:\u002F\u002Fwww.virustotal.com\u002Fgui\u002Ffile\u002Fa1b2c3...    | VirusTotal               | 2           | 2024-01-15 14:30:00\n89250  | https:\u002F\u002Fgithub.com\u002Fgentilkiwi\u002Fmimikatz\u002Freleases  | Mimikatz Releases        | 1           | 2024-01-15 16:00:00\n89260  | https:\u002F\u002Fraw.githubusercontent.com\u002F...\u002Fpayload.ps1| GitHub Raw               | 1           | 2024-01-15 14:34:00\n89270  | https:\u002F\u002Fpastebin.com\u002Fedit\u002FkL9mN2pQ               | Pastebin - Edit          | 2           | 2024-01-15 14:42:00\n89280  | https:\u002F\u002Fduckduckgo.com\u002F?q=clear+browser+history  | DuckDuckGo               | 1           | 2024-01-17 22:00:00\n89285  | https:\u002F\u002Fduckduckgo.com\u002F?q=anti+forensics+tools   | DuckDuckGo               | 1           | 2024-01-17 22:05:00\n\n[+] Analyzing table: downloads\n    Active rows:     234\n    Deleted rows:    12 (recovered)\n\n--- Recovered Deleted Downloads ---\nRow ID | Filename               | URL                                    | Size      | Start Time (UTC)\n-------|------------------------|----------------------------------------|-----------|---------------------\n5012   | payload.ps1            | https:\u002F\u002Fraw.githubusercontent.com\u002F...  | 4,096     | 2024-01-15 14:34:00\n5015   | mimikatz_trunk.zip     | https:\u002F\u002Fgithub.com\u002F...\u002Freleases\u002F...    | 1,892,352 | 2024-01-15 16:00:00\n5018   | netscan_portable.zip   | https:\u002F\u002Fwww.softperfect.com\u002F...        | 5,242,880 | 2024-01-15 15:05:00\n\n[+] Slack space analysis...\n    Pages with slack space data: 234\n    Partial strings recovered:   67 fragments\n\nSummary:\n  Total records analyzed:  14,578 (active) + 3,126 (deleted\u002FWAL)\n  Evidence-relevant URLs:  23 (flagged)\n  Deleted downloads:       12 (3 tool-related)\n  Anti-forensics evidence: Browser history deletion detected\n  Report: \u002Fanalysis\u002Fsqlite_report\u002Fsqlite_forensics.json\n  Recovered DB: \u002Fanalysis\u002Fsqlite_report\u002FHistory_recovered.db\n```\n","# Performing SQLite Database Forensics\n\n## Overview\n\nSQLite is the most widely deployed database engine in the world, used by virtually every mobile application, web browser, and many desktop applications to store user data. In digital forensics, SQLite databases are critical evidence sources containing browser history, messaging records, call logs, GPS locations, application preferences, and cached content. Forensic analysis goes beyond simple SQL queries to examine the internal B-tree page structures, freelist pages containing deleted records, Write-Ahead Log (WAL) files preserving transaction history, and unallocated space within database pages where recoverable data may persist after deletion.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing sqlite database forensics\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- DB Browser for SQLite (sqlitebrowser)\n- SQLite command-line tools (sqlite3)\n- Python 3.8+ with sqlite3 module\n- Belkasoft Evidence Center or Axiom (commercial)\n- Hex editor (HxD, 010 Editor) for manual page inspection\n- Understanding of B-tree data structures\n\n## SQLite Internal Structure\n\n### Database Header (First 100 Bytes)\n\n| Offset | Size | Description |\n|--------|------|-------------|\n| 0 | 16 | Magic string: \"SQLite format 3\\000\" |\n| 16 | 2 | Page size (512-65536 bytes) |\n| 18 | 1 | File format write version |\n| 19 | 1 | File format read version |\n| 24 | 4 | File change counter |\n| 28 | 4 | Database size in pages |\n| 32 | 4 | First freelist trunk page number |\n| 36 | 4 | Total freelist pages |\n| 52 | 4 | Text encoding (1=UTF-8, 2=UTF-16le, 3=UTF-16be) |\n| 96 | 4 | Version-valid-for number |\n\n### Page Types\n\n| Type | ID | Description |\n|------|----|-------------|\n| B-tree Interior | 0x05 | Internal table node |\n| B-tree Leaf | 0x0D | Table leaf page containing actual records |\n| Index Interior | 0x02 | Internal index node |\n| Index Leaf | 0x0A | Index leaf page |\n| Freelist Trunk | - | Tracks freed pages |\n| Freelist Leaf | - | Freed page with recoverable data |\n| Overflow | - | Continuation of large records |\n\n## Deleted Record Recovery\n\n### Method 1: Freelist Page Analysis\n\nWhen records are deleted, SQLite may place their pages on the freelist rather than overwriting them immediately.\n\n```python\nimport struct\nimport sqlite3\nimport os\n\n\ndef analyze_freelist(db_path: str) -> dict:\n    \"\"\"Analyze SQLite freelist to identify pages containing deleted data.\"\"\"\n    with open(db_path, \"rb\") as f:\n        # Read header\n        header = f.read(100)\n        page_size = struct.unpack(\">H\", header[16:18])[0]\n        if page_size == 1:\n            page_size = 65536\n        first_freelist_page = struct.unpack(\">I\", header[32:36])[0]\n        total_freelist_pages = struct.unpack(\">I\", header[36:40])[0]\n\n        freelist_info = {\n            \"page_size\": page_size,\n            \"first_freelist_page\": first_freelist_page,\n            \"total_freelist_pages\": total_freelist_pages,\n            \"trunk_pages\": [],\n            \"leaf_pages\": []\n        }\n\n        if first_freelist_page == 0:\n            return freelist_info\n\n        # Walk the freelist trunk chain\n        trunk_page = first_freelist_page\n        while trunk_page != 0:\n            offset = (trunk_page - 1) * page_size\n            f.seek(offset)\n            page_data = f.read(page_size)\n\n            next_trunk = struct.unpack(\">I\", page_data[0:4])[0]\n            leaf_count = struct.unpack(\">I\", page_data[4:8])[0]\n\n            leaves = []\n            for i in range(leaf_count):\n                leaf_page = struct.unpack(\">I\", page_data[8 + i * 4:12 + i * 4])[0]\n                leaves.append(leaf_page)\n\n            freelist_info[\"trunk_pages\"].append({\n                \"page_number\": trunk_page,\n                \"next_trunk\": next_trunk,\n                \"leaf_count\": leaf_count,\n                \"leaf_pages\": leaves\n            })\n            freelist_info[\"leaf_pages\"].extend(leaves)\n            trunk_page = next_trunk\n\n    return freelist_info\n\n\ndef extract_freelist_content(db_path: str, output_dir: str):\n    \"\"\"Extract raw content from freelist pages for analysis.\"\"\"\n    info = analyze_freelist(db_path)\n    os.makedirs(output_dir, exist_ok=True)\n\n    with open(db_path, \"rb\") as f:\n        page_size = info[\"page_size\"]\n        for page_num in info[\"leaf_pages\"]:\n            offset = (page_num - 1) * page_size\n            f.seek(offset)\n            page_data = f.read(page_size)\n            output_file = os.path.join(output_dir, f\"freelist_page_{page_num}.bin\")\n            with open(output_file, \"wb\") as out:\n                out.write(page_data)\n\n    return len(info[\"leaf_pages\"])\n```\n\n### Method 2: WAL (Write-Ahead Log) Analysis\n\nThe WAL file contains pending transactions that have not yet been checkpointed back to the main database.\n\n```python\ndef parse_wal_header(wal_path: str) -> dict:\n    \"\"\"Parse SQLite WAL file header and frame inventory.\"\"\"\n    with open(wal_path, \"rb\") as f:\n        header = f.read(32)\n        magic = struct.unpack(\">I\", header[0:4])[0]\n        file_format = struct.unpack(\">I\", header[4:8])[0]\n        page_size = struct.unpack(\">I\", header[8:12])[0]\n        checkpoint_seq = struct.unpack(\">I\", header[12:16])[0]\n        salt1 = struct.unpack(\">I\", header[16:20])[0]\n        salt2 = struct.unpack(\">I\", header[20:24])[0]\n\n        wal_info = {\n            \"magic\": hex(magic),\n            \"format\": file_format,\n            \"page_size\": page_size,\n            \"checkpoint_sequence\": checkpoint_seq,\n            \"frames\": []\n        }\n\n        # Parse frames (24-byte header + page_size data each)\n        frame_offset = 32\n        frame_num = 0\n        file_size = os.path.getsize(wal_path)\n\n        while frame_offset + 24 + page_size \u003C= file_size:\n            f.seek(frame_offset)\n            frame_header = f.read(24)\n            page_number = struct.unpack(\">I\", frame_header[0:4])[0]\n            db_size_after = struct.unpack(\">I\", frame_header[4:8])[0]\n\n            wal_info[\"frames\"].append({\n                \"frame_number\": frame_num,\n                \"page_number\": page_number,\n                \"db_size_pages\": db_size_after,\n                \"offset\": frame_offset\n            })\n            frame_offset += 24 + page_size\n            frame_num += 1\n\n    return wal_info\n```\n\n### Method 3: Unallocated Space Within Pages\n\nDeleted cells within active B-tree pages leave data in the unallocated region between the cell pointer array and the cell content area.\n\n```python\ndef analyze_unallocated_space(db_path: str, page_number: int) -> dict:\n    \"\"\"Analyze unallocated space within a specific B-tree page.\"\"\"\n    with open(db_path, \"rb\") as f:\n        header = f.read(100)\n        page_size = struct.unpack(\">H\", header[16:18])[0]\n        if page_size == 1:\n            page_size = 65536\n\n        offset = (page_number - 1) * page_size\n        f.seek(offset)\n        page_data = f.read(page_size)\n\n        # Parse page header (8 or 12 bytes depending on type)\n        page_type = page_data[0]\n        first_freeblock = struct.unpack(\">H\", page_data[1:3])[0]\n        cell_count = struct.unpack(\">H\", page_data[3:5])[0]\n        cell_content_offset = struct.unpack(\">H\", page_data[5:7])[0]\n        if cell_content_offset == 0:\n            cell_content_offset = 65536\n\n        header_size = 12 if page_type in (0x02, 0x05) else 8\n        cell_pointer_end = header_size + cell_count * 2\n\n        unallocated_start = cell_pointer_end\n        unallocated_end = cell_content_offset\n        unallocated_size = unallocated_end - unallocated_start\n\n        return {\n            \"page_number\": page_number,\n            \"page_type\": hex(page_type),\n            \"cell_count\": cell_count,\n            \"unallocated_start\": unallocated_start,\n            \"unallocated_end\": unallocated_end,\n            \"unallocated_size\": unallocated_size,\n            \"unallocated_data\": page_data[unallocated_start:unallocated_end].hex()\n        }\n```\n\n## Common Forensic Databases\n\n| Application | Database File | Key Tables |\n|------------|--------------|------------|\n| Chrome | History | urls, visits, downloads, keyword_search_terms |\n| Firefox | places.sqlite | moz_places, moz_historyvisits |\n| Safari | History.db | history_items, history_visits |\n| WhatsApp | msgstore.db | messages, chat_list |\n| Signal | signal.sqlite | sms, mms |\n| iMessage | sms.db | message, handle, chat |\n| Android SMS | mmssms.db | sms, mms, threads |\n| Skype | main.db | Messages, Conversations |\n\n## Timestamp Decoding\n\n```python\nfrom datetime import datetime, timedelta\n\ndef decode_chrome_timestamp(chrome_ts: int) -> datetime:\n    \"\"\"Convert Chrome\u002FWebKit timestamp to datetime (microseconds since 1601-01-01).\"\"\"\n    epoch_delta = 11644473600\n    return datetime.utcfromtimestamp((chrome_ts \u002F 1000000) - epoch_delta)\n\ndef decode_unix_timestamp(unix_ts: int) -> datetime:\n    \"\"\"Convert Unix timestamp to datetime.\"\"\"\n    return datetime.utcfromtimestamp(unix_ts)\n\ndef decode_mac_absolute_time(mac_ts: float) -> datetime:\n    \"\"\"Convert Mac Absolute Time (seconds since 2001-01-01).\"\"\"\n    mac_epoch = datetime(2001, 1, 1)\n    return mac_epoch + timedelta(seconds=mac_ts)\n\ndef decode_mozilla_timestamp(moz_ts: int) -> datetime:\n    \"\"\"Convert Mozilla PRTime (microseconds since Unix epoch).\"\"\"\n    return datetime.utcfromtimestamp(moz_ts \u002F 1000000)\n```\n\n## References\n\n- SQLite File Format: https:\u002F\u002Fwww.sqlite.org\u002Ffileformat2.html\n- Belkasoft SQLite Analysis: https:\u002F\u002Fbelkasoft.com\u002Fsqlite-analysis\n- Spyder Forensics SQLite Training: https:\u002F\u002Fwww.spyderforensics.com\u002Fsqlite-forensic-fundamentals-2025\u002F\n- Forensic Analysis of Damaged SQLite Databases: https:\u002F\u002Fwww.forensicfocus.com\u002Farticles\u002Fforensic-analysis-of-damaged-sqlite-databases\u002F\n\n## Example Output\n\n```text\n$ python3 sqlite_forensics.py --db \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory \\\n    --wal \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory-wal \\\n    --journal \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory-journal \\\n    --output \u002Fanalysis\u002Fsqlite_report\n\nSQLite Database Forensic Analyzer v2.0\n========================================\nDatabase:    \u002Fevidence\u002Fchrome\u002FDefault\u002FHistory\nSize:        48.2 MB\nSQLite Ver:  3.39.5\nPage Size:   4096 bytes\nTotal Pages: 12,345\nEncoding:    UTF-8\n\n[+] Analyzing WAL (Write-Ahead Log)...\n    WAL file:       History-wal (2.1 MB)\n    WAL frames:     512\n    Checkpointed:   No (contains uncommitted data)\n    Recoverable rows from WAL: 234\n\n[+] Analyzing journal file...\n    Journal file:   History-journal (0 bytes - rolled back)\n\n[+] Scanning for deleted records (freelist pages)...\n    Freelist pages:     456\n    Deleted records recovered: 1,892\n\n[+] Analyzing table: urls\n    Active rows:     12,456\n    Deleted rows:    1,234 (recovered from freelist)\n    WAL-only rows:   89\n\n--- Recovered Deleted URLs (Last 10) ---\nRow ID | URL                                              | Title                    | Visit Count | Last Visit (UTC)\n-------|--------------------------------------------------|--------------------------|-------------|---------------------\n89234  | https:\u002F\u002Fmega.nz\u002Ffolder\u002FxYz123#key=AbCdEf        | MEGA                     | 5           | 2024-01-16 03:20:00\n89235  | https:\u002F\u002Ftransfer.sh\u002Fabc123\u002Fdata.7z               | transfer.sh              | 1           | 2024-01-16 03:25:00\n89240  | https:\u002F\u002Ftemp-mail.org\u002Fen\u002F                        | Temp Mail                | 3           | 2024-01-15 13:00:00\n89241  | https:\u002F\u002Fbrowserleaks.com\u002Fip                      | IP Leak Test             | 1           | 2024-01-15 12:55:00\n89245  | https:\u002F\u002Fwww.virustotal.com\u002Fgui\u002Ffile\u002Fa1b2c3...    | VirusTotal               | 2           | 2024-01-15 14:30:00\n89250  | https:\u002F\u002Fgithub.com\u002Fgentilkiwi\u002Fmimikatz\u002Freleases  | Mimikatz Releases        | 1           | 2024-01-15 16:00:00\n89260  | https:\u002F\u002Fraw.githubusercontent.com\u002F...\u002Fpayload.ps1| GitHub Raw               | 1           | 2024-01-15 14:34:00\n89270  | https:\u002F\u002Fpastebin.com\u002Fedit\u002FkL9mN2pQ               | Pastebin - Edit          | 2           | 2024-01-15 14:42:00\n89280  | https:\u002F\u002Fduckduckgo.com\u002F?q=clear+browser+history  | DuckDuckGo               | 1           | 2024-01-17 22:00:00\n89285  | https:\u002F\u002Fduckduckgo.com\u002F?q=anti+forensics+tools   | DuckDuckGo               | 1           | 2024-01-17 22:05:00\n\n[+] Analyzing table: downloads\n    Active rows:     234\n    Deleted rows:    12 (recovered)\n\n--- Recovered Deleted Downloads ---\nRow ID | Filename               | URL                                    | Size      | Start Time (UTC)\n-------|------------------------|----------------------------------------|-----------|---------------------\n5012   | payload.ps1            | https:\u002F\u002Fraw.githubusercontent.com\u002F...  | 4,096     | 2024-01-15 14:34:00\n5015   | mimikatz_trunk.zip     | https:\u002F\u002Fgithub.com\u002F...\u002Freleases\u002F...    | 1,892,352 | 2024-01-15 16:00:00\n5018   | netscan_portable.zip   | https:\u002F\u002Fwww.softperfect.com\u002F...        | 5,242,880 | 2024-01-15 15:05:00\n\n[+] Slack space analysis...\n    Pages with slack space data: 234\n    Partial strings recovered:   67 fragments\n\nSummary:\n  Total records analyzed:  14,578 (active) + 3,126 (deleted\u002FWAL)\n  Evidence-relevant URLs:  23 (flagged)\n  Deleted downloads:       12 (3 tool-related)\n  Anti-forensics evidence: Browser history deletion detected\n  Report: \u002Fanalysis\u002Fsqlite_report\u002Fsqlite_forensics.json\n  Recovered DB: \u002Fanalysis\u002Fsqlite_report\u002FHistory_recovered.db\n```\n",{"name":5,"tags":24,"author":35,"domain":36,"license":14,"version":37,"nist_csf":38,"subdomain":42,"description":7,"mitre_attack":43},[25,26,27,28,29,30,31,32,33,34],"sqlite","database-forensics","freelist","wal","write-ahead-log","browser-history","mobile-forensics","deleted-records","b-tree","unallocated-space","mahipal","cybersecurity","1.0",[39,40,41],"RS.AN-03","DE.AE-02","RS.MA-01","digital-forensics",[44,45,46,47,48],"T1005","T1074","T1119","T1070","T1059","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill performing-sqlite-database-forensics",{"tool":61,"command":62},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill performing-sqlite-database-forensics",{"tool":64,"command":65},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill performing-sqlite-database-forensics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002FSKILL.md",true,[69,75,79,85,89,93,99],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"assets\u002Ftemplate.md","ASSET","资产文件",613,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002Fassets\u002Ftemplate.md",{"path":76,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fapi-reference.md","REFERENCE","参考文档",1939,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002Freferences\u002Fapi-reference.md",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fstandards.md",967,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002Freferences\u002Fstandards.md",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fworkflows.md",894,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002Freferences\u002Fworkflows.md",{"path":94,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"scripts\u002Fagent.py","SCRIPT","脚本",7901,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002Fscripts\u002Fagent.py",{"path":100,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":101,"sourceHtmlUrl":102},"scripts\u002Fprocess.py",7234,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fperforming-sqlite-database-forensics\u002Fscripts\u002Fprocess.py",[104,112,119,126,133,140],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]