MemDiver Volatility 3 Plugins: Technical Architecture and Implementation

Introduction

The plugins locate candidates by walking structures, matching patterns, or scanning for high entropy. An oracle checks each candidate and determines its proof status. The strength of the proof depends on the evidence the oracle checks.

All numbers below come from the Validation Guide or from the plugin source. Items not verified on real data are marked as such.

Oracle taxonomy

Class

Mechanism

Formats and uses in this suite

False-positive rate of a wrong key

A. MAC / AEAD recomputation

a tag or HMAC over stored ciphertext

gocryptfs (AES-GCM, XChaCha20-Poly1305, AES-SIV), generic AEAD

2^-128 for a 16-byte tag

B. Key digest

PBKDF2 of the key stored in a header

LUKS1 mkDigest, LUKS2 digests

2^-160 or smaller

C. Plaintext structure

decrypt a sector or block, check for filesystem structure

dm-crypt and VeraCrypt data areas (xts-fsmagic): ext4, XFS, FAT, NTFS, LVM2, swap, GPT, btrfs

scored in bits; proof threshold 64 bits by default

D. Key self-consistency (memory only)

derive and compare inside the same dump

AES round key 0 equals the raw key, or the key rebuilds the kernel’s Serpent or Twofish context (dm-crypt O1); X25519(priv)·G equals the stored public key; X25519(priv, remote) equals the precomputed secret; Noise chaining key recomputation; SSH keys A-F from (K, H, session_id); fscrypt HKDF identifier and per-file key; eCryptfs MD5(FEK) == root_iv; derived-state: the key’s AES schedule, HMAC ipad/opad midstates or HKDF chain found in the same process (absent state is unverified, never rejected)

structural: a wrong candidate does not satisfy a one-way relation to bytes elsewhere in memory

E. Network traffic

No proof reads a packet capture. Packets left in memory can prove a key; --dump-pcap only writes them out (synthetic framing).

Notes on the table:

  • Class C is never used alone for a LUKS key; it adds evidence to class B. It is the proof for VeraCrypt, whose header is encrypted under a key derived from the password and therefore cannot check a master key recovered from memory (which is why a veracrypt-header oracle was dropped from the design).

  • AES-GCM and (X)ChaCha20-Poly1305 are not key-committing. “Proven” means “this key authenticates the sample”; for a sample written by real software the key is unique, but an adversarially built sample could authenticate under two keys.

  • The xts-fsmagic oracle rejects a wrong key only when the filesystem is named in its parameters; with an unknown filesystem the verdict is error, never rejected. 1,000 random keys on real decrypted pages gave 1,000 rejected (filesystem named) or 1,000 error (unknown), and 0 proven either way.

Proof statuses

Status

Used when

Never used when

proven (oracle:<kind>)

an independent check passed and every offset on the key path came from the ISF, an exact table entry, or trusted in-memory BTF

an offset on the key path was guessed or user-supplied without a built-in confirmation

unverified

no oracle applies, evidence is not resident, a budget ran out, or an offset was guessed

rejected

a trusted structure contradicts its own proof (for example a Tier A SSH structure whose K does not derive its own keys)

a time budget ended, an offset was guessed, an unknown filesystem was assumed

conflict (kernel plugins)

two independent oracles disagree

The consequence of the last two rows is intentional: wrong offsets are silent failures in Volatility 3, so a plugin that guesses an offset may say unverified and may never say rejected or proven.

Linux kernel image plugins

Shared infrastructure

The kernel BTF documentation describes the format used for type and member information.

Kernel-module structures (crypt_config, wg_device, wg_peer, noise_handshake, noise_keypair, and related) are not in a kernel’s vmlinux ISF. The plugins get their layouts from three sources, in this order:

  1. Trusted in-memory BTF. linux.btf_layouts walks the kernel’s btf_modules list through the ISF (many cross-checks) and parses the module’s BTF out of the image. A header-scan fallback exists, but a scan-only result is never trusted, because a planted blob could forge it. A failed walk check disqualifies trust.

  2. An exact built-in table entry keyed by architecture and kernel release (uname -r, read from linux_banner). There are 60 exact x86_64 WireGuard entries (Ubuntu 5.15 GA, Ubuntu 6.8 and HWE up to 7.0, Debian 12, RHEL 9.1 to 9.8, Fedora 41 to 45), each derived from the distribution package’s module BTF and checked against pahole (all 122 members of 11 structs). They fall into 8 distinct layouts, constant within every sampled series; the key-path offsets are identical in all 8. dm-crypt has exact entries for ("x86_64", "6.8.0-136-generic") and the AArch64 twin (38 of 38 members checked against pahole).

  3. --offsets FILE (a capture sidecar works).

Every offset carries a provenance label (btf-memory, table, isf, derived). A key found through a derived offset is unverified. The test-only variable MEMDIVER_TEST_HIDE_OFFSET_TABLE=1 hides the table so that the BTF path is exercised; it prints a TEST ONLY warning.

Other shared pieces: a kernel list and red-black tree walker with cycle and size caps, an ISF member resolver, a SafeReader that turns unreadable pages into absent data, and a stdlib-only primitive set (aes, chacha, x25519, hkdf_midstate, luks, fsmagic, pagecache, ssh_kdf, noise, serpent, twofish, blockmodes) with known-answer tests (FIPS-197, SP 800-38A, IEEE 1619 XTS, GCM test cases, RFC 7748 including 1000 iterations, RFC 4231 through midstates, RFC 5869, NESSIE for Serpent, Schneier’s ecb_ival for Twofish including all 40 subkeys, Linux testmgr ECB/CBC/XTS for both).

Pure-Python timings (CPython 3.11, Apple silicon): XTS over 4 KiB 3.8 ms, GCM over 4 KiB 4.5 ms, one X25519 1.6 ms (1.3 ms budget value in the oracle), one SHA-512 compression 0.12 ms.

linux.dmcrypt

The Linux dm-crypt documentation describes the device-mapper target parameters. The LUKS2 format specification covers the metadata and digests.

Walk. name_rb_tree (fallback _minor_idr) to hash_cell to mapped_device.map to dm_table.targets[] to every dm_target whose type name is crypt; dm_target.private is the crypt_config. When dm_mod is a module (RHEL and Alma ISFs have no device-mapper types), the core layout comes from the module’s symbols and BTF instead, with warnings.

Self-validating locator. A crypt_config candidate must pass: the dm_dev name is major:minor, the cipher string matches what dm-crypt accepts, the key size, key parts and sector size are plausible, and tfms[0]’s crypto_alg.cra_name equals the crypto-API name the cipher string parses to.

Key recovery. The raw key is rebuilt from the AES schedules (struct crypto_aes_ctx), or from struct serpent_ctx (528 bytes, post-S-box subkeys) or struct twofish_ctx (4256 bytes, fused-MDS tables), inside the transform context. A driver layout table is tried first, then a bounded scan of the context and of the transforms it points to (templates such as xts(aes), essiv(...) and simd/cryptd wrappers keep their keys one hop away). With LUKS2’s default keyring path the kernel wipes crypt_config.key, so the schedule is the only source; Source says which one was used. For CBC-ESSIV the data key is the schedule whose SHA-256 equals another schedule in the same device (the IV key). When the joined schedule keys are shorter than crypt_config.key_size, or key_parts > tfms_count (tcw, lmk, elephant, authenc MAC keys), the rest of the volume key is in no schedule: the key is unverified:partial-key unless crypt_config.key starts with the schedule bytes and supplies the rest and then O2 or O3 passes on that full-length key. O1 alone never proves a partial key, so it is never exported as proven.

Oracles.

  • O1 (always): every key part’s full key_enc || key_dec || key_length must equal what the kernel’s own AES key-expansion produces from it. For Serpent and Twofish the key is inverted from the context and the whole context is recomputed from it (see below). A zeroed context never passes, because the schedule of the all-zero key is not zero.

  • O2 (when a LUKS header is resident): the physical layer is scanned for LUKS headers (only when a LUKS device with a recovered key exists). A header binds to a device by UUID (hash_cell.uuid is CRYPT-LUKS<n>-<uuid>-<name>), then PBKDF2 of the key is compared with the header digest. LUKS2 JSON areas that are not contiguous with their binary header are re-paired by the header checksum. Hostile headers are bounded: digests of 16 to 64 bytes, at most 8 digests, a 40 million total-iteration budget, an iteration cap of 20 million, and at most 16 distinct header contents per UUID (a warning names the UUID when the cap is hit). A header whose PBKDF2 was refused by the cap or the budget did not test the key: when every header of the UUID refused, O2 is n/a (the refusal is in the detail), never fail.

  • O3 (page cache): the ciphertext source is the loop device’s backing file mapping, read from lo_offset + start*512 (with a lo_disk back-check), or the block-device mapping otherwise; the plaintext source is the whole-disk part0. Pair mode first (ciphertext pages decrypt to a resident plaintext page), then filesystem-magic on unit 0; at most 8 page reads and 16 units. A mismatch counts only when the decryption is noise. Noise can still come from a correct key when the dm plaintext page is dirty and the backing page stale (jbd2 metadata not yet checkpointed on a random-prefilled container), so an O3 fail rejects only a key without O1; an O1 key becomes conflict:pagecache. Pages are found through an xarray walk with a mapping check (114 stale LUKS2 slots on the real capture pointed at pages now owned by another file and are filtered) and pointer canonicalisation, because Volatility masks pointers to the address width.

decide() keeps O2 primary. O3 adds evidence and never rejects an O2-proven key; with O2 not applicable, an O3 pass proves the key and settles the XTS half order, and an O3 fail is a conflict for an O1 key and a rejection only without O1. Measured O3 cost: 0.001 to 0.010 s per device.

Results on the real capture (x86_64 4-level and 5-level, Volatility 2.27.0 and 2.28.2, all four identical): LUKS1 O1+O2+O3:luks-digest+xfs (decryption reaches XFS, 105 bits), LUKS2 O1+O2+O3:luks-digest+pagecache-pair, VeraCrypt O1+O3:pagecache-pair (before O3 it was O1:schedule). --export dmsetup is byte-identical to the guest’s dmsetup table --showkeys.

--nosymbols. Without the walk, the plugin (the mode lives in linux/dmcrypt_nosym.py, imported lazily by dmcrypt.py) scans the physical layer (the layer under the kernel’s virtual layer, or the bare primary layer when no symbol table matched: kernel stays a required requirement so that the layer stacker runs, and DmCrypt.unsatisfied waives it only for this mode once a memory layer is set). The scan is a vol3 ScannerInterface (16 MiB chunks, 1 KiB overlap, stride 4 because key_enc is a u32 array) whose offset finder is MemDiver’s numpy find_aes_schedules (forward, natural byte order) when importable, else secrets/aes_scan.candidate_offsets: bytes 0 to 2 of the first derived word w[Nk] = w[0] ^ SubWord(RotWord(w[Nk-1])) ^ Rcon[1] are evaluated for every offset at once as one big-integer XOR of three shifted copies of the chunk (one through bytes.translate(SBOX)), re finds 01 00 00, byte 3 is checked per hit. Every proposed offset is confirmed by the full schedule (_schedule_at, the same check the walk uses), so both finders give identical hits. The same pass finds the LUKS magics and LUKS2 JSON starts (bytes.find per needle per chunk, hits in the overlap left to the next chunk), so the physical layer is read once and --nosymbols-max-bytes bounds the LUKS search too. Pairing: XTS by the data/tweak distances of the two-slot drivers in AES_CTX_LAYOUTS (496 tweak-first for __xts-aes-aesni, 488 data-first for xts-aes-ce) plus 484 (packed, half order unknown: both orders are tried); ESSIV by by_key[sha256(data key)]. Copies of one key count once. Binding is O2 only: the LUKS hits are indexed without a wanted-UUID filter, each resident UUID’s first parsed header gives cipher, key size and pair kind, and fitting candidates (kernel ctx first) are tested through prove_o2 with at most 64 PBKDF2 runs per UUID. A digest match is the only way to proven; every other pair is unverified:nosymbols, never exported without --export-unverified. O3 is not attempted: it needs the backing device’s page cache, which only the walk can reach. Bounds: --nosymbols-max-bytes, at most 200,000 confirmed schedules (past that the pass keeps looking for LUKS headers only), the LUKS caps above. Measured on the x86_64 4-level, LA57 and v2b captures (see Test Captures; Volatility 2.27.0 and 2.28.2, identical): LUKS1 and LUKS2 O1+O2:luks-digest with the ground-truth keys, the VeraCrypt key among 9 unverified:nosymbols XTS pairs (8 others, such as fscrypt), 0 false proven; 85 to 429 schedules; the scan of 6 GiB of physical address space takes 14 s with numpy and 38 s with the stdlib finder (same rows), about 20 s in total with the LUKS search and PBKDF2 (31 s when the LUKS search was a second pass over the layer; Volatility 2.28.2, same rows). Without any ISF the rows are the same.

An earlier bug is worth recording because only a real run found it: on x86 the LUKS1 O1 initially failed because the ESSIV assembler picked the IV-key schedule (SHA-256 of the key, in a separate aes-aesni cipher) as the data key.

Serpent and Twofish. Both ciphers are proven in XTS and CBC mode with the IV modes plain64, plain, plain64be and essiv:<hash>. The primitives are pure Python and standard-library only, because no library accelerator exists for them (cryptography has neither): serpent.py (Linux byte order, which is the NESSIE order; lane-packed bitsliced ECB, about 0.3 ms per 4 KiB), twofish.py (about 3.3 ms per 4 KiB) and blockmodes.py (dm-crypt XTS and CBC and the kernel IV generators for any 16-byte block cipher, which is passed in). The key is inverted from the context: serpent.key_from_ctx reads it back from the post-S-box subkeys of struct serpent_ctx and self-checks the inversion with 124 recurrence equations; twofish.key_from_ctx runs a meet-in-the-middle on the h() byte chains of struct twofish_ctx (milliseconds for 128 and 192-bit keys, about 0.9 s for 256-bit keys) and confirms the key by recomputing the whole context. On x86 the kernel keeps the generic crypto/xts.c template for these ciphers (XTS was dropped from the x86 Serpent and Twofish glue in Linux 5.12), so the data key (first half) and the tweak key (second half) are in two separate transforms; the plugin follows the template’s pointers and takes the half order from the slot. When LUKS2 uses the kernel keyring, crypt_config.key is wiped and the key is rebuilt from serpent_ctx or twofish_ctx. The ESSIV salt context (keyed with H(key)) is never reported as a volume key. O3 decrypts through blockmodes for Serpent and Twofish; AES keeps its OpenSSL fast path. A cipher string in the kernel-API form capi:<chain>(<cipher>)-<iv> is accepted (before, every capi: string was rejected, AES included). The decryption is checked against 66 Serpent and Twofish vectors written by a real Linux 6.12 dm-crypt (tests/fixtures/dmcrypt_kernel_vectors/, 114 vectors with the 48 AES ones); all decrypt and re-encrypt exactly.

Cascades. A VeraCrypt cascade such as AES-Twofish-Serpent opens as stacked dm-crypt devices (cryptsetup tcrypt: <name>_2 with AES on the loop device, <name>_1 with Twofish, <name> with Serpent on top; every layer has the same iv_offset). The plugin links the layers by dev_t (gendisk.major/first_minor against the upper target’s dm_dev.name) and proves the chain at once: the bottom layer’s ciphertext (the loop backing file’s page cache), decrypted bottom to top with each layer’s key, must equal the top layer’s page cache. A pass makes every layer proven with the label O1+O3:<evidence>:cascade(<n>); a mismatch gives conflict:pagecache on all layers; a layer without a key leaves the others unverified:partial-key. Rows stay one per device, and the exports are unchanged.

--nosymbols with Serpent and Twofish. The same physical pass also scans for Serpent and Twofish contexts (prefilters about 30 ms and 15 ms per 16 MiB). Their XTS halves come from separate transforms, so no fixed distance pairs them: same-cipher pairs are tried against a resident LUKS header’s digest (at most 64 PBKDF2 runs per header) and a match is O1+O2:luks-digest. Keys without a LUKS header stay unverified:nosymbols. On a real 4 GiB image the scan went from 29 s to 36 s; the total wall time was unchanged (about 132 s).

Results on capture v2e (x86_64 4-level, stock Volatility 2.27.0 and 2.28.2, identical): all 9 devices proven, every key equal to the ground truth. LUKS2 Serpent-XTS and Twofish-XTS (512-bit, kernel keyring) O1+O2+O3:luks-digest+pagecache-pair, plain Serpent-CBC-ESSIV O1+O3:pagecache-pair, the three cascade layers O1+O3:pagecache-pair:cascade(3). With --nosymbols the four LUKS keys (AES XTS, AES CBC, Serpent, Twofish) are proven with the right keys and nothing is falsely proven. make validate checks this on capture v2e (Validation).

linux.wireguard

The WireGuard protocol specification describes the handshake and transport messages.

Walk. net_namespace_list to every struct net to dev_base_head to each net_device whose rtnl_link_ops->kind is wireguard; wg_device = netdev_priv(dev) = dev + ALIGN(sizeof(net_device), 32), accepted only when the back-pointer wg_device.dev == dev holds. The module’s own device_list is walked too and merged. wg_device.peer_list leads to each wg_peer (back-pointer wg_peer.device), its noise_handshake, its three keypair slots (back-pointer entry.peer), its endpoint and its allowedips_list. sizeof(net_device) differs by kernel: a measured table gives 2512 bytes for Ubuntu 6.8.0-31 to -117 and 2544 for -136 and -149; the ISF always wins.

Proofs (memory only).

Name

Check

O_id

X25519(static_private)·G == static_public, after a clamp prefilter; if the table offset fails, the 64-byte block {public, private} is searched in the wg_device allocation. A forged block whose public is not f(private) is a conflict.

O_mac1

BLAKE2s("mac1----" ‖ static_public) == cookie_checker.message_mac1_key (device) and the same over the peer public (peer): binds a public key to a second, independent location

O_dh

X25519(static_private, remote_static) == precomputed_static_static, with small-order and non-canonical rejection. A proven identity plus O_dh proves the peer public key.

O_ck

the Noise_IKpsk2 chaining key is recomputed for a handshake in flight. CREATED_INITIATION proves the local ephemeral; CONSUMED_INITIATION proves only the remote ephemeral, and the stale local one stays unverified

Preshared key. No oracle judges it. It is reported PSK:bound-to-proven-peer when it sits in the handshake of a proven peer and its offset is backed by a built-in BTF entry or trusted in-memory BTF (in-memory BTF is trusted like a table entry by decision). A user-supplied --offsets value that differs from the built-in entry makes the PSK unverified. The kernel mixes the preshared key into the chaining key only after the ephemeral-ephemeral Diffie-Hellman, and handshake_zero() wipes both ephemeral private keys and every pre-PSK chaining key as the session begins, so no value that depends on the preshared key can be recomputed from memory. Only a dump that catches a handshake mid-flight could prove it: an initiation in flight with its type-2 response still unconsumed in memory, or the microsecond-long CREATED_RESPONSE / CONSUMED_RESPONSE states. None of the 7 x86 captures has either: the preshared-key peer’s handshake is zeroed at both ends (14 of 14), and a mac1-checked scan of every raw image finds no type-2 response at all. mac1 and cookies are keyed by the static public key, not by the preshared key, and proven transport keys (KDF2 of the final chaining key) cannot be inverted.

Transport keys (noise_keypair.sending and .receiving) cannot be proven by re-derivation: the chaining key they derive from is zeroed when the session begins. They are proven by O_pkt instead (proof class D; checked on the six public reference captures): a WireGuard data message (type 4, receiver_index, counter, ChaCha20-Poly1305 with empty associated data) that is still in memory, whose Poly1305 tag the key reproduces. One pass of a multi-pattern scanner over the memory layer looks for 04 00 00 00 || LE32(index) for every keypair index. A message to index X is sealed with the receiving key of the keypair whose local index is X and the sending key of the keypair whose remote index is X, so the local index proves recv and the remote index proves send. Each hit is tried in three layouts: plaintext (decrypted in place by the receiver, the original tag stays after it, so the tag is recomputed by re-encryption), ciphertext (as on the wire) and keepalive (header and tag only). A row is proven only when every nonzero key in it is proven. Absence is never evidence against a key: no hit, or a hit whose tag does not verify (buffer reused), leaves the key unverified. With both tunnel ends in one image, one packet proves one end’s recv key and the mirror end’s send key. The scan is on by default and costs about 1.7 to 2.3 s on a 4 GiB image; --no-packet-residue skips it, and every transport key is then unverified and reported with provenance (is_valid, birthdate age, index pairing, and the mirror keypair). The evidence (layout, counter, physical address, number of copies) is in the Detail column and the JSON export.

Zeroing semantics explain missing material. handshake_zero() wipes the ephemeral keys, hash and chaining key as soon as a session begins, so an ephemeral private key exists only while a handshake is in flight (for example an unreachable peer being retried). remote_static, precomputed_static_static and preshared_key persist for the peer’s lifetime. Peers are freed with kfree_sensitive(). All keypairs are wiped after 540 s without a new handshake.

Results on the real capture: two interfaces and two identities proven (O_id, O_mac1, back-pointer), three of three peers proven, the in-flight ephemeral of a third peer proven by O_ck, two PSK:bound-to-proven-peer. Transport keys are covered by the O_pkt measurements below. Every exported key was found verbatim in the guest’s own record. Wall time is about 7 s on a warm cache (in-memory BTF adds about 0.3 to 0.6 s: 7.0 to 7.3 s against 6.7 s with it off).

linux.keyring

The walk reads the key_serial_tree, then each struct key with offsets from the ISF, then key_type.name. Payload decoders: user and logon (user_key_payload), 740-byte eCryptfs auth_token, struct fscrypt_key for logon fscrypt:<descriptor>, and cryptsetup volume keys. On the first real capture 65 of 67 keys of the guest’s /proc/keys were reproduced by serial, type and description (the two missing were probably garbage-collected before the dump), plus 11 other users’ keyrings that /proc/keys hides from root. Cross-proofs:

  • eCryptfs: the token’s signature (ecryptfs-sig) and the FEKEK equal the ground truth.

  • dm-crypt: a user cryptsetup:<uuid>-d0 key (present when LUKS2 is opened with --link-vk-to-keyring) is compared with the key linux.dmcrypt proves. A bug found on the second capture: the first version accepted only logon keys, but cryptsetup links a user key.

  • fscrypt v1: the descriptor equals SHA-512(SHA-512(key))[:8], the one-way rule used by e4crypt, fscryptctl and fscrypt.

linux.fscrypt

The Linux fscrypt documentation describes the v1 and v2 policies and their key derivation.

Walk. super_blocks to s_master_keys (fscrypt_keyring hash table) to fscrypt_master_key to mk_decrypted_inodes.

v1. The raw key is resident. The per-file key is derived again from it and the inode’s nonce and compared with the AES schedule in the inode’s transform (+per-file-schedule). When the descriptor was derived from the key, it is checked too (descriptor).

v2 and HKDF midstates. The kernel wipes the raw master key and keeps only HKDF-Extract’s output as a keyed HMAC-SHA512 transform. The plugin reads the inner and outer SHA-512 midstates out of the hash transform. Three layouts exist by kernel: hmac_pads (up to 6.6), hmac_ctx (6.7 to 6.16, 208/209-byte state) and hmac_sha512_key (6.17 and later). It re-derives the key identifier with HKDF-Expand context 1 from the midstates and compares it with mk_spec.identifier (oracle:identifier), then re-derives each file’s key (context 2 with the file’s nonce) and compares it with the inode schedule. The SHA-512 compression with midstate injection is a short stdlib routine (0.12 ms per compression). The userspace mount proof decrypts a v2 directory from these midstates alone (see Validation).

Real results: both captures, both Volatility versions: v1 and v2 proven, 5 of 5 inodes per policy, v1 key, v2 midstates and identifier all equal the ground truth. On the second capture the v1 descriptor oracle also fires (oracle:descriptor+per-file-schedule), because that capture’s descriptor was derived from the key.

linux.ecryptfs

Walk. superblocks whose s_type->name == "ecryptfs" to s_inodes to ecryptfs_inode_info.crypt_stat. Root IV: MD5(FEK)[:iv_bytes] == root_iv (applied only for iv_bytes == 16; for other sizes the rule proved wrong FEKs 86 times in 20,000 and 0 times after the restriction). Tag 3: the lower file’s page 0 (read through the page-cache walk) carries an encrypted FEK packet; it unwraps under the FEKEK, whose signature the keyring row proves. The tag-3 pass binds a keyring token to the file, so a tag-3 failure with a passing root IV keeps the FEK proven but marks the pairing unconfirmed in MountAuthTok. Any guessed offset or size demotes the row to unverified, never rejected.

Real results: 16 of 16 rows (4 files, 2 captures, 2 Volatility versions) oracle:ecryptfs-root-iv+tfm-schedule+ecryptfs-tag3; the salt and tag-11 signature equal the sidecar; page 0 was resident in 16 of 16.

Stackers: 5-level paging (LA57)

LinuxLA57IntelStacker (stacking order 36, after the stock LinuxIntelStacker at 35 and the VMCOREINFO stacker at 34) acts only on the exact stock LinuxIntel32e or Intel32e classes and runs only if the installed Volatility lacks intel.LinuxIntel32e_LA57. Two layer classes exist: LinuxIntel32eLA57 (46-bit page-frame numbers, conditional) and Intel32eLA57 (52-bit, the VMCOREINFO path the reference capture uses). A banner and init_task.comm read-back decides whether the 5-level layer is right; the tie case reads __pgtable_l5_enabled. The layer pickles through a module-level rebuild factory, so --parallelism processes works as long as memdiver is importable in the worker processes. Replaying a saved configuration (-c) needs -p, as the class lives in this directory.

Corpus result against upstream pull request #1991 is in Upstream. With the stacker, stock Volatility 2.27 on the 5-level reference capture lists 155 processes in 6.8 s, with PID and name columns identical to the pull request build; on the 10 four-level images nothing changes.

Process plugins

memdiver.ssh

The plugin reads the writable mappings of a process (keys never live in read-only file mappings) up to --max-mb. On an image the default selection is the OpenSSH/Dropbear/wolfSSH servers (sshd, dropbear, …) and the OpenSSH/Dropbear clients (ssh, dbclient, …); a program built on an SSH library runs under its own name (Paramiko as python3, a libssh program under its own) and is selected with --comm or --pid (a union). Each implementation has a locator:

Implementation

Structure

Tier on the evidence we have

libssh

ssh_crypto_struct: shared_secret, secret_hash, session_id, six raw keys in one struct

A, proven on a Docker capture and on the x86 full image

wolfSSH

WOLFSSH.k, .h, .sessionId

A, proven

Go x/crypto/ssh

kexResult{H, K, SessionID} and the ChaCha20-Poly1305 cipher (length key first)

A, proven

Paramiko

Transport.K (an int, until NEWKEYS sets it to None), else the encoded K its exchange-hash input left resident; .H / .session_id bytes objects

A, proven on the x86 images (v2b and v2c: all 16 sibling clients and v2c’s server, from the encoded K) and on the arm64 server slice; a server whose encoded K is gone too (v2b) only peer-bound to its client in the same run

OpenSSH

newkeys[MODE_MAX] to sshenc{key_len, iv_len, block_size, key, iv}

B (client and sshd agree per direction; K is wiped): AES keys and HMAC-SHA2 keys oracle:derived-state; ChaCha keys oracle:derived-state when the cached key-stream block of both halves is resident, else oracle:packet-residue (mode P) when a leftover packet is (OpenSSL 3 PROV_CHACHA20_CTX); IVs unverified; role from session_state.server_side

Dropbear

ChaCha20 state pair or AES schedule

C: AES keys oracle:derived-state (word-swapped libtomcrypt schedule); a server’s AES-CTR schedule inside a key_context half (ses.keys points 0x140 bytes before it, trans 4616 = 0x1208 bytes after recv, libtomcrypt CTR header at the cipher state) gives the row its direction (aes*-ctr) and the half’s MAC key (mackey, schedule + 0x10a0, length from its zero tail; proven memory-only, oracle:packet-residue on v2b/v2c), no peer needed; otherwise letter and direction only when its client is in the same run and proves them (peer-bound:<pid>, which also binds its MAC keys); ChaCha keys oracle:derived-state when the cached key-stream block of both halves is resident, else oracle:packet-residue (mode P) when a leftover packet is (libtomcrypt chacha_state tail); recv/trans from ses.keys

libssh2

AES schedule

C; tested with synthetic data only

The Tier A oracle (ssh-kdf-consistency). Given K (as mpint), H and session_id found together, derive the six keys A to F of RFC 4253 section 7.2 with hashlib, and count how many of them occur in the same memory. Two or more distinct letters mean proven: each match is a prefix of at least 96 bits of an independent SHA-2 output, so two cannot match by chance. Zero matches from a trusted structure give rejected. Exactly one match is “inconclusive” and never promoted. IV, key and MAC lengths are taken from the negotiated cipher (see below), not from how far a memory match ran; an early version took lengths from the match and produced a 32-byte IV where the ground truth is 16.

Memory-only proofs for tiers B and C (proof class D, vol3plugins/memdiver/ssh_memproof.py). An AES key row is tried with derived-state (its schedule after round key 0, natural or word-swapped), then packet-residue mode C with the process’s MAC-key rows; an HMAC-SHA2 key row with its ipad/opad midstates, then mode A, then mode C with the process’s AES-key rows. The logic is the same code as the format oracles (vol3plugins/linux/secrets/state_proof.py, residue_proof.py). A proof means “a live key of this algorithm in this process”; tier, direction and role stay what the structure said. Nothing found leaves the row unverified, never rejected. Bounds: 64 candidate rows and 64 partners per process, 30 s residue budget per process.

Paramiko after NEWKEYS. _parse_newkeys sets Transport.K = None, so the int object is freed. The encoded K (mpint) that Paramiko serialised into its exchange-hash input stays resident: that buffer’s tail string(Q_C) string(Q_S) mpint(K) survived in 17 of the 18 Paramiko processes of v2b and v2c (all but v2b’s server). Every encoded K in the process is paired with every live hash-sized bytes object (H and session_id stay live), the candidates that end an exchange-hash input first; these tuples come before the int x bytes ones, because the sweep stops after 50,000 tuples and a Python process already offers about 40,000 to 210,000 int x bytes tuples. About 7 to 8 s per Python process. The Wireshark cookie of such a session is a live KEXINIT bytes object referenced from the attribute storage that references H (a freed KEXINIT is referenced by nothing).

Both ends of a connection (peer-bound:<pid>, bind_peers in ssh_engine.py). After all selected processes are analysed, each process without a Tier A proof of its own is read again when another process of the run proves keys by Tier A: a C/D key binds when it is an unbound tier C row or its cipher state (AES schedule, ChaCha20 blocks) is resident; the session’s E/F only when their bytes are present and its C or D was bound. The row takes the proven key’s letter, direction and algorithm, stays tier C, and is never a KDF proof in this process. A freed bytes object is recognised with cpython_heap (pymalloc pool walk: the free-list link overwrites only the first word). On v2b the libssh client’s Paramiko server, whose K is gone, gets C-F this way. The Dropbear sibling servers no longer need it: their AES-CTR and MAC keys carry the direction of their own key_context half and prove memory-only, so nothing is bound there.

Negotiated algorithms. For libssh the kex_methods string-pointer array near the anchor names the algorithms; for OpenSSH the sshenc record at the matched key does. Both are reported as lengths: negotiated(libssh|openssh) in Detail. Go and wolfSSH remain inferred, because Go’s algorithm names live in .rodata, which the writable-only scan does not read.

Real results. Tier A proven with keys equal to the implementation’s own ground truth: Go x/crypto (ChaCha20-Poly1305 and AES-GCM), libssh A to F, wolfSSH A to F, on arm64 Docker .msl captures. On the x86_64 full image, a libssh 0.10.6 client (aes256-ctr, hmac-sha2-256) gives 6 of 6 oracle:ssh-kdf-consistency, byte-equal to the guest’s record (0.1 to 0.2 s of plugin analysis); its Paramiko server peer gives 0 rows on its own (no K, not even encoded) and peer-bound C-F with its client in the same run. Every Paramiko sibling client proves A to F by Tier A from its encoded K, equal to the sidecar (8 per image, v2b and v2c). On the x86 LiME images OpenSSH is Tier B and Dropbear Tier C. Their AES keys are proven by derived state when the AES schedule is resident, and OpenSSH HMAC-SHA2 keys when the HMAC midstates are resident (see the memory-only proofs above); ChaCha20-Poly1305 keys are proven by the cached key-stream block of both halves (on v2b and v2c, 10 of 10 per capture, oracle:derived-state; a leftover packet proves the same keys by packet-residue mode P when no block is cached); all IVs of tiers B and C stay unverified; Dropbear MAC keys are located only peer-bound, with the session’s client in the same run.

memdiver.wireguard_go

The plugin finds the Device.staticIdentity structure by a layout-free adjacency (the public key sits right after the private key), then the peers’ Handshake structures through the Peer.device back-pointer, with a layout-free adjacency fallback (--no-fallback disables it). Offsets come from wireguard-go commit f333402 and were checked against memory. A peer is trusted when both the device back-pointer and the mac1-key adjacency hold.

Proofs: x25519-pubkey (static key), x25519-dh-consistency (peer), and noise-chaining-key (ephemeral in initiationCreated, and the PSK in responseCreated, because the PSK is an input of that chaining key). Transport keys are proven by O_pkt (oracle:packet-residue, the oracle of linux.wireguard): a WireGuard data message in the same process’s memory whose ChaCha20-Poly1305 tag the key reproduces. The search needle is 04 00 00 00 || receiver_index from the keypair’s own indices: the remoteIndex proves the send key, the localIndex the receive key; with no index available the plugin falls back to an index-free site scan. wireguard-go residue is always in the ciphertext or keepalive layout (never decrypted in place). A proven key has the verdict oracle:packet-residue; Detail starts with a stable label (O_pkt(recv+send), O_pkt(send); recv:unverified (no packet residue found)); --no-packet-residue opts out; absence of residue is never evidence against a key. The PSK is bound:peer-handshake only when bound to a trusted, proven peer.

Exit criterion met: on all 112 archive dumps (4 runs, 2 roles, 14 lifecycle dumps each) the static key and the peer are proven and equal the in-process keylog; 0 rejected. A real PSK run (a rig run with a configured preshared key) gives the PSK as oracle:noise-chaining-key equal to the ground truth in the 2 responder responseCreated dumps. Initiator ephemerals in consumed-handshake dumps are unverified, as expected.

Transport-key results: on 140 corpus dumps (5 runs x 2 roles x 14 phases) the proven keys equal an independent cryptography census; the 40 pre-key dumps give 0 proofs, and all 4 transport keys are proven for each of the 10 run/role pairs. Under vol 2.27.0 and 2.28.2 the 10 post_active slices used by make validate prove both epoch-0 keys. The in-repo sample wireguard_go_initiator.msl.gz proves both its send and its receive key. The search adds about 0.2 s per slice.

The .msl layer and slim reader

See The .msl layer.

Oracle cost budget

Every format oracle declares COST_US, the measured cost of verifying one wrong candidate, plus optional prefilter and unique. The synthesized-plugin template uses them as follows.

  • --oracle-budget SECONDS (default 120; 0 means unlimited) counts only oracle time; the deadline restarts for each scan target (process or slice).

  • Candidates are filtered, passed through the oracle’s prefilter, and ordered: anchor hits first, then locator order, then entropy candidates. The plugin logs one estimate line, then verifies until the budget runs out.

  • Leftovers become unverified with a budget: detail. When the oracle declares itself unique (one key per artefact, as for gocryptfs) and a key is already proven, the rest are unverified with skipped: key already proven. A budget never produces rejected.

Measured on real data: --oracle-budget 0.001 leaves 196,686 candidates unverified and the 2 proven rows unchanged. Wrong-key verification cost of the gocryptfs oracle (AES-GCM / XChaCha20 / AES-SIV): cryptography 5.8 / 12.6 / 14.9 µs, pycryptodome 47 / 27 / 116 µs, pure Python 159 / 106 / 402 µs. The worst entropy sweep on pure Python (89,000 candidates) took 16 s. The LUKS oracle is the expensive one (COST_US = 200000, one PBKDF2 per candidate), which is why it runs only on prefiltered candidates.

Known limits

Collected from the “open” lines of the execution log. None of these changes a proven row; they bound what the suite can find.

Platform

  • Stock Volatility 3 (2.27.0, 2.28.x, and PR #1991) has no AArch64 Linux layer. The only one we know is a third-party fork, volatility3-arm64 of eurecom-s3, which we used for development. The reference captures are x86_64.

  • AArch64 is development-only. O3 (page-cache proof) needs page.to_paddr, which Volatility does not have on AArch64, so O3 is not applicable there.

  • A Linux image whose kernel has no kallsyms cannot be fixed on Volatility 2.27: no kernel layer is built at all.

dm-crypt and keyring

  • linux.dmcrypt --nosymbols proves only LUKS keys whose header is resident in memory (O2). VeraCrypt and plain dm-crypt keys stay unverified:nosymbols, mixed with other XTS users such as fscrypt, because no symbol-free oracle can tell them apart. This includes every non-LUKS Serpent or Twofish key: its halves are paired only through a LUKS header digest. Pairing knows the x86 AES-NI (v6.8 layout) and arm64 CE contexts and packed neighbours; a generic xts(ecb(aes)) template keeps its halves in two separate allocations, which are found as unpaired schedules and are not listed.

  • A LUKS2 dmsetup replay needs the recovered key to be loaded into the keyring under the name in the table line.

  • AES-192-XTS (48-byte keys) is decrypted by building XTS from AES-192 ECB, because OpenSSL implements XTS only for AES-128 and AES-256 (as IEEE 1619 defines it). Linux and cryptsetup accept it (LUKS1 -s 384; LUKS2 also needs --keyslot-key-size 512). The same path handles keys with equal halves, which OpenSSL refuses. Every key size and IV mode (plain64, plain, plain64be, essiv:sha256) is checked against vectors written by a real Linux 6.12 dm-crypt (tests/fixtures/dmcrypt_kernel_vectors/, regenerated and compared by make_vectors.py --check). On real memory (capture v2d, x86_64, kernel 6.8), linux.dmcrypt proves a LUKS2 AES-192-XTS key (O1+O2+O3) and a plain AES-192-XTS key with 4096-byte sectors and iv_large_sectors (O1+O3) under Volatility 2.27.0 and 2.28.2, and --nosymbols proves the LUKS2 one through its header (O1+O2).

  • Serpent and Twofish run in pure Python only; no library accelerator exists for them. Other VeraCrypt ciphers (Camellia, Kuznyechik) and the dm-crypt IV modes benbi, null, lmk, tcw and eboiv are not supported. The xts-fsmagic oracle does not handle cascades; a cascade is proven only by linux.dmcrypt through the page cache.

  • No cryptsetup: logon key survives in the key tree on the first captures (cryptsetup unlinks it), so the first dm-crypt cross-proof ran on injected records; on the second capture the linked user key makes it real.

  • The veracrypt-header oracle was cut: the header is encrypted under a password-derived key. VeraCrypt is proven through xts-fsmagic and O3.

WireGuard

  • The no-symbols fallback exists only for linux.dmcrypt (--nosymbols); linux.wireguard has none.

  • The kernel preshared key is bound-to-proven-peer, not oracle-proven (the preshared-key peer’s handshake is zeroed on every capture; see Preshared key). Transport keys are proven only by leftover data messages (O_pkt): the current-slot keypair is proven in both directions on 7 x86 captures (the six published ones plus v2, which is kept local; vol 2.27.0 and 2.28.2); previous-slot keys are proven on v2c and v2e, in one direction per end on v2 and v2b, and not at all on v1, LA57 and v2d, where no packets were left. All residue found is in-place-decrypted 96-byte ICMP (the rig’s tunnel pings). TX-ciphertext residue on a lone host (one tunnel end per machine) was measured on one AArch64 capture taken with acquire_dump.sh --wg-lone-host (interface gtwgL in the guest, its peer a Docker container on the capture host, so the mirror is not in the image; kept local, not published): the current send key is proven by two outgoing packets left encrypted in place (ciphertext layout, counters 8 and 9) and the current recv key by eight received plaintext packets; the previous keypair left no residue. An independent cryptography census agrees (12 of 12 index sites verify, each only under its own key; 0 hits for a random key). The in-image captures (both tunnel ends in one VM) hold no ciphertext-layout packet (census of v2b, v2c and the AArch64 capture), so there the send key is proven only through the mirror. One capture is not a rate: TX residue depends on buffer reuse just like RX residue. Proof needs traffic recent enough that the skb buffers are not reused. On the one AArch64 capture (ubuntu-24.04-secrets_6.8.0-136-generic, run with an AArch64-capable vol 2.10.0 fork, since stock vol has no AArch64 layer) the plugin runs unchanged in 80 s: the current keypair is proven in both directions (plaintext residue, counters 6 and 8), the previous keypair (age 129 s) stays unverified with no residue left. A direct residue_proof search of the raw image bytes proves the same two keys, so the packet layout holds on AArch64. make validate does not check this. No kernel WireGuard keylog exists on the capture (it would need kprobe or eBPF), so the transport keys have no independent ground truth, and transport keys do not prove the preshared key (that derivation needs the zeroed ephemerals; see Preshared key above). The shared search needs the keypair indices on a full image: without them its default site cap (4096) fills long before the packets (666,433 header-shaped sites on the AArch64 image). The plugin always passes the indices.

  • wireguard-go: the PSK paths other than the real responseCreated case, the rejected paths, the --pid image mode and x86_64 or Tailscale layouts were tested with synthetic data only.

fscrypt and eCryptfs

  • The fscrypt 6.16 and later paths (bytes and is_hw_wrapped handling, hardware-wrapped keys under identifier context 8, the 6.17 and 6.18 layouts) were tested with faked structures only. DIRECT_KEY and IV_INO_LBLK per-mode keys are not checked.

  • eCryptfs: the tag-1, AES-128, AES-192, two-byte length, xattr-metadata, non-resident and pairing-fail paths are synthetic-only. On the second capture the lower file’s page 0 was not resident, so tag-3 does not fire there.

SSH

  • Paramiko drops K after NEWKEYS; it is proven from the encoded K its exchange-hash input left resident, and a process where that is gone too (the v2b Paramiko server) has no proof of its own, only peer-bound keys when its peer is in the same run. Its --export keylog MODE assumes a client (a python3 process has no role). libssh2 is synthetic-only. OpenSSH and Dropbear on the x86 images have K wiped; their AES keys and OpenSSH’s HMAC-SHA2 keys are oracle:derived-state when the schedule or midstates are resident, ChaCha keys are proven by their cached key-stream blocks or a leftover packet, while IVs stay unverified. There is no x86 Tier A capture for Go or wolfSSH.

Synthesis

  • A recipe locator is an anchor pattern, an entropy scan or a pointer_path. The kinds yara, artifact_window, aes_schedule, pubkey_adjacency and kernel_struct are reserved and not implemented. The candidate layout is one key or, for multi-key plugins, several labelled keys.

  • Full-image synthesis (--pid on a kernel image) is proven by held-out runs on captures v2b and v2c for SSH (dropbear, OpenSSH) and gocryptfs (Validation), including gocryptfs from memory alone. The LUKS oracle works end to end but needed --allow-high-entropy-context for LUKS1 and a 1,024-byte context for LUKS2 (which gives a YARA rule libyara will not match).

  • Static oracle context values are JSON, so oracles that need byte context would need hex decoding; cancellation is checked between steps only.

Interface

  • Plugin path arguments such as --offsets and --oracle-sample are not sandboxed by Volatility; they are read as given. The wrapper memdiver vol3 exec refuses Volatility global options and ; in paths, but passes a plugin’s own path arguments through unchecked.

  • A scan of a .msl misses a needle that starts in captured bytes and ends in NotResident pages (Volatility’s scanners do not carry overlap across non-contiguous segments). Reads across that edge are correct.