Per Console Keys: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
No edit summary
(→‎per_console_root_key_1 / EID_root_key: You cannot derive EID_root_key from going backwards from a derived key.)
(41 intermediate revisions by 14 users not shown)
Line 1: Line 1:
[[Category:Software]]
==per_console_root_key_0==
==per_console_root_key_0==


*metldr is decrypted with this key
*bootldr and metldr are decrypted with this key. See also [[Boot Order]]
*bootldr is decrypted with this key
*might be obtained with per_console_root_key_1 ? '''(largely speculative, not nec. true - need more looked into, only based on the behavior of the other derivatives known to be obtained through AES)'''
*might be obtained with per_console_root_key_1'''?''' ''(largely speculative, not nec. true - need more looked into, only based on the behavior of the other derivatives known to be obtained through AES)''


==per_console_root_key_1 / EID_root_key==
==per_console_root_key_1 / EID_root_key==
Line 13: Line 11:
*cleared by isoldr
*cleared by isoldr
*Used to decrypt part of the EID
*Used to decrypt part of the EID
*Used to derive further keys
*Used to derive further keys ''(per_console_key_0 is not the key which will be derived, but is the key which has derived per_console_key_1)''
*can be obtained with a modified isoldr that dumps it
*can be obtained with a modified isoldr that dumps it
*can be obtained with a derivation of this key going backwards


=== Obtaining It ===
=== Obtaining It ===


Launch the patched isoldr with your prefered method
Launch the patched isoldr with your prefered method, let it be Option 1, or Option 2...


==== Option 1 - Dumper Kernel Module ====
==== Option 1 - Dumper Kernel Module ====


*modify glevands spp_verifier_direct to dump the mbox to wherever_you_want and then '''(use the payload below as an example)'''
*modify glevands spp_verifier_direct to dump the mbox to wherever_you_want  
*the example code on how to dump the mbox can be found on 'Option 2 -Dumper Payload' below
'''http://pastebin.com/uTBbnC9B'''<-needs to be edited further


<pre>
<pre>
insmod ./spp_verifier_direct.ko
insmod ./spp_verifier_direct.ko
cat metldr > /proc/spp_verifier_direct/metldr
cat metldr > /proc/spp_verifier_direct/metldr
cat isoldr_PATCHED > /proc/spp_verifier_direct/isoldr
cat dump_eid_root_key.self > /proc/spp_verifier_direct/isoldr
echo 1 > /proc/spp_verifier_direct/run
echo 1 > /proc/spp_verifier_direct/run
cat /proc/spp_verifier_direct/debug
cat /proc/spp_verifier_direct/debug
cat /proc/spp_verifier_direct/wherever_you_want
hd /ls.bin | less
</pre>
</pre>


==== Option 2 - Dumper Payload ====
==== Option 2 - Dumper Payload ====
*http://pastie.org/pastes/2101977
*http://pastebin.com/YwDKqgTj <!--// http://pastie.org/pastes/2101977 //-->


*patched isoldr to dump it
*patched isoldr to dump it
*DO NOT CREATE AN MFW USING THIS IT WOULD BRICK PS3
'''*DO NOT CREATE AN MFW USING THIS IT WOULD BRICK PS3'''
*patched isoldr: http://www.multiupload.com/2MP5KY28EZ
*patched isoldr: http://www.wupload.com/file/1153650416/dump_eid_root_key.self


*this can be loaded as the payload stage2 in the payload marcan used to load linux
*this can be loaded as the payload stage2 in the payload marcan used to load linux
Line 47: Line 44:


*this can also be loaded as with lv2patcher and payloader3
*this can also be loaded as with lv2patcher and payloader3
**https://github.com/euss/payloader3.git
**payloader3.git


==== Comments ====
==== Comments ====
Line 54: Line 51:
*In the dump the remaining dump is the metldr clear code. metldr clears itself and all the registers an jumps to isoldr.
*In the dump the remaining dump is the metldr clear code. metldr clears itself and all the registers an jumps to isoldr.
*Overwritting that code lets you dump your key + metldr
*Overwritting that code lets you dump your key + metldr
*Consider that per_console_key_1 and per_console_key_n are in fact still in need decryption.
*per_console_key_0 particularly needs to be dumped once revived from per_console_key_1.


==per_console_root_key_2 / EID0_key ==
==per_console_root_key_2 / EID0_key ==


*this key can be obtained through AES from EID_root_key
*this key can be obtained through AES from EID_root_key
**EID0_key can be gotten this way through a program such as openssl, using the following command once installed:
<pre>
openssl aes-256-cbc -e -in eid0_key_seed -out eid0_enc_seed -nosalt -K (isoldr key) -iv (isoldr RIV) -p -nopad
</pre>
 
eid0_key_seed:
ABCAAD1771EFABFC2B921276FAC2130C
37A6BE3FEF82C79F3BA5733FC35A690B
08B358F970FA16A3D2FFE2299E841EE4
D3DB0E0C9BAEB51BC7DFF10467472F85


*EID can be partially decrypted by setting this key in anergistics and fireing aim_spu_module.self
*EID can be partially decrypted by setting this key in anergistics and fireing aim_spu_module.self
*Load aim_spu_module.self + EID0 + EID0_key in anegistics = decrypted EID0
*Load aim_spu_module.self + EID0 + EID0_key in anegistics = decrypted EID0
*This code is to decrypt your EID0 on your PC http://pastie.org/2000330
*[http://www.ps3devwiki.com/files/devtools/PerConsoleKeys/pastie-2000330/ This code] is to decrypt your EID0 on your PC http://pastebin.com/xdPYgqXG <!--// http://pastie.org/2000330 //-->
**The prerequisites are:
**The prerequisites are:
***dump your EID0 from your ps3 and save it in the same folder as EID0
***dump your EID0 from your ps3 and save it in the same folder as EID0
Line 68: Line 82:


*EID0_key could also be obtained with '''EID_root_key''' directly in the following manners:
*EID0_key could also be obtained with '''EID_root_key''' directly in the following manners:
**knowing the algorithm (located in isoldr)and applying it to the EID_root_key
**knowing the algorithm (located in isoldr) and applying it to the EID_root_key
**leting isoldr apply that algorithm directly in anergistic
**let isoldr apply that algorithm directly in anergistic
***the process is exactly as the one above (modifing anergistic to feed isoldr with EID_root_key
***the process is exactly as the one above (modifing anergistic to feed isoldr with EID_root_key


Line 76: Line 90:


*patched aim_spu_module to dump it
*patched aim_spu_module to dump it
*DO NOT CREATE AN MFW USING THIS IT WOULD BRICK
'''*DO NOT CREATE AN MFW USING THIS IT WOULD BRICK'''
*http://www.multiupload.com/1XUOOYS9I0
**http://www.multiupload.com/1XUOOYS9I0
**http://dl.dropbox.com/u/35197530/aim.self (to be verified. if it is the same file, i'll upload it again to mediafire
**http://www.ps3devwiki.com/files/devtools/PerConsoleKeys/aim.self


==per_console_root_key_n==
==per_console_root_key_n==


These are further derivations of the per_console_key_1/EID_root_key
These are further derivations of the per_console_key_1/EID_root_key
==cVTRM==
'''SRK''' ('''root hash secret (hsec)''') (derivation from per console key?) is stored at '''Syscon''' along with '''SRH''' ('''root hash'''). SRK is used as HMAC hash to authenticate '''cVTRM''' data at flash, SRH is a hash of cVTRM data, it computed at runtime and compared with SRH from Syscon. You can fetch it with VTRM or SCM utilities from glevand's '''ps3-vuart-tools''' (you need to add the function to the tools to do so) or from GameOS directly if you do some patches at hypervisor level.
cVTRM uses SC isolated module to do all cryptographic operations. It uses AES-CBC-128 to encrypt data; seems like key is fetched from encrypted key table at Syscon (related to EID1?). Also this key can be computed using AES-XTS-128, IV contains all zeroes. Data and tweak keys for XTS are computed from EID root key using seeds from SC isolated module.
Here is an example of decrypted cVTRM blocks:
1B68B7B67048454E863ECA0665EFB086  1B68B7B67048454E863ECA0665EFB08670F3EADB (Drive Revocation List Hash)
70F3EADB96791F41F9A76F4D895DD582  96791F41F9A76F4D895DD5820DB108EC03D19250 (Content Revocation List Hash)
0DB108EC03D192500000000000000000
00000000000000000000000000000000
00000001000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
087E91AEFFB8E66A0000000000000000  6AE6B8FFAE917E08 (PSN) Account ID
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
https://dl.dropboxusercontent.com/u/35197530/zip/ps3linux-ps3vuart-tools.zip here's a link with the added functions. try to test it and report if it works :)


==Documentation==
==Documentation==


polarssl.org/trac/browser/trunk/library/aes.c
http://polarssl.org/trac/browser/trunk/library/aes.c
 
 
{{Reverse engineering}}<noinclude>[[Category:Main]]</noinclude>

Revision as of 11:31, 16 December 2018

per_console_root_key_0

  • bootldr and metldr are decrypted with this key. See also Boot Order
  • might be obtained with per_console_root_key_1 ? (largely speculative, not nec. true - need more looked into, only based on the behavior of the other derivatives known to be obtained through AES)

per_console_root_key_1 / EID_root_key

  • derived from per_console_key_0
  • stored inside metldr
  • copied to sector 0 by metldr
  • cleared by isoldr
  • Used to decrypt part of the EID
  • Used to derive further keys (per_console_key_0 is not the key which will be derived, but is the key which has derived per_console_key_1)
  • can be obtained with a modified isoldr that dumps it

Obtaining It

Launch the patched isoldr with your prefered method, let it be Option 1, or Option 2...

Option 1 - Dumper Kernel Module

  • modify glevands spp_verifier_direct to dump the mbox to wherever_you_want

http://pastebin.com/uTBbnC9B<-needs to be edited further

insmod ./spp_verifier_direct.ko
cat metldr > /proc/spp_verifier_direct/metldr
cat dump_eid_root_key.self > /proc/spp_verifier_direct/isoldr
echo 1 > /proc/spp_verifier_direct/run
cat /proc/spp_verifier_direct/debug
hd /ls.bin | less

Option 2 - Dumper Payload

  • patched isoldr to dump it

*DO NOT CREATE AN MFW USING THIS IT WOULD BRICK PS3

  • this can also be loaded as with lv2patcher and payloader3
    • payloader3.git

Comments

  • What this selfs do is dump your ISOLATED SPU LS through your mbox, so you only need a way to cach this info with PPU code in lv2 enviroment aka a dongle payload or linux kernel
  • This has been tested and proven to work on 3.55 MFW
  • In the dump the remaining dump is the metldr clear code. metldr clears itself and all the registers an jumps to isoldr.
  • Overwritting that code lets you dump your key + metldr
  • Consider that per_console_key_1 and per_console_key_n are in fact still in need decryption.
  • per_console_key_0 particularly needs to be dumped once revived from per_console_key_1.

per_console_root_key_2 / EID0_key

  • this key can be obtained through AES from EID_root_key
    • EID0_key can be gotten this way through a program such as openssl, using the following command once installed:
openssl aes-256-cbc -e -in eid0_key_seed -out eid0_enc_seed -nosalt -K (isoldr key) -iv (isoldr RIV) -p -nopad


eid0_key_seed:

ABCAAD1771EFABFC2B921276FAC2130C
37A6BE3FEF82C79F3BA5733FC35A690B
08B358F970FA16A3D2FFE2299E841EE4
D3DB0E0C9BAEB51BC7DFF10467472F85


  • EID can be partially decrypted by setting this key in anergistics and fireing aim_spu_module.self


  • Load aim_spu_module.self + EID0 + EID0_key in anegistics = decrypted EID0
  • This code is to decrypt your EID0 on your PC http://pastebin.com/xdPYgqXG
    • The prerequisites are:
      • dump your EID0 from your ps3 and save it in the same folder as EID0
      • dump your EID0_key from your ps3 and put it on the code above where the key is needed
      • load all of them in anergistic
  • EID0_key could also be obtained with EID_root_key directly in the following manners:
    • knowing the algorithm (located in isoldr) and applying it to the EID_root_key
    • let isoldr apply that algorithm directly in anergistic
      • the process is exactly as the one above (modifing anergistic to feed isoldr with EID_root_key


Obtaining It

  • patched aim_spu_module to dump it

*DO NOT CREATE AN MFW USING THIS IT WOULD BRICK

per_console_root_key_n

These are further derivations of the per_console_key_1/EID_root_key

cVTRM

SRK (root hash secret (hsec)) (derivation from per console key?) is stored at Syscon along with SRH (root hash). SRK is used as HMAC hash to authenticate cVTRM data at flash, SRH is a hash of cVTRM data, it computed at runtime and compared with SRH from Syscon. You can fetch it with VTRM or SCM utilities from glevand's ps3-vuart-tools (you need to add the function to the tools to do so) or from GameOS directly if you do some patches at hypervisor level.

cVTRM uses SC isolated module to do all cryptographic operations. It uses AES-CBC-128 to encrypt data; seems like key is fetched from encrypted key table at Syscon (related to EID1?). Also this key can be computed using AES-XTS-128, IV contains all zeroes. Data and tweak keys for XTS are computed from EID root key using seeds from SC isolated module.

Here is an example of decrypted cVTRM blocks:

1B68B7B67048454E863ECA0665EFB086  1B68B7B67048454E863ECA0665EFB08670F3EADB (Drive Revocation List Hash)
70F3EADB96791F41F9A76F4D895DD582  96791F41F9A76F4D895DD5820DB108EC03D19250 (Content Revocation List Hash)
0DB108EC03D192500000000000000000
00000000000000000000000000000000
00000001000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
087E91AEFFB8E66A0000000000000000  6AE6B8FFAE917E08 (PSN) Account ID
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000

https://dl.dropboxusercontent.com/u/35197530/zip/ps3linux-ps3vuart-tools.zip here's a link with the added functions. try to test it and report if it works :)

Documentation

http://polarssl.org/trac/browser/trunk/library/aes.c