Difference between revisions of "Wii security"

From WiiBrew
Jump to navigation Jump to search
(Removed WiiSCU from "Internet updates: Exploits" -- it's not an exploit.)
m (→‎Unexploitable But Vulnerabe: section name typo)
 
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
The Wii has four basic ways of communicating with the environment -- games on DVDs, savegames on SD card, channels/VCs on SD card and updates downloaded from Internet. All of them need to be protected, for the Wii security model to hold up integrity. Different solutions are in place for all of the ways, even if there are similarities between them.
+
[[Category:Nintendo software]]
 +
{{cleanup}}
 +
The Wii has four basic ways of communicating with the environment -- games on disc, savegames on SD card, channels/VCs on SD card and updates downloaded from the Internet. All of them need to be protected for the Wii security model to keep its integrity. Different security methods are used for each of the 4 methods, with some similarities between them.
 +
 
 +
A detailed list of flaws can be found at [[Wii system flaws]].
  
 
== Definitions ==
 
== Definitions ==
 
* [http://en.wikipedia.org/wiki/Encryption Encryption]: Technology used to prevent unauthorized parties from viewing data. The Wii uses [http://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES]-128-CBC.
 
* [http://en.wikipedia.org/wiki/Encryption Encryption]: Technology used to prevent unauthorized parties from viewing data. The Wii uses [http://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES]-128-CBC.
** [http://en.wikipedia.org/wiki/Symmetric-key_algorithm Symmetric Encryption]: The same key is used for both encryption and decryption. AES is a symmetric cipher.
+
** [http://en.wikipedia.org/wiki/Symmetric-key_algorithm Symmetric Encryption]: The same key is used for both encryption and decryption. AES is a symmetric cipher, meaning the same key is used for encryption and decryption (this is why the key must be kept secret).
 
* [http://en.wikipedia.org/wiki/Hash_function Hashing]: Technology used to detect modification of data. The Wii uses both [http://en.wikipedia.org/wiki/SHA_hash_functions SHA-1] and [http://en.wikipedia.org/wiki/MD5 MD5].
 
* [http://en.wikipedia.org/wiki/Hash_function Hashing]: Technology used to detect modification of data. The Wii uses both [http://en.wikipedia.org/wiki/SHA_hash_functions SHA-1] and [http://en.wikipedia.org/wiki/MD5 MD5].
 
* [http://en.wikipedia.org/wiki/Digital_signature Signing]: Technology used to prevent unauthorized parties from modifying (changing, editing) data. (Generally, this is a combination of encryption and hashing.) For the purposes of signing, the Wii uses [http://en.wikipedia.org/wiki/RSA RSA] and [http://en.wikipedia.org/wiki/Elliptic_curve_cryptography ECC]. Signing is an asymmetric algorithm: a signature can be verified by a party without sufficient information to produce a signature.
 
* [http://en.wikipedia.org/wiki/Digital_signature Signing]: Technology used to prevent unauthorized parties from modifying (changing, editing) data. (Generally, this is a combination of encryption and hashing.) For the purposes of signing, the Wii uses [http://en.wikipedia.org/wiki/RSA RSA] and [http://en.wikipedia.org/wiki/Elliptic_curve_cryptography ECC]. Signing is an asymmetric algorithm: a signature can be verified by a party without sufficient information to produce a signature.
 
* Title: In Wii terminology, a "title" is a self-contained set of code and data. Every game is a title; a channel is a title, etc.
 
* Title: In Wii terminology, a "title" is a self-contained set of code and data. Every game is a title; a channel is a title, etc.
* Content: In Wii terminology, a "content" is piece of code or data. Discs contain one "content" per partition; channels usually contain several "contents" per title.
+
* Content: In Wii terminology, a "content" is a piece of code or data. Discs contain one "content" per partition; channels usually contain several "contents" per title.
  
 
The rest of this page will assume you know the difference between symmetric and asymmetric cryptography.
 
The rest of this page will assume you know the difference between symmetric and asymmetric cryptography.
  
 
== Game discs ==
 
== Game discs ==
Game discs are encrypted to avoid analysis, and signed to avoid modifications.
+
Game discs are encrypted to avoid analysis (as you would need the key from a Wii) and signed by Nintendo to stop modifications.
  
The encryption is a symmetric cipher, 128 bit AES-CBC.  
+
The encryption is a symmetric cipher, 128-bit AES-CBC.  
Each disc usually contains two or more partitions. Each partition has its own AES key, referred to as a "title key". This key is stored on the disc, inside of a "ticket", but it is encrypted with the master AES key. So, with the master AES key you can decrypt the title keys, and with the title keys you can decrypt the partitions. Lucky for us, the master AES key was extracted by the Tweezer hack.
+
Each disc usually contains two or more partitions. Each partition has its own AES key, referred to as a "title key". This key is stored on the disc, inside of a "ticket", but it is encrypted with the master AES key (also known as the '''common''' key). So, with the master AES key, you can decrypt the title keys, which can decrypt the partitions. This master AES key was extracted by the Tweezer hack and has been known publicly since [https://hackmii.com/2008/04/keys-keys-keys/ April 2008].
  
The disc is signed by building SHA-1 hashes of small parts of the disc, then aggregating these hashes into a hierarchical structure, which is finally signed with an asymmetric crypto. This solution is chosen for efficiency, since asymmetric cryptos are extremely slow.
+
The disc is signed by building SHA-1 hashes of small parts of the disc, then aggregating these hashes into a hierarchical structure, which is finally signed with Nintendo's asymmetric private key; this is chosen for speed, as asymmetric cryptography is slower than symmetric.
  
 
For more details, see [[Wiidisc#Partition Data|Partition Data info on the Wiidisc page]].
 
For more details, see [[Wiidisc#Partition Data|Partition Data info on the Wiidisc page]].
  
Typically, the first partition contains system updates, in the form of WAD files. The data content of the WAD files themselves are encrypted and signed, as well. It is encrypted by 128 bit AES-CBC, by a title key. The title key is encrypted with the master AES key, and is stored in the WAD.  
+
Typically, the first partition contains system updates, in the form of WAD files. The data content of the WAD files themselves are encrypted and signed, as well. It is encrypted by 128-bit AES-CBC, by a title key. The title key is encrypted with the master AES key and is stored in the WAD.
 +
 
 +
=== Exploits ===
 +
* [[Drivechip]] (Homebrew Channel ISO)
 +
 
 +
== Channels on SD cards ==
 +
All channels found on an SD card are signed by the Wii to prevent tampering, similar to discs but with a per-console key. However, only their binary is signed, so things such as banners can still be modified.
  
 
=== Exploits ===
 
=== Exploits ===
* [[Twilight hack]]
+
* [[Bannerbomb]]
* [[Smash Stack]]
 
* [[Indiana Pwns]]
 
  
 
== Save games on SD cards ==
 
== Save games on SD cards ==
When you copy a save game from your Wii system memory to an SD card (in "Data Management"), it encrypts it with an AES key known to all consoles (SD-key). This serves only to keep prying eyes from reading a save game file. In crypto terminology, the SD-key is a "shared secret".
+
When copying a save game from a Wii system memory to an SD card (in "Data Management"), it encrypts it with an AES key known to all consoles (SD-key). This serves only to keep prying eyes from reading a save game file. In crypto terminology, the SD-key is a "shared secret".
  
Your Wii then signs the file on the SD card with its private (ECC) key. This is to prevent anyone from modifying the save file while it is on the SD card.
+
The Wii then signs the file on the SD card with its private (ECC) key. This is to prevent anyone from modifying the save file while it is on the SD card.
  
If I then give you a copy of my save file, your Wii can decrypt it because it knows the SD-key. However, it has no way of checking your Wii's signature, because it doesn't know my console's public key. To solve this problem, the save game also contains a copy of my Wii's public key -- the one that matches the private key it used to sign the save file. (This copy of my Wii's public key is called a 'certificate'.)
+
If someone shares save games to another Wii using an SD card, the Wii will be able to decrypt it using the shared secret. However, it has no way of checking the Wii's signature, because it doesn't know the other console's public key. To solve this problem, the save game also contains a copy of the Wii's unique public key -- the one that matches the private key used to sign the save file. (The copy of the Wii's public key is called a 'certificate'.)
  
Now your Wii can verify that my Wii signed the file, but it has no way of knowing whether it was really a real Wii that signed it, or if I just made up a new random ECC key to try to fool it. To solve this problem, the certificate stored inside of the save game is then signed with Nintendo's private key. All Wiis have Nintendo's public key stored in their firmware; your Wii can use that key to verify the signature on the certificate. If the certificate is valid, it can verify the signature on the save game against my Wii's signature.
+
Thanks to this, the Wii can verify that the file is signed, but it has no way of knowing whether it was a real Wii that signed it, or if the key was just generated randomly. To solve this, each Wii's certificate used for save game signing is also signed by Nintendo using their private key which all Wii's must know for game signature validation.
  
We solved the chicken-and-egg problem with our original memory-dumping hack. We extracted a private ECC key from one console. Since any Wii can read any savefile, we only need to have one key -- it doesn't need to be re-encrypted / re-signed every time.
+
The original memory-dumping hack for the Wii solves the problem of needing a key to sign a new save; a private ECC key was extracted from one console, and since any Wii can read any savefile signed by a Wii's certificate, there can just be one shared key for exploits -- it doesn't need to be re-encrypted / re-signed every time.
  
== Channels on SD cards ==
+
=== Exploits ===
{{Expand section}}
+
* [[Twilight hack]]
 +
* [[Smash Stack]]
 +
* [[Indiana Pwns]]
 +
* [[Bathaxx]]
 +
=== Unexploitable But Vulnerable ===
 +
* [[Super Mario Galaxy savefile]]
 +
 
 +
== Message Board ==
 +
The Wii Message Board is able to read messages from an SD card if properly signed using the Wii's MAC address. LetterBomb and other exploits use this as a way to run unsigned code on the Wii from the System Menu. This exploit was originally discovered by giantpune.
  
 
=== Exploits ===
 
=== Exploits ===
* [[Bannerbomb]]
+
* [[Wilbrand]]
 +
* [[LetterBomb]]
 +
 
 +
== Internet ==
 +
The [[Internet Channel]] for the Wii does not feature the ability to download files by any normal means. By running unsigned code via bookmarking, it is possible to send unsigned code to the Wii and run exploit code.
 +
 
 +
The EULA for WiiConnect24 and Wii Shop downloads HTML from Nintendo's official servers over HTTP; by using a DNS server, it can instead run unsigned code to run an exploit via the EULA channel.
  
== Internet updates ==
+
=== Exploits ===
{{Expand section}}
+
* [[FlashHax]]
 +
* [[Str2hax]]
  
 
{{stub}}
 
{{stub}}
[[Category:Wii Software]]
+
[[Category:Wii documentation]]

Latest revision as of 01:15, 25 May 2022

The Wii has four basic ways of communicating with the environment -- games on disc, savegames on SD card, channels/VCs on SD card and updates downloaded from the Internet. All of them need to be protected for the Wii security model to keep its integrity. Different security methods are used for each of the 4 methods, with some similarities between them.

A detailed list of flaws can be found at Wii system flaws.

Definitions

  • Encryption: Technology used to prevent unauthorized parties from viewing data. The Wii uses AES-128-CBC.
    • Symmetric Encryption: The same key is used for both encryption and decryption. AES is a symmetric cipher, meaning the same key is used for encryption and decryption (this is why the key must be kept secret).
  • Hashing: Technology used to detect modification of data. The Wii uses both SHA-1 and MD5.
  • Signing: Technology used to prevent unauthorized parties from modifying (changing, editing) data. (Generally, this is a combination of encryption and hashing.) For the purposes of signing, the Wii uses RSA and ECC. Signing is an asymmetric algorithm: a signature can be verified by a party without sufficient information to produce a signature.
  • Title: In Wii terminology, a "title" is a self-contained set of code and data. Every game is a title; a channel is a title, etc.
  • Content: In Wii terminology, a "content" is a piece of code or data. Discs contain one "content" per partition; channels usually contain several "contents" per title.

The rest of this page will assume you know the difference between symmetric and asymmetric cryptography.

Game discs

Game discs are encrypted to avoid analysis (as you would need the key from a Wii) and signed by Nintendo to stop modifications.

The encryption is a symmetric cipher, 128-bit AES-CBC. Each disc usually contains two or more partitions. Each partition has its own AES key, referred to as a "title key". This key is stored on the disc, inside of a "ticket", but it is encrypted with the master AES key (also known as the common key). So, with the master AES key, you can decrypt the title keys, which can decrypt the partitions. This master AES key was extracted by the Tweezer hack and has been known publicly since April 2008.

The disc is signed by building SHA-1 hashes of small parts of the disc, then aggregating these hashes into a hierarchical structure, which is finally signed with Nintendo's asymmetric private key; this is chosen for speed, as asymmetric cryptography is slower than symmetric.

For more details, see Partition Data info on the Wiidisc page.

Typically, the first partition contains system updates, in the form of WAD files. The data content of the WAD files themselves are encrypted and signed, as well. It is encrypted by 128-bit AES-CBC, by a title key. The title key is encrypted with the master AES key and is stored in the WAD.

Exploits

Channels on SD cards

All channels found on an SD card are signed by the Wii to prevent tampering, similar to discs but with a per-console key. However, only their binary is signed, so things such as banners can still be modified.

Exploits

Save games on SD cards

When copying a save game from a Wii system memory to an SD card (in "Data Management"), it encrypts it with an AES key known to all consoles (SD-key). This serves only to keep prying eyes from reading a save game file. In crypto terminology, the SD-key is a "shared secret".

The Wii then signs the file on the SD card with its private (ECC) key. This is to prevent anyone from modifying the save file while it is on the SD card.

If someone shares save games to another Wii using an SD card, the Wii will be able to decrypt it using the shared secret. However, it has no way of checking the Wii's signature, because it doesn't know the other console's public key. To solve this problem, the save game also contains a copy of the Wii's unique public key -- the one that matches the private key used to sign the save file. (The copy of the Wii's public key is called a 'certificate'.)

Thanks to this, the Wii can verify that the file is signed, but it has no way of knowing whether it was a real Wii that signed it, or if the key was just generated randomly. To solve this, each Wii's certificate used for save game signing is also signed by Nintendo using their private key which all Wii's must know for game signature validation.

The original memory-dumping hack for the Wii solves the problem of needing a key to sign a new save; a private ECC key was extracted from one console, and since any Wii can read any savefile signed by a Wii's certificate, there can just be one shared key for exploits -- it doesn't need to be re-encrypted / re-signed every time.

Exploits

Unexploitable But Vulnerable

Message Board

The Wii Message Board is able to read messages from an SD card if properly signed using the Wii's MAC address. LetterBomb and other exploits use this as a way to run unsigned code on the Wii from the System Menu. This exploit was originally discovered by giantpune.

Exploits

Internet

The Internet Channel for the Wii does not feature the ability to download files by any normal means. By running unsigned code via bookmarking, it is possible to send unsigned code to the Wii and run exploit code.

The EULA for WiiConnect24 and Wii Shop downloads HTML from Nintendo's official servers over HTTP; by using a DNS server, it can instead run unsigned code to run an exploit via the EULA channel.

Exploits