SQLite Forensics with Belkasoft X: Viewer, Queries, and Custom Artifacts

Most mobile applications, web browsers, and many Windows components store their data in SQLite databases. A single smartphone or computer can hold hundreds of them. Databases are easy to miss: one can sit in an unexpected folder, carry a name no parser looks for, or belong to an application that no forensic tool supports. The records that matter are often the ones the application no longer shows, and a general-purpose database browser can destroy them the moment it opens the file. Even when the data is in front of you, timestamps, identifiers, and binary fields still need interpretation.

Belkasoft X addresses these problems at two levels. For supported applications, it parses databases automatically and presents the results as structured artifacts, with fields decrypted, timestamps converted, and recovered records merged into the same view as live ones. For everything else, the SQLite Viewer gives direct access to tables, deleted records, log entries, and unallocated space without modifying the source file.

In this article we will review:

Finding SQLite databases in a data source

Detecting databases automatically

When analyzing a data source, Belkasoft X locates files with common database extensions, including .db, .sql, .sqlite, .sqlite3, and .sqlitedb, and verifies the binary signature of each one. Extension alone is not enough, since .db is used by many formats that are not SQLite at all.

Belkasoft X analysis settings showing database file detection

Data source analysis options in Belkasoft X

Confirmed databases appear in the Artifacts window under the Databases node:

Belkasoft X Artifacts window listing detected SQLite databases

The Databases node in the Artifacts window

Locating databases in the file system

Every database under the Databases node, and every artifact profile in the Artifacts window, offers the Show on File System option. It takes you straight to the source folder in the File System window.

Context menu in Belkasoft X with the Show on File System option selected

Show on File System option

From here you can explore the application folder for additional files and databases of interest, including the -wal and -journal companions that belong with the database you started from.

Belkasoft X File System window showing an application folder with database and log files

Application folder contents in the File System window

The File System window also lets you search an entire data source, or a single folder, for database files. Select a folder to inspect, enable the recursive view at the right corner above the grid, and filter the files by extension or name. Belkasoft X lists every matching file in the target folder:

Belkasoft X File System window filtering files by database extension

Recursive search for database files

Classifying databases with BelkaGPT

A data source can contain hundreds of databases, and file names and paths often reveal nothing about the contents. Forensic tools parse the popular applications, but less common and recently updated ones often go unparsed, so opening each one by hand is not practical. Instead, you can use the offline AI assistant in Belkasoft X to find the databases that contain records relevant to your case.

BelkaGPT classifies SQLite databases by what they hold. It reads a representative sample of records from each database and assigns categories, either predefined ones such as communications, locations, financial information, and credentials, or custom categories you define around the evidence you are after.

Belkasoft X showing SQLite databases grouped by assigned category

SQLite database classification results

Classification runs locally, so no case data leaves the forensic environment. It helps most with unfamiliar or proprietary applications that have no dedicated parser. Instead of opening every database in turn, you have BelkaGPT flag the ones most likely to matter and start with those.

Note: Classification is part of the BelkaGPT module and requires a license that includes it.

Parsed artifacts and the SQLite Viewer

Reviewing parsed artifacts

For supported applications, the data arrives in the Artifacts window already interpreted: encrypted fields decrypted where the keys are available, timestamps converted, and binary fields rendered.

Records recovered from the freelist, the rollback journal, and the write-ahead log are merged into the same artifact node as the live records, so a recovered chat appears alongside the existing ones rather than in a separate view. The Is deleted property identifies which is which. To check an artifact against its source, select it and open the SQLite tab in the Tools pane. The tab highlights the database record from which the selected artifact originates.

Belkasoft X Artifacts window showing chats with the Is deleted property

Parsed application artifacts with deleted items marked

Exploring a database in the SQLite Viewer

The embedded SQLite Viewer in the Tools pane previews tables and records. You can also expand the viewer into a standalone window, which gives you the full toolset: schema navigation, binary field inspection in the Hex Viewer, data carved from unallocated space, and custom SQL queries.

Belkasoft X SQLite Viewer showing table list and record data

SQLite Viewer opened as a standalone window

Once a database is open, the SQLite Viewer presents four tabs—Properties, Tables, Unallocated space, and Execute SQL—with the Hex pane below the table displaying the selected cell contents.

Working with tables

The Tables tab lists every table with its record count and, separately, the number of deleted records it holds.

Several controls make the data easier to work with:

  • Column order configuration: reorder and hide columns to bring the relevant fields to the front.
  • Format conversion: convert a column to Unicode or ASCII strings, to Unix time in local or UTC form, to Apple Cocoa time, or to Mac HFS+ time, without writing a query.
  • Binary field handling: render a binary column as a picture when it holds image data, read it as an ASCII or Unicode string, or inspect it in raw hex.

Belkasoft X SQLite Viewer converting a column to a readable timestamp

Column type conversion in the SQLite Viewer

Clicking a cell shows the underlying bytes in the Hex Viewer, which is where you confirm what a converted value actually contains.

Belkasoft X Hex pane displaying the contents of a selected database cell

Binary field shown in the Hex pane

Recovering records outside the live tables

The SQLite Viewer reads databases at a low level and exposes three areas that standard database browsers do not show.

Freelist pages are parsed directly. Their records appear in the table they belong to, in the same grid as live records rather than in a separate export. The Record type column marks each recovered record.

Belkasoft X SQLite Viewer highlighting records recovered from freelist pages

Freelist records shown in the table view

Write-ahead log records also appear in line with the main database records and are marked in the Record type column. Records from a rollback journal are marked the same way. Belkasoft X reads these files without triggering a checkpoint and without creating transactional files, so the source set stays as acquired.

Belkasoft X SQLite Viewer showing WAL records with a record type indicator

Write-ahead log entries in line with live records

Unallocated space is carved automatically and presented in its own tab. Fragments of partially overwritten records, such as browsing history entries, can be recovered here even when the records themselves are gone. Results can be exported to CSV for keyword searching.

Belkasoft X SQLite Viewer Unallocated space tab listing carved records with offsets

Records carved from unallocated space

Freelist pages, transaction logs, and unallocated space are where deleted records survive, and a standard database browser either hides them or destroys them by checkpointing the write-ahead log on open. Belkasoft X reads all three and leaves the acquired files unchanged.

Running custom SQL queries

Writing queries by hand

In the Execute SQL tab, you can run queries written by hand or assembled visually in the Query Builder. In most cases that means a SELECT that pulls the columns you need, joins the tables that turn identifiers into names, and converts timestamps on the way out. Results appear in the panel below the editor.

Statements that modify data also run. Belkasoft X applies ALTER, DELETE, UPDATE, and DROP to a temporary copy, never to the source file. The result stays inside the Execute SQL tab, so query the copy with SELECT to see what changed. The Tables tab always shows the original database contents as acquired.

As an example, the following query extracts Viber messages from Contacts.data, found at com.viber\database\Contacts.data on iOS. It joins three tables to resolve contact names and phone numbers:

SELECT
    DATETIME(ZVIBERMESSAGE.ZDATE + 978307200, 'unixepoch') AS Timestamp,
    ZABCONTACT.ZMAINNAME AS "Contact Name",
    ZABCONTACTNUMBER.ZPHONE AS "Phone Number",
    ZVIBERMESSAGE.ZTEXT AS "Message Body",
    ZVIBERMESSAGE.ZSTATE AS Status,
    ZVIBERMESSAGE.ZCONVERSATION AS "Chat ID",
    ZVIBERMESSAGE.belka_record_type
FROM ZVIBERMESSAGE
LEFT JOIN ZABCONTACTNUMBER
    ON ZVIBERMESSAGE.ZPHONENUMINDEX = ZABCONTACTNUMBER.Z_PK
LEFT JOIN ZABCONTACT
    ON ZABCONTACTNUMBER.ZCONTACT = ZABCONTACT.Z_PK
WHERE ZVIBERMESSAGE.ZTEXT IS NOT NULL;

Three parts of this query are worth explaining. The two joins walk the chain from message to phone number to contact name, using ZABCONTACTNUMBER as a bridge table. The timestamp conversion adds 978307200 seconds, because Viber on iOS stores dates in Mac absolute time. The belka_record_type column shows where each record came from, which is how you tell a live row from one recovered by Belkasoft X.

Building queries visually

For an easier way to create SQL queries, use the visual Query Builder. Drag tables onto the surface, create joins, then set aliases, sorting, grouping, and filter criteria in the query grid. The generated SQL appears below, so you can check it before you run it.

Belkasoft X Query Builder with joined tables and a generated SQL statement

Building a join visually in the Query Builder

Query results draw from the full database content—live records, log entries, and freelist data—in a single result set, so there is no need to query each source separately.

Belkasoft X SQLite Viewer query result grid showing Viber messages

Query results with converted timestamps and resolved contact names

Once the results are on screen, you can hide columns, convert values, and sort the output. When the view is set the way you want it, export it to a report in your preferred format.

Creating custom SQLite artifacts

A query answers one question at a time. When a database matters to the whole case, you need its records in the same place as the rest of the evidence, and that is what custom SQLite artifacts do.

Belkasoft X lets you map database tables and columns to standard artifact fields such as timestamps, participant names, message text, identifiers, and geolocation coordinates.

Databases artifact type with ‘Create custom SQLite artifact dialog’

Creating custom SQLite artifact

If you want to add multiple artifact types as part of the same custom artifact, you can do so in the same dialog window:

Belkasoft X custom SQLite artifact configuration with table columns mapped to artifact fields

Mapping database columns to artifact fields

Once mapped, the data behaves like a regular artifact. You can search it, filter it, review it, and include it in reports alongside automatically parsed evidence.

Belkasoft X Artifacts window showing records from a mapped custom SQLite artifact

Custom artifact records in the Artifacts window

SQLite applications store time in several incompatible formats, and picking the wrong one produces a timeline that looks right and is wrong by decades, so check the timestamp mapping first. The Choose column type menu in the SQLite Viewer converts a column to Unix time in local or UTC form, to Apple Cocoa time, or to Mac HFS+ time without writing a query. When none of those produce a sensible date, select the raw bytes in the Hex Viewer and read the Type converter, which interprets the same bytes as every supported type at once and lets you switch between big endian and little endian.

Classification and custom artifacts work as a pair. Classification tells you which database is worth opening, and mapping turns that database into evidence the rest of the case can use.

Analyzing unsupported SQLite databases: Practical examples

Automated parsing covers a wide range of applications, but not every database in a case will be recognized. A database may belong to an unsupported application, sit in a non-standard location, or carry an unexpected file name. In other cases a parser extracts the primary records correctly and leaves related data in adjacent tables untouched. The following examples show how to handle such cases.

Microsoft Phone Link

Microsoft Phone Link synchronizes phone data with a computer. The synced data is stored unencrypted on that computer, which means contacts, call history, messages, and photos may be available even when the phone itself cannot be seized—provided the suspect used Phone Link at least once.

The databases sit in %LocalAppData%\Packages\Microsoft.YourPhone_8wekyb3d8bbwe\LocalCache\Indexed[device_ID]\System\Database. Open photos.db in the SQLite Viewer and run:

SELECT name,
       datetime(last_updated_time / 10000000 - 11644473600, 'unixepoch') AS last_updated,
       datetime(taken_time / 10000000 - 11644473600, 'unixepoch') AS taken,
       mime_type, thumbnail, height, width, size
FROM media;

Both timestamp columns are Windows FILETIME values, hence the division by 10000000 and the 11644473600-second epoch shift. Converting the thumbnail column to a picture view then gives you a visual summary of every photo synced from the phone.

Belkasoft X SQLite Viewer showing photo thumbnails recovered from Phone Link

Thumbnails rendered from the media table

Windows notifications

Windows stores toast and tile notification content in wpndatabase.db, at %LocalAppData%\Microsoft\Windows\Notifications. Notifications often preserve message previews and sender names from applications that store nothing else in plain text.

Two tables carry the evidence. Notification holds one row per notification, with HandlerId, Type, Payload, Tag, Group, ArrivalTime, and ExpiryTime. NotificationHandler holds one row per registered application, keyed by RecordId, with the application identifier in PrimaryId.

Three points shape the query. ArrivalTime and ExpiryTime are Windows FILETIME values. Payload holds the notification content as XML, so the text is readable but will require parsing to separate the fields. Group is a SQL keyword, so it has to be quoted.

SELECT DateTime(ArrivalTime / 10000000 - 11644473600, 'unixepoch') AS ArrivalUtc,
       PrimaryId AS Application,
       Type,
       Payload,
       Tag,
       "Group"
FROM Notification
LEFT JOIN NotificationHandler ON HandlerId = RecordId
WHERE Payload IS NOT NULL
ORDER BY ArrivalTime DESC;

The join exists to turn a number into an application. Notification records only a HandlerId, and the identity of the application that raised the notification sits in NotificationHandler, keyed by RecordId. We use LEFT JOIN rather than INNER JOIN. Handler rows are removed when an application is uninstalled, and INNER JOIN would silently drop every notification from that application. With a left join, notifications from uninstalled applications still appear with an empty application name, which is itself worth investigating. This database also runs in write-ahead log mode, so collect wpndatabase.db-wal and wpndatabase.db-shm with it: notifications that Windows has already expired from the main table are frequently still present in the log.

Belkasoft X SQLite Viewer showing a Windows toast notification with its converted timestamp, application identifier, and payload

Notification records with timestamps converted and handler identifiers resolved

iOS SMS backup

DFIR labs rarely rely on a single tool—what one tool surfaces, another may miss. JB Brooks, Lab Director of a law enforcement Cyber Crimes Unit, ran into this during a pyramid scheme investigation. The key evidence was a text thread between the suspect and one of the victims, which the victim had kept for three years through iTunes backups and transfers to newer phones. The thread was visible on the phone but did not appear when the investigator ran an automated parse of the extracted data.

Examining the file system directly revealed two SMS databases: sms.db, holding current messages, and sms(1).db, created during the logical acquisition. However, the forensic tools had parsed only the first. Opening sms(1).db in the SQLite Viewer returned the complete conversation between the suspect and the victim, discussing the fraudulent activity. That exchange became the key evidence in the case and contributed to a conviction.

Belkasoft X SQLite Viewer showing an SMS conversation recovered from sms(1).db

Messages recovered from a second SMS database

Conclusion

Belkasoft X covers both halves of SQLite forensics. Supported applications are parsed and presented with fields decrypted, timestamps converted, and recovered records merged into the same view as live ones. When a database falls outside parser coverage, or is only partly covered, the SQLite Viewer gives direct access to the full content without modifying the source.

For unsupported databases, the route is now shorter. BelkaGPT classification narrows hundreds of candidates down to the few that matter, custom SQL and the Query Builder answer specific questions, and custom artifacts bring the results into the case alongside everything else.

The Belkasoft X trial includes the SQLite Viewer showcased in this article, so you can test the approach against your own case data.

FAQ

How can I analyze SQLite databases from applications that my forensic tool does not support?

You can examine SQLite databases without a dedicated application parser. Belkasoft X lets you inspect database tables, recover available deleted records from freelist pages and unallocated space, examine transaction files, and run custom SQL queries. You may need to interpret the database schema manually to identify relevant fields, timestamps, and application-specific values.

How can I find SQLite database files in a forensic image?

Look for files with extensions such as .db, .sql, .sqlite, .sqlite3, and .sqlitedb. However, file extensions alone do not reliably identify SQLite databases. Belkasoft X checks files with these extensions for the SQLite binary signature and lists recognized databases under the Databases node.

How can I extract searchable forensic artifacts from an unsupported SQLite database?

Belkasoft X lets you create custom SQLite artifacts by mapping database tables and columns to standard fields, such as timestamps, participants, message text, identifiers, and coordinates. Once mapped, the extracted records become searchable, filterable, and available for reports alongside other forensic artifacts.

Can AI identify what an unknown SQLite database contains?

Yes. BelkaGPT in Belkasoft X can classify SQLite databases based on a representative sample of their records. It assigns predefined categories, such as communications, locations, financial information, and credentials, or custom categories defined by the examiner. Classification runs locally without sending case data to external AI services.

Can running SQL queries during forensic analysis modify the original SQLite evidence?

Not in Belkasoft X. The SQLite Viewer executes queries against a copy of the database rather than the original evidence file. Even SQL statements that modify or delete records affect only the working copy, leaving the original database unchanged.

How can I find and examine deleted SQLite records in Belkasoft X?

For supported applications, recovered deleted records appear in the Artifacts window alongside live records, identified by the Is deleted property. In the SQLite Viewer, records recovered from freelist pages and write-ahead logs appear alongside live rows in the table view. Data carved from unallocated space appears in the Unallocated space tab.

Can deleted SQLite records always be recovered?

No. Recovery depends on whether the deleted data remains in freelist pages, unallocated space, or associated transaction files. If SQLite has reused or overwritten the relevant storage, the deleted records may no longer be recoverable. Operations such as VACUUM can also eliminate recoverable remnants.

See Also