Home Overview Supported DBMSes Examples Use Cases Literature Team Contact

DBCarver

DBCarver is a research tool that performs database management system (DBMS) forensic analysis. It allows users to inspect DBMS storage beyond what DBMSes expose, including unallocated disk space and RAM contents. DBCarver runs independent of the DBMS, applies to all major relational row-store DBMSes (list of supported DBMSes), and does not require a live system.

DBCarver was inspired by the forensic technique called file carving. File carving reconstructs files without using the file system or any of its metadata. However, file carving cannot be used for database files for a number of reasons which we discuss in our papers. As a solution, we introduced database page carving. Page carving not only works for the query-able database contents, but also deleted data, unallocated storage, and RAM contents. Our current implementation of database page carving is called DBCarver.

Overview: How Does DBCarver Work?

DBCarver consists of two main components: the parameter collector (A) and the carver (F). The parameter detector is essentially the calibration part of DBCarver. It typically only needs to be run a single time for each DBMS (or a new DBMS version) to generate a configuration file. For new DBMS versions, parameter collection will typically verify that the storage layout remains the same. A new DBMS would produce new configuration layout file, depending on its specifics. Once you have created a configuration file, you can use the carver to extract all database contents from any type of file including raw disk images, individual DBMS files, and RAM snapshots.

DBCarver Architecture

In order to determine DBMS storage configuration, the parameter detector (A) loads synthetic data into a DBMS (B), captures storage (C), finds pages in storage, and captures page layout parameters in a configuration file (E) -- a text file describing page-level layout for that particular DBMS. Parameters include those described in DFRWS 2015, and have since been expanded to support other metadata. DBCarver automatically generates parameters values for new DBMSes, or new DBMS versions. While most DBMSes retain the same page layout across versions, we observed different parameter values between PostgreSQL versions 7.3 and 8.4.

The carver (F) uses the configuration files to reconstruct any database content from disk images, RAM snapshots, or any other input file (G). The carver returns storage artifacts (H), such as user records, metadata describing user data, deleted data, and system catalogs.

Supported DBMSes

DBCarver has been tested on the following DBMSes, although it will support others by default or with minimal tweaking. As DBCarver has been evaluated on these DBMSes, new parameter files do not need to be generated.

Commercial DBMSes

  • IBM DB2
  • Microsoft SQL Server
  • Oracle

Open-source DBMSes

  • ApacheDerby
  • Firebird
  • MariaDB
  • MySQL
  • PostgreSQL
  • SQLite

Examples

A copy of DBCarver code is freely available upon request.

Use Cases

We have worked with a number of forensic consultant and law enforcement agencies to evaluate DBCarver. This list includes Regional Chicago Forensic Lab (lab managed by FBI), Mandiant/FireEye, Royal Canadian Mounted Police, and Virginia Department of Forensic Science. Through these collaborations, we have helped find new evidence for active investigations.

In addition to gathering raw evidence, we have considered two cybersecurity threat detection approaches that leverage forensic artifacts extracted by DBCarver:

Database Administrator (DBA) threat

Consider a scenario where a DBA (i.e., a person tasked with managing and maintaining the DBMS) is performing a malicious action against a database. For our purposes, it does not matter whether the DBA or an attacker who took over the DBA's account is performing the tampering in question. DBA accounts have the ability to temporarily suspend audit logs (legitimate reasons include improving performance of bulk data load). Thus, a DBA account is capable of disabling the audit log, performing malicious command(s) and then re-enabling the audit log.

In our paper, we explain algorithms that can identify such actions independently of the database by matching the audit log contents to the forensic artifacts discovered by DBCarver. For example, in the following figure, we can see two deleted records that are attributed to a command (deleted records #1 and #3), and one suspicious record (#4) that could not be explained by any logged commands. Deleted Records Match

System Administrator (SysAdmin) threat

A second type of extra-priviledged attack that we are able thwart is described in our EDBT 2018 paper. In that case, we consider malicious actions by SysAdmin, an account with administrative priviledges at the OS level but with no particular capabilities within the DBMS. Such user is not capable of affecting the audit log (in a secure environment, where the audit log is protected from tampering). However, a SysAdmin is able to finding and directly edit the DBMS files on disk. This attack is particularly difficult to counter because this edit happens in-place, completely bypassing DBMS access control or logging and leaving no direct trace.

Due to the nature of the attack, our solution relies on a somewhat more proactive approach of comparing the state of database indexes (which often exist by default, and are created to improve performance) and the state of the database table. The example below illustrates an attack that wipes out a record (#4) in-place. Note that any delete performed through the DBMS itself will look like records #2 and #6 (i.e., flagged as deleted, not erased). In this example, index still contains the value of the deleted record. However, even if the SysAdmin successfully wiped out "Seattle" entry from the index, the remaining index gap would also indicate that a value is missing because values are never physically wiped from indexes.

Deleted Records Match

Literature

Team

Contact

Email: arasin@cdm.depaul.edu