What key is it that gets extracted from the prodinfo.bin ?
An Encrypted SSL Extended Key...
What key is it that gets extracted from the prodinfo.bin ?
snip
Traceback (most recent call last):
File "00_generate_ssl_kek.py", line 21, in <module>
rpk_key = GenerateAesKek(rsa_private_kek_generation_source, key_x_gak, master_key)
NameError: name 'key_x_gak' is not defined
This happens to me too and fix by extracting PRODINFO.bin from my NAND backup using unique BIS Key
On Windows I cant install pycrypto cuz of Error:
Code:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/ -Isrc/inc-msvc/ "-Ic:\program files\python36\include" "-Ic:\program files\python36\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcsrc/winrand.c /Fobuild\temp.win-amd64-3.6\Release\src/winrand.obj winrand.c C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(26): error C2061: Syntaxfehler: Bezeichner "intmax_t" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(27): error C2061: Syntaxfehler: Bezeichner "rem" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(27): error C2059: Syntaxfehler: ";" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(28): error C2059: Syntaxfehler: "}" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(30): error C2061: Syntaxfehler: Bezeichner "imaxdiv_t" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(30): error C2059: Syntaxfehler: ";" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(40): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(41): error C2146: Syntaxfehler: Fehlendes ")" vor Bezeichner "_Number" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(41): error C2061: Syntaxfehler: Bezeichner "_Number" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(41): error C2059: Syntaxfehler: ";" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(42): error C2059: Syntaxfehler: ")" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(45): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(46): error C2146: Syntaxfehler: Fehlendes ")" vor Bezeichner "_Numerator" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(46): error C2061: Syntaxfehler: Bezeichner "_Numerator" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(46): error C2059: Syntaxfehler: ";" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(46): error C2059: Syntaxfehler: "," C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(48): error C2059: Syntaxfehler: ")" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(50): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(56): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(63): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(69): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(76): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(82): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(89): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\inttypes.h(95): error C2143: Syntaxfehler: Es fehlt "{" vor "__cdecl" error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2 ---------------------------------------- Command ""c:\program files\python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\lemmi\\AppData\\Local\\Temp\\pip-install-yyjwxqtq\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\lemmi\AppData\Local\Temp\pip-record-1euqlnzo\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\lemmi\AppData\Local\Temp\pip-install-yyjwxqtq\pycrypto\
On Linux if I try to run : 00_generate" I get the following Error:
Code:Traceback (most recent call last): File "00_generate_ssl_kek.py", line 21, in <module> rpk_key = GenerateAesKek(rsa_private_kek_generation_source, key_x_gak, master_key) NameError: name 'key_x_gak' is not defined
You need Build tools for Visual studio. I would recommend to try to get it working in linux. I belive you need to enter the missing keys...
When I ran biskeydump I got biskeydump_armed.bin and tsecfw.inl. Didn't see anything about PRODINFO.bin.
rsa_private_kek_generation_source = uhx
master_key = uhx
key_x_gak = uhx
rpk_key_y = uhx
You see that the last two are different then inside your file ? Switch those 2 to the ones i use.
Change ssl_aes_key_x to key_x_gak AND
Change ssl_rsa_key_y to rpk_key_y
its a mistake in the code.
Yeah got it, on Linux I struggle with "no module named asn1" however I installed asn1
"pip3 install asn1"
I entered all 4 Keys.
if you're on Windows, stop suggesting "python" please, use "py -3" in place. py -3 -m pip install pycryptodome
At terminal write : python -m pip install asn1 and it should install. If not write python -m pip install future
then python -m pip install asn1
python 02_convert_to_der.py
Traceback (most recent call last):
File "02_convert_to_der.py", line 144, in <module>
main()
File "02_convert_to_der.py", line 100, in main
E, N = get_pubk(clcert)
File "02_convert_to_der.py", line 58, in get_pubk
clcert_decoder.enter() # Seq, 3 elem
File "/home/pega/.local/lib/python2.7/site-packages/asn1.py", line 448, in enter
raise Error('Cannot enter a non-constructed tag.')
asn1.Error: Cannot enter a non-constructed tag.
there have been Windows users in this thread suggesting the use of "python" and "pip" on their own, which are unreliable (don't know if they exist, or what version they point to), so I need to point it out.He said he used Linux and i use Linux atm. So ofcourse i should give him the correct linux command...
That worked, however now I get: It seems I fucked up my Linux
Code:python 02_convert_to_der.py Traceback (most recent call last): File "02_convert_to_der.py", line 144, in <module> main() File "02_convert_to_der.py", line 100, in main E, N = get_pubk(clcert) File "02_convert_to_der.py", line 58, in get_pubk clcert_decoder.enter() # Seq, 3 elem File "/home/pega/.local/lib/python2.7/site-packages/asn1.py", line 448, in enter raise Error('Cannot enter a non-constructed tag.') asn1.Error: Cannot enter a non-constructed tag.
there have been Windows users in this thread suggesting the use of "python" and "pip" on their own, which are unreliable (don't know if they exist, or what version they point to), so I need to point it out.
I dont knowI think Simon has to answer this. I did not write the scripts. Too Lazy to read all the code since i have not touched programming in 4+ years.
--------------------- MERGED ---------------------------
True and a good point!
if you're on Windows, stop suggesting "python" please, use "py -3" in place. py -3 -m pip install pycryptodome
there have been Windows users in this thread suggesting the use of "python" and "pip" on their own, which are unreliable (don't know if they exist, or what version they point to), so I need to point it out.
once you install 3.3+ you will get the "py" command, which will work for 2.x ("py -2", "py -2.7")Valid point... I have just had the most luck with those commands, I used Python 2.7 for all of this anyways, as I ensured it was backwards compatible...
https://stackoverflow.com/questions...-from-command-line-using-py-instead-of-python
Edit: As a heads up, you have to have a distribution of Python3.x installed in order to use the py command natively, so people with Python2.7 can't do this unfortunately...
once you install 3.3+ you will get the "py" command, which will work for 2.x ("py -2", "py -2.7")
well it won't ever be added to 2.7 only (which by the way its EOL is january 1, 2020), so this is the only way you'll get it. it's better than just "python" on Windows so I always suggest it over that.Maybe I should have been more explicit and said that the users who are ONLY a member of the Python2.7 greater beings, will not be able to rely on this![]()