Hacking the Xbox 360 Hypervisor Part 2: The Bad Update Exploit
The Xbox 360 hypervisor's encrypted memory could be overwritten with attacker-controlled ciphertext by abusing the HvxEncrypted* APIs to generate ciphertext for arbitrary plaintext and the HvxKeysEx* APIs to write it to read-only memory. An attacker with kernel-mode code execution could then run arbitrary code in hypervisor mode.
icode4.coffee
Published on icode4.coffee
Welcome to part 2 of the Hacking the Xbox 360 Hypervisor blog series. In this part I’ll cover how I found and exploited bugs in the Xbox 360 hypervisor to get full code execution and create the “Bad Update” exploit.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the hypervisor exposed system calls that let kernel mode generate ciphertext for arbitrary plaintext and write it to any unprotected physical address, defeating the read-only and encrypted protections on executable memory.
Impact
An attacker who already has kernel-mode code execution could escalate to hypervisor-mode code execution, fully compromising the console's security.
What the attacker needed
Kernel-mode code execution on the console; a modified console for testing; ability to load a signed executable
How it was found
- Load an executable such as the boot animation dll in a suspended state and pick a 64KB page of its code to overwrite.
- Read 16 bytes of the original code at the target address to use as oracle data and record the physical address.
- Loop 1024 times calling the encrypted allocation APIs to exhaust whitening values for the page.
- At around the halfway point, write the oracle plaintext through the encrypted view and read back the ciphertext through the unprotected view.
- Write the shell code plaintext through the encrypted view and capture its ciphertext the same way.
- Use the key store get/set APIs in a loop to copy the captured ciphertext over the target read-only memory, then execute it in kernel mode.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The Xbox 360 has a small, highly privileged program called the hypervisor that protects the console's security. The researcher found that two sets of special system calls could be combined to write attacker-chosen data into memory that is normally read-only and encrypted, letting them run their own code at the highest privilege level.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.