Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - heeeyaaaa/vmem-decrypt: Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image. · GitHub
Skip to content

Repository files navigation

vmem-decrypt

Decrypt the encrypted data files of a VMware Workstation / Fusion virtual machine - .vmem (saved RAM), .vmsn / .vmss (snapshot / suspend state) and .nvram - using only the VM password.

VMware forces "partial" VM encryption on Windows 11 guests that have a vTPM, which also encrypts the memory/snapshot files. That makes them unusable for memory forensics (Volatility, etc.) until they're decrypted. This tool reproduces VMware's encobj decryption in pure Python so you don't need ESXi or VMware's internal tooling for the decryption step.

Scope / honesty up front: this tool fully and correctly performs the decryption. For .vmsn / .vmss / .nvram the decrypted output is directly usable. For .vmem, VMware compresses then encrypts, so the decrypted memory is still in VMware's proprietary compressed checkpoint layout, which vmem_flatten.py then expands to a flat image. See Getting a Volatility-ready image.

Tested on: VMware® Workstation Pro 26H1, guest Windows 11 25H2 (build 26100), analysed with Volatility 3 (2.28). The encobj decryption and the block/LZ container were reverse-engineered against this build's vmware-vmx; very different VMware versions may use a different checkpoint format (the tools fail loudly rather than producing silent garbage, so you'll know).


How VMware encrypts these files

 STAGE 1 (password recovery) STAGE 2 (this tool)
.vmx ──VM-Password-Extractor──▶ $vmx$ hash ──hashcat──▶ password ─┐
▼
password ─PBKDF2-HMAC-SHA1(salt,10000)─▶ KEK
KEK[:32] ─AES-256-CBC─▶ keySafe dict ─▶ config_key (64 B)
config_key[:32] ─AES-256-CBC─▶ encryption.data ─▶ dataFileKey (64 B)
dataFileKey[:32] = AES-256-CBC key for .vmem/.vmsn/.vmss/.nvram

VMware labels every key XTS-AES-256, but it actually uses the first 256 bits as an AES-256-CBC key - it is not real XTS. (Real XTS will not decrypt these files; that trips up most people who try.)

encobj data-file layout (magic 0x8943dd9e, little-endian)

[0x000 .. 0x1000) 4096-byte plaintext header
u32 magic @0x00 = 0x8943dd9e
u32 version @0x04 (1 = vmsn, 2 = vmem)
u32 data_per_page @0x08 = 4064
u32 iv_size @0x0c = 16
u32 mac_size @0x10 = 16
u64 logical_size @0x18 (trim the decrypted output to this)
[0x1000 .. EOF) 4096-byte on-disk pages, each:
[ ciphertext : 4064 ][ IV : 16 ][ MAC : 16 ]
plaintext = AES-256-CBC( ciphertext, key = dataFileKey[:32], iv = the page's IV )

Install

git clone https://github.com/heeeyaaaa/vmem-decrypt
cd vmem-decrypt
pip install -r requirements.txt # just: cryptography

Usage

Stage 1 - recover the password (separate tools)

The .vmx holds a PBKDF2 verifier, not the keys. Extract it as a crackable hash and brute/dictionary-crack it:

# extract the hash from the .vmx (https://github.com/archidote/VM-Password-Extractor)
python3 VM-Password-Extractor.py --vmx VM.vmx --vmx-password-hash-to-hashcat
# -> $vmx$0$10000$<salt>$<hash># crack it with hashcat (VMware VMX = mode 27400)
hashcat -m 27400 hash.txt /usr/share/wordlists/rockyou.txt

(John the Ripper also works; the same $vmx$… hash is its VMware format.)

Stage 2 - decrypt (this tool)

# decrypt straight from the .vmx + recovered password
python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1.dec.vmsn --vmx VM.vmx --password 'P@ssw0rd'
python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1.dec.vmem --vmx VM.vmx --password 'P@ssw0rd'# or recover the key once and reuse it
python3 vmem_decrypt.py --vmx VM.vmx --password 'P@ssw0rd' --print-key
python3 vmem_decrypt.py VM.vmem VM.dec.vmem --key 151bcbc1...981f85
# inspect a file's structure without decrypting
python3 vmem_inspect.py VM-Snapshot1.vmem

Verify it worked: a correctly decrypted .vmsn/.vmss starts with a VMware snapshot magic (0xbed2bed2, also 0xbed2bed0 / 0xbad1bad1 / 0xbed3bed3), followed by a u32 group count and ASCII group names (Checkpoint, ConfigParams, memory, cpu, …).


Getting a Volatility-ready image

For .vmsn / .vmss / .nvram: the decrypted file is already in VMware's native format and is directly usable.

For .vmem: VMware compresses then encrypts, so the decrypted .vmem is still VMware's compressed checkpoint format. Expand it with vmem_flatten.py, then hand the result to Volatility together with the decrypted .vmsn:

# expand -- IMPORTANT: name the output <base>.vmem (NOT .raw)
python3 vmem_flatten.py VM-Snapshot1.dec.vmem out.vmem
# put the decrypted .vmsn beside it with the SAME basename, then run vol on the .vmem:
cp VM-Snapshot1.dec.vmsn out.vmsn
vol -f out.vmem windows.info # vol3 auto-detects its vmware layer from the .vmem/.vmsn pair
vol -f out.vmem windows.pslist

Why .vmem + a paired .vmsn, not a bare .raw? The flat image is region 0 (phys 0-3 GiB) followed by region 1 (phys 4-7 GiB) - there is a 1 GiB MMIO hole at 3-4 GiB, so file offset ≠ physical address. Volatility's vmware layer uses the .vmsn's memory group to remap the regions; feeding it the bare image as a raw layer fails the kernel/DTB validation. The .vmem/.vmsn naming is what triggers that layer.

The flat image is the concatenation of the 4 MiB physical blocks. The codec is a custom byte-oriented LZ77 reverse-engineered from vmware-vmx's checkpoint inflater - see docs/FORMAT.md for the full container + LZ grammar.

(ESXi's crypto-util encobj decrypt does decrypt and decompress in one step, if you have access to ESXi.)


Example run

Starting point: an encrypted VM you own - VM.vmx, VM-Snapshot1.vmem, VM-Snapshot1.vmsn - plus the VM password (recovered with VM-Password-Extractor

  • hashcat; see Stage 1).
$ python3 vmem_decrypt.py VM-Snapshot1.vmem VM-Snapshot1-dec.vmem --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmem: magic ok, version 2, 833440 pages, data/page=4064, trim->3387096127 11% (406404064 bytes) 95% (3251204064 bytes)[+] wrote 3387096127 bytes -> VM-Snapshot1-dec.vmem
$ python3 vmem_decrypt.py VM-Snapshot1.vmsn VM-Snapshot1-dec.vmsn --password 'S3cret-Pass!' --vmx VM.vmx[*] recovered dataFileKey: 7d9f2a…c41e8b[*] VM-Snapshot1.vmsn: magic ok, version 1, 1601 pages, data/page=4064, trim->6503245[+] wrote 6503245 bytes -> VM-Snapshot1-dec.vmsn

The .vmsn/.vmss is now directly usable. For the .vmem, flatten it and pair it with the decrypted .vmsn (same basename) for Volatility:

$ python3 vmem_flatten.py VM-Snapshot1-dec.vmem VM-Snapshot1-flat.vmem block 1400: in 0x9522d13f/a5506698, out 5871763456[+] 1552 blocks -> 6509559808 bytes flat image -> VM-Snapshot1-flat.vmem
$ cp VM-Snapshot1-dec.vmsn VM-Snapshot1-flat.vmsn # same basename, beside the .vmem
$ vol -f VM-Snapshot1-flat.vmem windows.info # vol3 auto-pairs via its vmware layerVariable ValueKernel Base 0xf80xxxxxxxxxDTB 0x1ae000Symbols …/ntkrnlmp.pdb/<GUID>-1/…Is64Bit TrueNtMajorVersion 10NtMinorVersion 0SystemTime 2026-06-24 18:23:11NumberOfProcessors 2

Status

FileDecryptVolatility-ready
.vmsn / .vmss✅ (native format)
.nvramn/a
.vmem✅ (via vmem_flatten.py, paired with the decrypted .vmsn)

Credits

License

Licensed under the MIT License.

About

Decrypt VMware vTPM-encrypted .vmem/.vmsn/.vmss/.nvram from the VM password, and flatten the .vmem to a Volatility-ready image.

Topics

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages