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.0.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.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for chromium_reader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f64cabf816f73507ada6a262e7bfd6de96b4d248bb9b4616d396c8c4a8684a4f
MD5 dc0306cc41f2b7b6b5a111888c6e9b81
BLAKE2b-256 178e6f4e5e2972b439a2267855848091d8ec5e5605bed1a86581e93786f81e56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chromium_reader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 976498b726a1d0ccf950ba03af6990db327c71799a824a117b409cb67c3d2ad0
MD5 200ef2cb8efa3f02216249e9887f8e03
BLAKE2b-256 a78dd39c783d70e16ae9a7d2e66f35a3a8aab33ac0531ac4c55a95ab836c7d4f

See more details on using hashes here.

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