Skip to main content

Pure-Python reader for Chromium/Chrome on-disk storage formats (LevelDB, localStorage, SessionStorage, IndexedDB, V8 values).

Project description

chromium-reader

Pure-Python reader for Chromium/Chrome on-disk storage formats. Reads LevelDB, localStorage, SessionStorage, IndexedDB and serialized V8 values without native dependencies — no plyvel, no snappy C extension, no Node.

Reimplements the parts of CCL Forensics' ccl_chromium_reader needed for read-only forensics / data recovery, in idiomatic Python 3.11+ with dataclasses, pathlib, type hints and stdlib-only deps.

Install

pip install chromium-reader

Requires Python 3.11+. Zero runtime dependencies.

Usage

localStorage

from chromium_reader.localstorage import LocalStorageReader

profile = "~/Library/Application Support/Arc/User Data/Default/Local Storage/leveldb"
with LocalStorageReader(profile) as reader:
    for record in reader.records(host="https://app.slack.com"):
        print(record.script_key, record.value[:80])

records() accepts string, regex, collection or callable filters via the host= and script_key= keyword arguments.

SessionStorage

from chromium_reader.sessionstorage import SessionStorageReader

with SessionStorageReader(profile_session_storage) as reader:
    for record in reader.records(host="https://example.com"):
        print(record.namespace_id, record.script_key, record.value)

IndexedDB

from chromium_reader.indexeddb import IndexedDbReader

with IndexedDbReader("~/.../IndexedDB/https_example.com_0.indexeddb.leveldb") as db:
    for info in db.databases:
        print(info.name)
    for record in db.records(database="MyDB", object_store="kv"):
        print(record.raw_key, record.value)

IndexedDB values are automatically decoded through the Blink + V8 envelopes, recovering plain objects, arrays, Maps, Sets, Dates, BigInts and typed arrays. Host objects (Blob, File, etc.) are surfaced as opaque HostObject placeholders.

Raw LevelDB

For other Chromium leveldb stores (Cookies, Site Characteristics, etc.):

from chromium_reader.leveldb import RawLevelDb

with RawLevelDb(path) as db:
    for record in db.iterate_records_raw():
        if record.is_live:
            print(record.user_key, record.value[:32])

What's supported

  • LevelDB: .ldb/.sst table reader (Snappy-decompressing), .log write-ahead reader, MANIFEST parser for level lookup.
  • Snappy: pure-Python block decompression.
  • localStorage: META-prefixed protobufs + 1-byte type-tagged values (UTF-16 LE and Latin-1). Write-batch reconstruction.
  • SessionStorage: namespace→map_id resolution, value decoding.
  • V8 ValueDeserializer: format versions 13-15, primitives, BigInts, Date, RegExp, ArrayBuffer/typed-array views, plain objects, Maps, Sets, sparse and dense arrays.
  • Blink envelope: Blink versions ≥ 17 around the V8 payload; gracefully rewinds when the payload is V8-only.
  • IndexedDB: walks every database / object store, decodes values, exposes (database_name, object_store_name, raw_key, value).

What's not (yet)

  • IndexedDB index entries (we only read the primary object-store records).
  • IndexedDB external .blob resolution.
  • Cookies database schema (the underlying LevelDB is readable via RawLevelDb, but no high-level wrapper).
  • Session Storage history/batching like the localStorage version.

Credits

The parsers are derived in spirit from ccl_chromium_reader by CCL Forensics (MIT, Copyright 2020-2024). This is a clean-room reimplementation; correctness bugs are mine, not theirs.

License

MIT.

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

chromium_reader-0.1.1.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chromium_reader-0.1.1-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file chromium_reader-0.1.1.tar.gz.

File metadata

  • Download URL: chromium_reader-0.1.1.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chromium_reader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bcaa2a5da80a6f76ffd1ff69892fc03304f0b31fbf858b98811cb4136e1e990d
MD5 7b4ad5aebee20457c237b52708388155
BLAKE2b-256 4277e1829505f627eae41024aabc6dc82759a7efb72f5b247397c2a2bc80dc71

See more details on using hashes here.

Provenance

The following attestation bundles were made for chromium_reader-0.1.1.tar.gz:

Publisher: publish.yml on DJRHails/chromium-reader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chromium_reader-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chromium_reader-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chromium_reader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc32b23e4b5423ceec78b9161690474b434692a79ad522a1ae0311cbddb49a12
MD5 f33d8aa13f70b965a3901ce24cfb0b0c
BLAKE2b-256 5080f79ae015062b097d5704e00d6ced135f38dff4e4a32823a43e7a3e0d475c

See more details on using hashes here.

Provenance

The following attestation bundles were made for chromium_reader-0.1.1-py3-none-any.whl:

Publisher: publish.yml on DJRHails/chromium-reader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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