Hacking RELEASE CertNXtractionPack - Get your Switch cert from a NAND dump!

jelbo

Well-Known Member
Member
Joined
Sep 12, 2003
Messages
877
Trophies
2
XP
892
Country
Netherlands
Pip should be, reinstall 2.7.15 and ensure you check the box that says add to path!
I had to use the x86 version of Python, not the x64 build.

After a succesful pip install pycryptodome, pip install future and pip install asn1, and running your .cmd, I now get:

Code:
SocraticBliss and SimonMKWii (R)

PRE-REQUISITES:
-- Get your BIS Keys (via biskeydump)
-- Dump your SYSNAND (via hekate)
-- Decrypt your PRODINFO (BIS 0 Key) and Save to file - PRODINFO.bin to your working directory.
-- Insert the 4 required keys in the top of the CertNXtractionPack.py script.
-- Hint: lines 10, 11, 12, 13, replace only the 32 F's with the correct key.

Traceback (most recent call last):
  File "CertNXtractionPack.py", line 5, in <module>
    from pip._internal import main as pipmain
ImportError: No module named _internal

Press any key to continue . . .
 

SocraticBliss

Well-Known Member
Member
Joined
Jun 3, 2017
Messages
130
Trophies
0
Age
36
XP
273
Country
United States
I had to use the x86 version of Python, not the x64 build.

After a succesful pip install pycryptodome, pip install future and pip install asn1, and running your .cmd, I now get:

Code:
SocraticBliss and SimonMKWii (R)

PRE-REQUISITES:
-- Get your BIS Keys (via biskeydump)
-- Dump your SYSNAND (via hekate)
-- Decrypt your PRODINFO (BIS 0 Key) and Save to file - PRODINFO.bin to your working directory.
-- Insert the 4 required keys in the top of the CertNXtractionPack.py script.
-- Hint: lines 10, 11, 12, 13, replace only the 32 F's with the correct key.

Traceback (most recent call last):
  File "CertNXtractionPack.py", line 5, in <module>
    from pip._internal import main as pipmain
ImportError: No module named _internal

Press any key to continue . . .
I had x64 installed, this is weird...
 

jelbo

Well-Known Member
Member
Joined
Sep 12, 2003
Messages
877
Trophies
2
XP
892
Country
Netherlands
Changing
Code:
from pip._internal import main as pipmain
to
Code:
from pip import main as pipmain
in both .py scripts gets me further. But another error:

Code:
SocraticBliss and SimonMKWii (R)

PRE-REQUISITES:
-- Get your BIS Keys (via biskeydump)
-- Dump your SYSNAND (via hekate)
-- Decrypt your PRODINFO (BIS 0 Key) and Save to file - PRODINFO.bin to your working directory.
-- Insert the 4 required keys in the top of the CertNXtractionPack.py script.
-- Hint: lines 10, 11, 12, 13, replace only the 32 F's with the correct key.

Verifying keys...

ssl_rsa_kek = <snip>

Script #1 Completed Successfully!
Saved clcert.der and privk.bin to your working directory.

Checking Dependencies...

  Cache entry deserialization failed, entry ignored
enum34 successfully installed!
future successfully installed!
asn1 successfully installed!
Traceback (most recent call last):
  File "Convert_to_der.py", line 162, in <module>
    main()
  File "Convert_to_der.py", line 117, in main
    E, N = get_pubk(clcert)
  File "Convert_to_der.py", line 74, in get_pubk
    clcert_decoder = asn1.Decoder()
NameError: global name 'asn1' is not defined

Press any key to continue . . .

I do have both clcert.der (2,00 KB (2.048 bytes)) and privk.bin (256 bytes) now though.

/edit: got it to work, finally.
  1. Revert my changes to the .py scripts (so it's from pip._internal import main as pipmain again)
  2. Upgraded pip using python -m pip install --upgrade pip
  3. Ran CertNXtractionPack.cmd
Code:
SocraticBliss and SimonMKWii (R)

PRE-REQUISITES:
-- Get your BIS Keys (via biskeydump)
-- Dump your SYSNAND (via hekate)
-- Decrypt your PRODINFO (BIS 0 Key) and Save to file - PRODINFO.bin to your working directory.
-- Insert the 4 required keys in the top of the CertNXtractionPack.py script.
-- Hint: lines 10, 11, 12, 13, replace only the 32 F's with the correct key.

Verifying keys...

ssl_rsa_kek = <snip>

Script #1 Completed Successfully!
Saved clcert.der and privk.bin to your working directory.

Script #2 Completed Successfully!
Saved privkey.der to your working directory.

Program Completed Successfully!
Saved nx_tls_client_cert.pfx to your working directory.
password = switch
 
Last edited by jelbo,
  • Like
Reactions: snoofly

Kupie

Well-Known Member
Member
Joined
Jun 9, 2013
Messages
320
Trophies
1
Age
31
XP
906
Country
United States
GCNBot#4388 on discord, if you message with ".cert" and your prodinfo attached, will send you your cert right away.

Just used it, confirmed it works with CDNSP. I think it's actually a bot made by @SimonMKWii himself, based on the name.
 

t1op

Well-Known Member
Member
Joined
Nov 13, 2016
Messages
142
Trophies
0
Age
48
XP
584
Country
United States
Want your cert to access Nintendo's CDN, but you're not on 3.0.0 anymore so you can't run the PegaSwitch script?
Don't worry, I've got you covered!
Included in the pack is everything you need to generate a pfx certificate file from a NAND dump!

Usage:
  • First, make sure Python3 and both the asn1 and pycrypto modules are installed.
  • Next, copy your PRODINFO.bin partition into the folder.
...
How 2 get dem keyz???
  • The first key is generated by XORing the AES_KEK (kek_mask 0) with the CryptoUsecase_RsaPrivate seed (kek_seed 1).
  • The second key is the original master key, you can extract it from your keyblobs using hactool.
  • The third and fourth keys are plaintext in the ssl sysmodule NSO.
  • Or alternatively, you can skip this entire step by finding the ssl_kek online, not giving links for obvious reasons... (Trust me, it's out there!
I want to run CDNSP. I have a NAND backup.
I have installed Python 3.7. I don't understand the "modules" part.
How do I get PRODINFO.bin? I put in "the folder" with the scripts?
I don't understand any of the above key stuff, nor do I know what I am supposed to do with them .
 

CorrellRoy

Well-Known Member
Newcomer
Joined
Jul 17, 2016
Messages
68
Trophies
0
Age
29
Location
Mississippi
Website
www.youtube.com
XP
286
Country
United States
Ok heres what all I did so far

Downloaded and extract CertNXtractionPack
Downloaded CertNXtractionPack.py
Used biskeydump and gotten all BIS keys, HWI, SBK, TSEC Keys, eMMC Id key, and Device key
Ran HacDiskMount, Opened PRODINFO, Tested the keys and saved PRODINFO.bin
Ran CMD on "01_decrypt_privk_extract_cert " and Failed to open PRODINFO.bin
 

valyndaslayer

Member
Newcomer
Joined
Jun 19, 2018
Messages
23
Trophies
0
Age
27
XP
86
Country
Indonesia
Does anyone really want to tell how are we gonna get this key:

rsa_private_kek_generation_source
ssl_rsa_kek_source_x
ssl_rsa_kek_source_y

I saw this included in full 80 keys list on other forum, but I cannot find any tutorial that is able to generate all 80 keys.. (or at least tutorial written with human language, not crypto geeks :P)
 

Mario119

Well-Known Member
Newcomer
Joined
Sep 2, 2018
Messages
70
Trophies
0
Age
25
XP
455
Country
United States
I followed the instructions in post #160 (can't post a link to it because I'm new) and I'm receiving the following error upon running 00_generate_ssl_kek.py.

Code:
00_generate_ssl_kek.py", line 21, in <module>
    rpk_key = GenerateAesKek(rsa_private_kek_generation_source, key_x_gak, key_x_gak)
NameError: name 'key_x_gak' is not defined
 
Last edited by Mario119,

shchmue

Developer
Developer
Joined
Dec 23, 2013
Messages
791
Trophies
1
XP
2,367
Country
United States
Does anyone really want to tell how are we gonna get this key:

rsa_private_kek_generation_source
ssl_rsa_kek_source_x
ssl_rsa_kek_source_y

I saw this included in full 80 keys list on other forum, but I cannot find any tutorial that is able to generate all 80 keys.. (or at least tutorial written with human language, not crypto geeks :P)
not sure about the first, the last two are hard coded in the ES title along with some others
 

andybarrn

Member
Newcomer
Joined
Nov 16, 2016
Messages
7
Trophies
0
Age
44
XP
57
Country
United States
I've been working on trying to get my certs for 2 days. Using Windows 10
Uninstalled python 3.6, installed 2.7.8
Used get-pip.py to install pip
Verified PRODINFO.bin is decrypted - it's showing CAL0 at the start of the file
Have copied the correct keys into CertNXtractionPack.py
I have CertNXtractionPack.py, CertNXtractionPack.cmd, openssl.exe, PRODINFO.bin, & Convert_to_der.py in python folder
Have verified python is installed to my PATH

When running CertNXtraction.cmd from powershell in C:\Python27\ folder still getting the following error:

PRE-REQUISITES:
-- Get your BIS Keys (via biskeydump)
-- Dump your SYSNAND (via hekate)
-- Decrypt your PRODINFO (BIS 0 Key) and Save to file - PRODINFO.bin to your working directory.
-- Insert the 4 required keys in the top of the CertNXtractionPack.py script.
-- Hint: lines 10, 11, 12, 13, replace only the 32 F's with the correct key.

Press any key to continue . . .
Error: Install Python to your path then run again!

Any help would be greatly appreciated.
 

andybarrn

Member
Newcomer
Joined
Nov 16, 2016
Messages
7
Trophies
0
Age
44
XP
57
Country
United States
So I changed pycrypto to cryptodome in CertNXtractionPack.py, and have gotten slightly farther.

I now believe the CertNXtranctionPack.py finishes completely, but am getting stuck with Script #2.

I now get the attached output.

I changed some of the directory information to xxx, as I wasn't sure if the information was good to put out.
 

Attachments

  • output.txt
    1.3 KB · Views: 172

andybarrn

Member
Newcomer
Joined
Nov 16, 2016
Messages
7
Trophies
0
Age
44
XP
57
Country
United States
Nevermind, I appear to have resolved my issue. Ended up having to do manual pip install for ans1 and future, but then I was able to get the script to run properly.
 

Mario119

Well-Known Member
Newcomer
Joined
Sep 2, 2018
Messages
70
Trophies
0
Age
25
XP
455
Country
United States
So I was able to progress pass the error I had prior, but now I'm running into a new problem upon running '02_convert_to_der.py'

Code:
  File "C:\Users\username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asn1.py", line 541, in _read_bytes
    raise Error('Premature end of input.')
asn1.Error: Premature end of input.

Help would be appreciated!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    +1
  • BakerMan @ BakerMan:
    fellas
  • BakerMan @ BakerMan:
    would you rather have a 9-5 desk job with poor pay or work for an intergalactic space militia with no guarantee of being paid?
  • BakerMan @ BakerMan:
    basically, normal boring job or halo and/or helldivers irl
    BakerMan @ BakerMan: basically, normal boring job or halo and/or helldivers irl