A9VG电玩部落论坛

 找回密码
 注册
搜索
楼主: lovesum666

[破解] 从技术角度描述一下SLIM360这次reset glitch hack是咋回事。个人原创观点。

[复制链接]

终结者

流放者(禁止发言)

精华
0
帖子
10978
威望
0 点
积分
10674 点
种子
27 点
注册时间
2007-11-12
最后登录
2024-10-2
发表于 2011-9-1 09:51  ·  河南 | 显示全部楼层
要的是后续。。。。。。。。。。

精华
0
帖子
152
威望
0 点
积分
491 点
种子
475 点
注册时间
2008-11-18
最后登录
2023-11-23
发表于 2011-9-1 09:52  ·  吉林 | 显示全部楼层
希望这次破解能让我的 老肥版360玩上自制系统  俺就满足了
该用户已被禁言

精华
0
帖子
114
威望
0 点
积分
117 点
种子
2 点
注册时间
2011-7-26
最后登录
2019-12-28
发表于 2011-9-1 09:53  ·  上海 | 显示全部楼层
好东西 当然要顶一下咯

精华
1
帖子
163
威望
1 点
积分
293 点
种子
5 点
注册时间
2005-7-6
最后登录
2014-11-9
发表于 2011-9-1 09:54  ·  江苏 | 显示全部楼层
翻译就是翻译,何必还说自己是原创的。不要脸就不要脸了,还献丑
链接:http://free60.org/Reset_Glitch_Hack
原文:The Xbox 360 reset glitch hack

tmbinc said it himself, software based approaches of running unsigned code on the 360 mostly don't work, it was designed to be secure from a software point of view.

The processor starts running code from ROM (1bl) , which then starts loading a RSA signed and RC4 crypted piece of code from NAND (CB).

CB then initialises the processor security engine, its task will be to do real time encryption and hash check of physical DRAM memory. From what we found, it's using AES128 for crypto and strong (Toeplitz ?) hashing. The crypto is different each boot because it is seeded at least from:
A hash of the entire fuseset.
The timebase counter value.
A truly random value that comes from the hardware random number generator the processor embeds. on fats, that RNG could be electronically deactivated, but there's a check for "apparent randomness" (merely a count of 1 bits) in CB, it just waits for a seemingly proper random number.

CB can then run some kind of simple bytecode based software engine whose task will mainly be to initialise DRAM, CB can then load the next bootloader (CD) from NAND into it, and run it.

Basically, CD will load a base kernel from NAND, patch it and run it.

That kernel contains a small privileged piece of code (hypervisor), when the console runs, this is the only code that would have enough rights to run unsigned code. In kernel versions 4532/4548, a critical flaw in it appeared, and all known 360 hacks needed to run one of those kernels and exploit that flaw to run unsigned code. On current 360s, CD contains a hash of those 2 kernels and will stop the boot process if you try to load them. The hypervisor is a relatively small piece of code to check for flaws and apparently no newer ones has any flaws that could allow running unsigned code.

On the other hand, tmbinc said the 360 wasn't designed to withstand certain hardware attacks such as the timing attack and "glitching".

Glitching here is basically the process of triggering processor bugs by electronical means.

This is the way we used to be able to run unsigned code.

The reset glitch in a few words

We found that by sending a tiny reset pulse to the processor while it is slowed down does not reset it but instead changes the way the code runs, it seems it's very efficient at making bootloaders memcmp functions always return "no differences". memcmp is often used to check the next bootloader SHA hash against a stored one, allowing it to run if they are the same. So we can put a bootloader that would fail hash check in NAND, glitch the previous one and that bootloader will run, allowing almost any code to run.

Details for the fat hack

On fats, the bootloader we glitch is CB, so we can run the CD we want.

cjak found that by asserting the CPU_PLL_BYPASS signal, the CPU clock is slowed down a lot, there's a test point on the motherboard that's a fraction of CPU speed, it's 200Mhz when the dash runs, 66.6Mhz when the console boots, and 520Khz when that signal is asserted.

So it goes like that:
We assert CPU_PLL_BYPASS around POST code 36 (hex).
We wait for POST 39 start (POST 39 is the memcmp between stored hash and image hash), and start a counter.
When that counter has reached a precise value (it's often around 62% of entire POST 39 length), we send a 100ns pulse on CPU_RESET.
We wait some time and then we deassert CPU_PLL_BYPASS.
The cpu speed goes back to normal, and with a bit of luck, instead of getting POST error AD, the boot process continues and CB runs our custom CD.

The NAND contains a zero-paired CB, our payload in a custom CD, and a modified SMC image. A glitch being unreliable by nature, we use a modified SMC image that reboots infinitely (ie stock images reboot 5 times and then go RROD) until the console has booted properly. In most cases, the glitch succeeds in less than 30 seconds from power on that way.

Details for the slim hack

The bootloader we glitch is CB_A, so we can run the CB_B we want.

On slims, we weren't able to find a motherboard track for CPU_PLL_BYPASS. Our first idea was to remove the 27Mhz master 360 crystal and generate our own clock instead but it was a diffi*** modification and it didn't yield good results. We then looked for other ways to slow the CPU clock down and found that the HANA chip had configurable PLL registers for the 100Mhz clock that feeds CPU and GPU differential pairs. Apparently those registers are written by the SMC through an I2C bus. I2C bus can be freely accessed, it's even available on a header (J2C3). So the HANA chip will now become our weapon of choice to slow the CPU down (sorry tmbinc, you can't always be right, it isn't boring and it does sit on an interesting bus ;)

So it goes like that:
We send an i2c command to the HANA to slow down the CPU at POST code D8 .
We wait for POST DA start (POST DA is the memcmp between stored hash and image hash), and start a counter.
When that counter has reached a precise value, we send a 20ns pulse on CPU_RESET.
We wait some time and then we send an i2c command to the HANA to restore regular CPU clock.
The cpu speed goes back to normal, and with a bit of luck, instead of getting POST error F2, the boot process continues and CB_A runs our custom CB_B.

When CB_B starts, DRAM isn't initialised so we chose to only apply a few patches to it so that it can run any CD, the patches are:
Always activate zero-paired mode, so that we can use a modified SMC image.
Don't decrypt CD, instead expect a plaintext CD in NAND.
Don't stop the boot process if CD hash isn't good.

CB_B is RC4 crypted, the key comes from the CPU key, so how do we patch CB_B without knowing the CPU key? RC4 is basically:
crypted = plaintext xor pseudo-random-keystream

So if we know plaintext and crypted, we can get the keystream, and with the keystream, we can encrypt our own code. It goes like that:
guessed-pseudo-random-keystream = crypted xor plaintext
new-crypted = guessed-pseudo-random-keystream xor plaintext-patch

You could think there's a chicken and egg problem, how did we get plaintext in the first place? Easy: we had plaintext CBs from fat consoles, and we thought the first few bytes of code would be the same as the new CB_B, so we could encrypt a tiny piece of code to dump the CPU key and decrypt CB_B!

The NAND contains CB_A, a patched CB_B, our payload in a custom plaintext CD, and a modified SMC image. The SMC image is modified to have infinite reboot, and to prevent it from periodically sending I2C commands while we send ours.

Now, maybe you haven't realised yet, but CB_A contains no checks on revocation fuses, so it's an unpatchable hack !

版主

Realtek AC’97

精华
0
帖子
15353
威望
13 点
积分
16534 点
种子
15 点
注册时间
2010-5-7
最后登录
2024-6-8
发表于 2011-9-1 09:57  ·  上海 | 显示全部楼层
回复 air04 的帖子

那有本事你来翻译啊!你翻译好早点发布啊!最看不惯你这种人了!什么玩意儿……!

精华
0
帖子
731
威望
0 点
积分
654 点
种子
46 点
注册时间
2009-10-21
最后登录
2024-10-3
发表于 2011-9-1 09:58  ·  湖南 | 显示全部楼层
很多人喜欢装X.............

精华
1
帖子
163
威望
1 点
积分
293 点
种子
5 点
注册时间
2005-7-6
最后登录
2014-11-9
发表于 2011-9-1 10:00  ·  江苏 | 显示全部楼层
回复 小狼052 的帖子

这种程度的英文大白话还看不懂?那还刷什么机?

精华
0
帖子
1259
威望
0 点
积分
1548 点
种子
247 点
注册时间
2011-3-26
最后登录
2021-8-17
发表于 2011-9-1 10:11  ·  重庆 | 显示全部楼层
air04 发表于 2011-9-1 10:00
回复 小狼052 的帖子

这种程度的英文大白话还看不懂?那还刷什么机?

牛B人,你给他工资了吗。
为什么你不早点翻译出来让大家看看,作者也说是翻译,你得瑟个什么。

精华
0
帖子
91
威望
0 点
积分
95 点
种子
6 点
注册时间
2011-8-24
最后登录
2021-5-26
发表于 2011-9-1 10:12  ·  四川 | 显示全部楼层
非常详细
谢谢lz

精华
0
帖子
1504
威望
0 点
积分
1469 点
种子
0 点
注册时间
2010-1-8
最后登录
2014-5-29
发表于 2011-9-1 10:17  ·  湖北 | 显示全部楼层
本帖最后由 xyz888 于 2011-9-1 10:18 编辑

浮云,飘一下吧, 大家都一样,为更快活的生存而奋斗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|A9VG电玩部落 川公网安备 51019002005286号

GMT+8, 2024-10-3 02:20 , Processed in 0.192001 second(s), 20 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部