Skip to main content

dfindexeddb is an experimental Python tool for performing digital forensic analysis of IndexedDB and leveldb files.

Project description

dfIndexeddb

dfindexeddb is an experimental Python tool for performing digital forensic analysis of IndexedDB and leveldb files.

It parses leveldb, IndexedDB and javascript structures from these files without requiring native libraries. (Note: only a subset of IndexedDB key types and Javascript types for Chromium-based browsers are currently supported. Safari and Firefox are under development).

The content of IndexedDB files is dependent on what a web application stores locally/offline using the web browser's IndexedDB API. Examples of content might include:

  • text from a text/source-code editor application,
  • emails and contact information from an e-mail application,
  • images and metadata from a photo gallery application

Installation

  1. [Linux] Install the snappy compression development package
    $ sudo apt install libsnappy-dev
  1. Create a virtual environment and install the package
    $ python3 -m venv .venv
    $ source .venv/bin/activate
    $ pip install dfindexeddb

Installation from source

  1. [Linux] Install the snappy compression development package
    $ sudo apt install libsnappy-dev
  1. Clone or download/unzip the repository to your local machine.

  2. Create a virtual environment and install the package

    $ python3 -m venv .venv
    $ source .venv/bin/activate
    $ pip install .

Usage

Two CLI tools for parsing IndexedDB/leveldb files are available after installation:

IndexedDB

$ dfindexeddb -h
usage: dfindexeddb [-h] {db,ldb,log} ...

A cli tool for parsing indexeddb files

positional arguments:
  {db,ldb,log}
    db          Parse a directory as indexeddb.
    ldb         Parse a ldb file as indexeddb.
    log         Parse a log file as indexeddb.

options:
  -h, --help    show this help message and exit

To parse Indexeddb records from a LevelDB folder, use the following command:

dfindexeddb db -h
usage: dfindexeddb db [-h] -s SOURCE [--use_manifest] [-o {json,jsonl,repr}]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source leveldb folder
  --use_manifest        Use manifest file to determine active/recovered records.
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json

To parse Indexeddb records from a LevelDB ldb (.ldb) file, use the following command:

dfindexeddb ldb -h
usage: dfindexeddb ldb [-h] -s SOURCE [-o {json,jsonl,repr}]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source .ldb file.
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json

To parse Indexeddb records from a LevelDB log (.log) file, use the following command:

dfindexeddb log -h
usage: dfindexeddb log [-h] -s SOURCE [-o {json,jsonl,repr}]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source .log file.
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json

LevelDB

$ dfleveldb -h
usage: dfleveldb [-h] {db,log,ldb,descriptor} ...

A cli tool for parsing leveldb files

positional arguments:
  {db,log,ldb,descriptor}
    db                  Parse a directory as leveldb.
    log                 Parse a leveldb log file.
    ldb                 Parse a leveldb table (.ldb) file.
    descriptor          Parse a leveldb descriptor (MANIFEST) file.

options:
  -h, --help            show this help message and exit

To parse records from a LevelDB folder, use the following command:

dfindexeddb db -h
usage: dfindexeddb db [-h] -s SOURCE [--use_manifest] [-o {json,jsonl,repr}]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source leveldb folder
  --use_manifest        Use manifest file to determine active/recovered records.
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json

To parse records from a LevelDB log (.log) file, use the following command:

$ dfleveldb log  -s SOURCE [-o {json,jsonl,repr}] [-t {blocks,physical_records,write_batches,parsed_internal_key}]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source leveldb file
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json
  -t {blocks,physical_records,write_batches,parsed_internal_key}, --structure_type {blocks,physical_records,write_batches,parsed_internal_key}
                        Parses the specified structure. Default is parsed_internal_key.

To parse records from a LevelDB table (.ldb) file, use the following command:

$ dfleveldb ldb -s SOURCE [-o {json,jsonl,repr}] [-t {blocks,records}]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source leveldb file
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json
  -t {blocks,records}, --structure_type {blocks,records}
                        Parses the specified structure. Default is records.

To parse version edit records from a Descriptor (MANIFEST) file:

$ dfleveldb descriptor -s SOURCE [-o {json,jsonl,repr}] [-t {blocks,physical_records,versionedit} | -v]

options:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        The source leveldb file
  -o {json,jsonl,repr}, --output {json,jsonl,repr}
                        Output format. Default is json
  -t {blocks,physical_records,versionedit}, --structure_type {blocks,physical_records,versionedit}
                        Parses the specified structure. Default is versionedit.
  -v, --version_history
                        Parses the leveldb version history.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dfindexeddb-20240417.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

dfindexeddb-20240417-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file dfindexeddb-20240417.tar.gz.

File metadata

  • Download URL: dfindexeddb-20240417.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dfindexeddb-20240417.tar.gz
Algorithm Hash digest
SHA256 8412eb9c8f72b8f605859b1b8c1ac4a2b883d66200223906f90972fa32210680
MD5 fe9e4d414fe0f8cfded434281d668568
BLAKE2b-256 957f5b85709ec47b671472f6334c75a8e066eb14f279b18300e07585f1e2b066

See more details on using hashes here.

File details

Details for the file dfindexeddb-20240417-py3-none-any.whl.

File metadata

File hashes

Hashes for dfindexeddb-20240417-py3-none-any.whl
Algorithm Hash digest
SHA256 9c3533d12793520d32e1e9a7b8e65956b6e1ae876bc69bb39d6772b65456c0c5
MD5 2ed41deaa7ef930d814ec848accde58f
BLAKE2b-256 013e017f5a3f3db99d9e86e61d02172e0472647663f1519fe222b2c3532fa57d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page