IT Forensics · macOS
Manually validate SQLite, WAL and SHM artefacts
Many macOS applications – Messages, Safari, Photos, Notes – store their data in SQLite databases. Alongside the main file, there are often a „-wal“ and a „-shm“ file. The WAL file may contain recent changes and older versions of database pages that are not yet, or are no longer, present in the main file.
This point is particularly important for Apple computers, as their hardware and security architecture have changed significantly in recent years. An older Intel-based iMac, an Intel-based Mac with a T2 Security Chip and a current Mac Studio with Apple Silicon cannot be treated according to the same technical approach. APFS, Secure Enclave, FileVault and the respective system state determine which data is accessible and which backup method causes the least disruption.
Automatic parsers may handle WAL contents in different ways. For this reason, relevant data records are checked directly against database pages, the transaction context and supporting files where necessary.
Technical background
In write-ahead logging, changes are first written to the WAL and later transferred to the main file via a checkpoint. Anyone who opens the database using standard tools can trigger a checkpoint and modify the WAL. Different parsers handle WAL frames differently; as a result, records may be missing, appear twice or be assigned to the wrong point in time.
Relevant evidence and data sources
- Main database, -wal and -shm backed up as a single unit
- WAL frames with salt values and commit markers
- Freelist pages and unallocated space (deleted records)
- Table schema and timestamp formats (e.g. Mac Absolute Time)
Why LanCologne?
LanCologne does not examine Apple computers according to a standardised, one-size-fits-all approach, but rather on the basis of their specific hardware and security architecture. Our staff have decades of experience in information technology and many years of practical experience in IT forensics.
Here’s how we do it
- Back up the files as a group; perform the analysis on copies only.
- Compare the parsing result with the page and frame levels.
- Documentation specifying the source (main file, WAL frame, free space) from which a data record originates.
Borders
- Once the checkpoint has been processed and the data overwritten, older versions are no longer available.
- It is not always possible to assign a WAL frame to a precise point in time.
Possible results
- Validated data sets with source attribution
- Indications of deleted or amended entries
Typical areas of application
Why is this area of investigation relevant to forensics?
Many macOS applications store information in SQLite. A thorough investigation takes into account not only the main database but also, depending on its state, the WAL and SHM files, and distinguishes between active records and reconstructed fragments.
The forensic value lies not solely in the volume of data found, but in its origin and reliability. A file name, a timestamp or a database entry can be misleading without context. That is why we document how an artefact may have come into being, what alternative explanations exist and what further evidence supports the findings.
Automatic parsers may handle WAL contents in different ways. For this reason, relevant data records are checked directly against database pages, the transaction context and supporting files where necessary.
On modern Macs in particular, attempts at a „traditional“ disk analysis may also fail due to technical limitations. Hardware-based encryption, Secure Enclave, FileVault and APFS clearly illustrate why it is so important to carry out a proper backup before the actual analysis begins. Errors made at this stage cannot always be reversed later on.
Frequently Asked Questions
What forensic considerations should be borne in mind when „manually validating SQLite, WAL and SHM artefacts“?
How does such a forensic investigation work in practice?
What is the forensic significance of the findings in this area?
Are assumptions presented as confirmed findings in such an investigation?
Why can’t you just open the database?
Can you find deleted messages in the WAL?
Does that only apply to macOS?
🔗 Related topics
LanCologne – macOS Forensics in Cologne
Do you require a professional investigation into „manually validating SQLite, WAL and SHM artefacts“? LanCologne supports you in carrying out evidence-secure backups, multi-stage analysis and traceable documentation. The key here is not to generate as many automated hits as possible, but to secure technically sound and verifiable evidence.
Related to this topic
- Manually validating Plist and NSKeyedArchiver data
- Forensic analysis of Gatekeeper and quarantine – assessing the origin and execution of software
- Forensic analysis of XProtect – A technical assessment of Apple’s built-in malware protection
- Forensic analysis of macOS privacy permissions – assessing app access to protected resources