Langsung ke konten
Skillpedia
Database35k · #8309

performing-sqlite-database-forensics

Fungsinya

Tool ini membantu menyelidiki database SQLite, yang banyak digunakan aplikasi untuk menyimpan informasi. Tool ini mencari data yang sudah dihapus atau belum tersimpan permanen, seperti riwayat peramban atau pesan.

Kapan dipakai

  • ✓Saat menyelidiki insiden keamanan.
  • ✓Saat menguji keamanan aplikasi yang menggunakan SQLite.
  • ✓Saat ingin memulihkan informasi yang hilang dari database.

Link skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-sqlite-database-forensics/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-sqlite-database-forensics/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Pulihkan data yang terhapus dari database WhatsApp.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Tool ini memeriksa struktur internal database SQLite, mencari bagian data yang ditandai sebagai terhapus tetapi belum benar-benar dihapus. Tool ini juga menganalisis file log yang mencatat perubahan sebelum perubahan tersebut difinalisasi.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Performing SQLite Database Forensics

Overview

SQLite 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.

When to Use

  • When conducting security assessments that involve performing sqlite database forensics
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • DB Browser for SQLite (sqlitebrowser)
  • SQLite command-line tools (sqlite3)
  • Python 3.8+ with sqlite3 module
  • Belkasoft Evidence Center or Axiom (commercial)
  • Hex editor (HxD, 010 Editor) for manual page inspection
  • Understanding of B-tree data structures

SQLite Internal Structure

Database Header (First 100 Bytes)

Offset Size Description
0 16 Magic string: "SQLite format 3\000"
16 2 Page size (512-65536 bytes)
18 1 File format write version
19 1 File format read version
24 4 File change counter
28 4 Database size in pages
32 4 First freelist trunk page number
36 4 Total freelist pages
52 4 Text encoding (1=UTF-8, 2=UTF-16le, 3=UTF-16be)
96 4 Version-valid-for number

Page Types

Type ID Description
B-tree Interior 0x05 Internal table node
B-tree Leaf 0x0D Table leaf page containing actual records
Index Interior 0x02 Internal index node
Index Leaf 0x0A Index leaf page
Freelist Trunk - Tracks freed pages
Freelist Leaf - Freed page with recoverable data
Overflow - Continuation of large records

Deleted Record Recovery

Method 1: Freelist Page Analysis

When records are deleted, SQLite may place their pages on the freelist rather than overwriting them immediately.

import struct
import sqlite3
import os


def analyze_freelist(db_path: str) -> dict:
    """Analyze SQLite freelist to identify pages containing deleted data."""
    with open(db_path, "rb") as f:
        # Read header
        header = f.read(100)
        page_size = struct.unpack(">H", header[16:18])[0]
        if page_size == 1:
            page_size = 65536
        first_freelist_page = struct.unpack(">I", header[32:36])[0]
        total_freelist_pages = struct.unpack(">I", header[36:40])[0]

        freelist_info = {
            "page_size": page_size,
            "first_freelist_page": first_freelist_page,
            "total_freelist_pages": total_freelist_pages,
            "trunk_pages": [],
            "leaf_pages": []
        }

        if first_freelist_page == 0:
            return freelist_info

        # Walk the freelist trunk chain
        trunk_page = first_freelist_page
        while trunk_page != 0:
            offset = (trunk_page - 1) * page_size
            f.seek(offset)
            page_data = f.read(page_size)

            next_trunk = struct.unpack(">I", page_data[0:4])[0]
            leaf_count = struct.unpack(">I", page_data[4:8])[0]

            leaves = []
            for i in range(leaf_count):
                leaf_page = struct.unpack(">I", page_data[8 + i * 4:12 + i * 4])[0]
                leaves.append(leaf_page)

            freelist_info["trunk_pages"].append({
                "page_number": trunk_page,
                "next_trunk": next_trunk,
                "leaf_count": leaf_count,
                "leaf_pages": leaves
            })
            freelist_info["leaf_pages"].extend(leaves)
            trunk_page = next_trunk

    return freelist_info


def extract_freelist_content(db_path: str, output_dir: str):
    """Extract raw content from freelist pages for analysis."""
    info = analyze_freelist(db_path)
    os.makedirs(output_dir, exist_ok=True)

    with open(db_path, "rb") as f:
        page_size = info["page_size"]

…
Pertanyaan umum

Apa itu database SQLite?

Ini adalah jenis database yang ringan dan sederhana, digunakan oleh banyak aplikasi di ponsel dan komputer untuk menyimpan informasi.

Apa yang dimaksud dengan 'data terhapus' dalam konteks ini?

Ini adalah informasi yang pernah ada di database lalu dihapus. Tool ini berusaha menemukan data tersebut sebelum benar-benar tertimpa secara permanen.

Apa itu file WAL?

WAL adalah singkatan dari Write-Ahead Log. Ini adalah file yang mencatat perubahan pada database sebelum perubahan tersebut disimpan secara permanen, sehingga membantu proses pemulihan data.

Detail

Deskripsi asli dari pembuat

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/browser ev

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularitas

Bintang GitHub
35k
Peringkat
#8309
Lisensi
Apache-2.0
Diperbarui
31/8/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa