User User name Password  
   
Sunday 31.8.2025 / 04:35
Search AfterDawn Forums:        In English   Suomeksi   På svenska
afterdawn.com > forums > consoles > xbox 360 - modding & hacking > bugtraq: xbox360 hypervisor vulnerability - unsigned code on kernel 4532 and 4548
Show topics
 
Forums
Forums
BugTraq: Xbox360 Hypervisor Vulnerability - Unsigned Code on Kernel 4532 and 4548
  Jump to:
 
Posted Message
Junior Member
_
28. February 2007 @ 08:01 _ Link to this message    Send private message to this user   
Didn't see this posted here so thought id post it here myself :).

Quote:
BugTraq: Xbox360 Hypervisor Vulnerability - Unsigned Code on Kernel 4532 and 4548
>> This was posted moments ago on Security Focus' BugTraq list and looks like a follow-up to the anonymous 23C3 Hacker Congress presentation held end december. Looks like some huge news (Unsigned Code Execution in Hypervisor Mode) even if it's already patched by Microsoft in the latest kernel release:
[QUOTE]
Security Advisory: Xbox 360 Hypervisor Privilege Escalation Vulnerability

Release Date:: February 28, 2007

Author: Anonymous Hacker

Timeline:
* Oct 31, 2006 - release of 4532 kernel, which is the first version
containing the bug
* Nov 16, 2006 - proof of concept completed; unsigned code running in
hypervisor context
* Nov 30, 2006 - release of 4548 kernel, bug still not fixed
* Dec 15, 2006 - first attempt to contact vendor to report bug
* Dec 30, 2006 - public demonstration
* Jan 03, 2007 - vendor contact established, full details disclosed
* Jan 09, 2007 - vendor releases patch
* Feb 28, 2007 - full public release
Patch Development Time (In Days): 6

Severity: Critical (Unsigned Code Execution in Hypervisor Mode)

Vendor: Microsoft

Systems Affected: All Xbox 360 systems with a kernel version of 4532 (released Oct 31, 2006) and 4548 (released Nov 30, 2006). Versions prior to 4532 are not affected. Bug was fixed in version 4552 (released Jan 09, 2007 - not a Patch Tuesday).

Overview:
We have discovered a vulnerability in the Xbox 360 hypervisor that allows privilege escalation into hypervisor mode. Together with a method to inject data into non-privileged memory areas, this vulnerability allows an attacker with physical access to an Xbox 360 to run arbitrary code such as alternative operating systems with full privileges and full hardware access.

Technical details:
The Xbox 360 security system is designed around a hypervisor concept. All games and other applications, which must be cryptographically signed with Microsoft's private key, run in non-privileged mode, while only a small hypervisor runs in privileged ("hypervisor") mode. The hypervisor controls access to memory and provides encryption and decryption services.

The policy implemented in the hypervisor forces all executable code to be read-only and encrypted. Therefore, unprivileged code cannot change executable code. A physical memory attack could modify code; however, code memory is encrypted with a unique per-session key, making meaningful modification of code memory in a broadly distributable fashion difficult. In addition, the stack and heap are always marked as non-executable, and therefore data loaded there can never be jumped to by unpriviledged code.

Unprivileged code interacts with the hypervisor via the "sc" ("syscall") instruction, which causes the machine to enter hypervisor mode. The vulnerability is a result of incomplete checking of the parameters passed to the syscall dispatcher, as illustrated below.

Preconditions (registers set by unpriviledged code):
%r0 syscall no.
%r3-%r12 syscall arguments

Priviledged code:
13D8: cmplwi %r0, 0x61
13DC: bge illegal_syscall
...
13F0: rldicr %r1, %r0, 2, 61
13F4: lwz %r4, syscall_table(%r1)
13F8: mtlr %r4
...
1414: blrl

The problem is that the "cmplwi" instruction compares only the lower 32 bits of the given syscall number; the upper 32 bits are ignored. The "rldicr" instruction, however, operates on the complete 64 bit register value.

The syscall handler address is fetched from the syscall handler offset table at 0x00000000.00001F68+%r0*4. Setting the upper 32 bits of %r0 to something other than 0 will change the upper 30 bits of the address used for the syscall handler offset table lookup. We will now explain how the Xbox 360 security architecture interprets and aliases these upper bits.

When processing the syscall, the processor is running in "hypervisor real mode", with the MMU switched off. However, when accessing memory locations with the MSB cleared, an additional offset, the Hypervisor Real Mode Offset (HRMO), will be applied to all memory addresses.

Due to the Xbox 360 security architecture, main memory is aliased to different addresses with different properties, in order to conditionally enable the security features (encryption and hashing). The hypervisor sets the value of the HRMO special register so that the hypervisor code, including the syscall jump table, resides in memory which is hashed as well as encrypted, even when using zero-based addresses.

When accessing memory locations with the most significant address bit set, the HRMOR setting is not applied. Due to the bug in the "cmplwi" instruction, setting the corresponding bits in %r0 on syscall entry allows setting the MSB, thereby overriding the HRMOR setting and tricking the address lookup of the syscall handler to fetch from memory without any security features.

With the syscall handler offset table aliased to unencrypted memory, the syscall handler table can now be modified to direct the hypervisor to jump to any location in code space that is designated for the hypervisor.
In the proof of concept implementation, a jump to existing hypervisor code is used with a pre-loaded register value as a trampoline to force the ultimate execution path to an arbitrary, unencrypted and executable location in memory.

Proof of Concept Details:
As it is not possible to directly overwrite even non-priviledged code, existing code needs to be tricked into calling the hypervisor syscall with the desired register set. This can be done by setting up a stack frame and forcing a context switch to this stack frame. The bug can be exploited using the following series of physical memory writes:

Setup context switch to stack @80130AF0:
00130390: 00000000 00000000 00000000 FDFFD7FF MSR mask
00130360: 00000000 80130AF0 00000000 00000000 New stack pointer

Setup stack:
00130BD0: 00000000 80070190 00000000 00000000 NIP to context restore
00130C90: 00000000 00000000 80070228 80070228 NIP, LR after context
restore point to syscall
instruction in kernel
00130CA0: 00000000 00009030 00000000 00000000 MSR

00130B40: 20000000 00000046 00000000 80130af0 r0 = syscall nr
r1 = stack
00130B60: 80000000 address1 r4 = address to jump to

00002080: 00000350 points to mtctr %r4,
bctr in hypervisor code

Code to be executed should be placed at "address1", which can be an arbitrary unused memory address.

Example code to output '!' to the on board serial port:
1:
li %r3, '!'
bl putc
b 1b

putc:
lis %r4, 0x8000
ori %r4, %r4, 0x200
rldicr %r4, %r4, 32, 31
oris %r4, %r4, 0xea00
slwi %r3, %r3, 24
stw %r3, 0x1014(%r4)
1:
lwz %r3, 0x1018(%r4)
rlwinm. %r3, %r3, 0, 6, 6
beq 1b
blr

Vendor Status: Vendor was notified anonymously, and after cordial discussions a patch was promptly released.

Recommendation: Remove R6T3.


[/quote]Anyway the important part of all that is this guy got unsigned code running on the 360 :).

Sure it's a problem that MS has patched it in its new Kernel releases, but for the other hackers out there that has the exploited kernel they can use this to open the doors for new exploits for the rest of us.
Advertisement
_
__
Junior Member
_
28. February 2007 @ 13:58 _ Link to this message    Send private message to this user   
Wow i can't believe no one has replayed to this O_o.
Senior Member

1 product review
_
28. February 2007 @ 14:08 _ Link to this message    Send private message to this user   
and this affects about 1/100 of us here more than likely, until they run unsigned on all kernels, nothing big will come of it
Junior Member
_
28. February 2007 @ 14:55 _ Link to this message    Send private message to this user   
Originally posted by mikeismad:
and this affects about 1/100 of us here more than likely, until they run unsigned on all kernels, nothing big will come of it

Yes now it does..
But its still big.
Cos imo once the other hackers start using this on kernels that are at the right number they will have full access to the xbox 360.
And once they do they will be able to find new loop holes and stuff.
So saying nothing big will come of it is a very big understatement imo.
Senior Member

1 product review
_
28. February 2007 @ 15:23 _ Link to this message    Send private message to this user   
yes they will, but... they already patched it on the new kernels, and therefore there may be a few people that have the kernel that you can fully access but most of us dont, i know i got mine in December so i doubt mine has this kernel, and as far as we know, this may be as far as unsigned code goes on the 360
Junior Member
_
28. February 2007 @ 18:13 _ Link to this message    Send private message to this user   
Originally posted by mikeismad:
yes they will, but... they already patched it on the new kernels, and therefore there may be a few people that have the kernel that you can fully access but most of us dont, i know i got mine in December so i doubt mine has this kernel, and as far as we know, this may be as far as unsigned code goes on the 360
Ill quote what i said on xbox scene for you.

Quote:
Hey, now my memory is a little bad on this since it was so long ago.

But does any of ye remember the first guy that hacked the original Xbox?.
He done it for some class report thing or something, this was before any other hack was out
For the Xbox.
But he busted the thing wide open.
And then guess what???.
He didn't release it, afaik he done the same thing this guy did and told his info to MS.
But guess what it opened the doors for other hackers, and the original Xbox got busted wide open.

So the way i see it it's pretty much the same deal here.
Yeah sure this hack is no good to 99% or so of us.
But its opening a door that MS is going to find very hard to close.
It's showing it can be done.
And other hackers will follow, and they will make it possible to run Unsigned code on any x363.
Senior Member

1 product review
_
1. March 2007 @ 02:58 _ Link to this message    Send private message to this user   
its not that simple man, they found a glitch in the kernel, it took him under 6 months to exploit this glitch, other 360s that dont have that kernel have had people trying to crack them for over a year and no luck, its not something that just threw the doors open...unless this guy is like Einstein

Q6600 @ 3.6Ghz 1.4V//Maximus Formula (RF 0902)//2x2GB DDR2 800//8500GT (backup until 5870 comes out)//Corsair 650TX//Under water (30c Idle 50c Load)



http://forums.afterdawn.com/thread_view.cfm/476770 -------> XDVD Mulleter Tut
Junior Member
_
1. March 2007 @ 05:02 _ Link to this message    Send private message to this user   
Originally posted by mikeismad:
its not that simple man, they found a glitch in the kernel, it took him under 6 months to exploit this glitch, other 360s that dont have that kernel have had people trying to crack them for over a year and no luck, its not something that just threw the doors open...unless this guy is like Einstein
This hack will allow other hackers that can use this glitch with the right kernel to go take a look inside the 360.
They will be able to find out the workings of it etc, and produce a another hack from there findings.

Sure its not something that is going to happen over night, but it will happen.

And if it comes down to it im sure some chip maker will be able to use this glitch to make a chip that can have that kernel flashed onto it or something like that.

Ether way something is going to come from this.
Member
_
1. March 2007 @ 07:26 _ Link to this message    Send private message to this user   
Afterdawn has picked up this story on the home page - so I assume there are more people interested in this then you think. that would be incredibly awesome if they could also turn the 360 into a media center as they have with the original xbox.
Advertisement
_
__
 
_
Junior Member
_
1. March 2007 @ 09:49 _ Link to this message    Send private message to this user   
Originally posted by navsav:
Afterdawn has picked up this story on the home page - so I assume there are more people interested in this then you think. that would be incredibly awesome if they could also turn the 360 into a media center as they have with the original xbox.
I know im dreaming about XBMC360 right now :) .
afterdawn.com > forums > consoles > xbox 360 - modding & hacking > bugtraq: xbox360 hypervisor vulnerability - unsigned code on kernel 4532 and 4548
 

Digital video: AfterDawn.com | AfterDawn Forums
Music: MP3Lizard.com
Gaming: Blasteroids.com | Blasteroids Forums | Compare game prices
Software: Software downloads
Blogs: User profile pages
RSS feeds: AfterDawn.com News | Software updates | AfterDawn Forums
International: AfterDawn in Finnish | AfterDawn in Swedish | AfterDawn in Norwegian | download.fi
Navigate: Search | Site map
About us: About AfterDawn Ltd | Advertise on our sites | Rules, Restrictions, Legal disclaimer & Privacy policy
Contact us: Send feedback | Contact our media sales team
 
  © 1999-2025 by AfterDawn Ltd.

  IDG TechNetwork