Editing Vulnerabilities
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
== CD/DVD Swap tricks == | == CD/DVD Swap tricks == | ||
=== Swap Magic === | === Swap Magic === | ||
Line 43: | Line 37: | ||
Released on 15-08-2003 by Marcus R. Brown <mrbrown@0xd6.org>. | Released on 15-08-2003 by Marcus R. Brown <mrbrown@0xd6.org>. | ||
Homebrew programs can be launched directly from a Memory Card on unmodified consoles by using a certain software that takes advantage of a long known and used exploit, dealing with the boot part of the EE/IOP process (PS2 Independence exploit) | Homebrew programs can be launched directly from a Memory Card on unmodified consoles by using a certain software that takes advantage of a long known and used exploit, dealing with the boot part of the EE/IOP process (PS2 Independence exploit). | ||
See [[PS2 Independence]]. | See [[PS2 Independence]]. | ||
=== OSDSYS === | === OSDSYS === | ||
Line 150: | Line 117: | ||
* [https://www.ps2-home.com/forum/viewtopic.php?f=10&t=3361 ESRPatcher Pro for Windows Release 07-16-2009 source code by insanity5000] | * [https://www.ps2-home.com/forum/viewtopic.php?f=10&t=3361 ESRPatcher Pro for Windows Release 07-16-2009 source code by insanity5000] | ||
=== | === Playstation 2 Linux RTE === | ||
==== Linux ==== | ==== Linux ==== | ||
To | To document | ||
= Games = | = Games = | ||
Line 178: | Line 137: | ||
== Network games == | == Network games == | ||
It is possible to exploit | It is possible to exploit network-capable games, to inject codes. This is perfect for Slim PS2 and people which can not move files to the MC. | ||
TnA scarcely mentioned that method since January 2019, like it can be seen in the comments of @Haldrie's video about the time-swap. TnA got the basic idea from some discoveries someone else mentioned. | |||
The problem is to either inject it elsewhere, or find a way to run it. | |||
== | == PS1 Savedata exploits == | ||
The existing FreePSXBoot exploit chain for PS1 does not work on the PS2 (mainly inside mcman), due to the fact that the internal structure is different. | |||
In mcman, there is no bounds check on linked_block member access relative to arrays on stack: https://github.com/ps2dev/ps2sdk/blob/d976e57349645cb940a9e0f9ec0207c16472ca2c/iop/memorycard/mcman/src/main.c#L3041-L3072 | |||
The code looks similar in 3.1.0 (last) mcman modules. | |||
Briefly looking at it, it is possible to control where to write (basically positive 16 bit signed value), but not what value should be written (limited to 0-15). | |||
So a straightforward port of the FreePSXBoot chain is not possible. For working on this exploit, it would need to have knowledge of the thread stack layout at mcserv and afterwards, and possibly mirrored memory. | |||
= | See [https://psdevwiki.com/ps1/index.php?title=Vulnerabilities PS1 Dev Wiki Vulnerabilities]. | ||
=== BOOT.ELF (Fat PS2 consoles only) === | |||
[https://sksapps.haldrie.com/bootleg/tutorials/fmcb/armax2.php Official sp193 guide (backup)] | |||
There exists a vulnerability using a PS1 game as a 'boot' disc to load a modified savedata which in turn runs arbitrary code. This method allows for installation of homebrew such as FMCB. In order to utilize this vulnerability you would need a gameshark or similar cheat device to transfer the modded save over from USB and you also need a PC tool to make the savedata modifications and a USB pen drive to use as a medium to transfer the save data from PC>USB>MC. Once you place the modified PS1 game savedata onto a PS2 memory card, just load your boot disc, and voila. | |||
== PS2 Savedata exploits == | == PS2 Savedata exploits == | ||
Line 222: | Line 167: | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+ | ||
!Game/Application | !Game/Application | ||
!Vulnerability | !Vulnerability | ||
!Description | !Description | ||
! | !Revisions | ||
!Date of discovery | !Date of discovery | ||
!Discovered | !Discovered by | ||
|- | |- | ||
|Carol Vorderman's Sudoku | |Carol Vorderman's Sudoku | ||
|Stack Buffer Overflow via unchecked string length | |Stack Buffer Overflow via unchecked string length | ||
|The save data file stores plaintext profile and high-score names. One can use a large string to overwrite the stack and jump to unsigned code. | |The save data file stores plaintext profile and high-score names. One can use a large string to overwrite the stack and jump to unsigned code. | ||
This vulnerability is also present in the PSP version of the game. See the [https://github.com/ChampionLeake/SudokuSTACK PSP exploit]. | This vulnerability is also present in the PSP version of the game. See the [https://github.com/ChampionLeake/SudokuSTACK PSP exploit]. | ||
| | |N/A | ||
|December 2021 (2011-01-06 for PSP) | |December 2021 (2011-01-06 for PSP) | ||
|ChampionLeake for PS2, Jeerum for PSP | |ChampionLeake for PS2, Jeerum for PSP | ||
|- | |- | ||
|Star Wars Racer Revenge | |Star Wars Racer Revenge | ||
|Stack-Smash via unchecked "Record Name" length | |Stack-Smash via unchecked "Record Name" length | ||
|The game allows players to record their names when breaking lap records on a course. However when displaying the Hall of Fame, the size of the names are not checked. Using a very large name can overwrite addresses on the stack and gain control of $ra, which can be used to jump to unsigned code. | |The game allows players to record their names when breaking lap records on a course. However when displaying the Hall of Fame, the size of the names are not checked. Using a very large name can overwrite addresses on the stack and gain control of $ra, which can be used to jump to unsigned code. | ||
| | |N/A | ||
|August 2023 | |August 2023 | ||
|ChampionLeake | |ChampionLeake | ||
|- | |- | ||
| | |OKAGE: Shadow King | ||
|Stack Buffer Oveflow via unchecked "Player/Town" name length | |||
|Stack Buffer | |Successfully exploit through mast1c0re for the PS4/PS5. | ||
| | CTurt's Writeup: [https://cturt.github.io/mast1c0re.html Here] | ||
[https://github. | McCaulay's Writeup: [https://mccaulay.co.uk/mast1c0re-introduction-exploiting-the-ps4-and-ps5-through-a-gamesave/?t=1 Here] | ||
|N/A | |||
[https:// | |||
| | |||
|September 14th, 2022 | |September 14th, 2022 | ||
|CTurt | |CTurt & McCaulay | ||
|} | |} | ||
=== Confirmed vulnerable games === | === Confirmed vulnerable games === | ||
==== OKAGE: Shadow King ==== | ==== OKAGE: Shadow King ==== | ||
Line 350: | Line 226: | ||
* The records pages data are stored as follows: each track has its own page. Each page contains three categories of records: best total time, best lap time and best KO's count. For each category of record, the three best records are stored as three signed int (4 bytes) for the time/most KO's count, followed by three 21-byte string for the player's name, which must be null-terminated as they are each copied using an unsafe strcpy function. | * The records pages data are stored as follows: each track has its own page. Each page contains three categories of records: best total time, best lap time and best KO's count. For each category of record, the three best records are stored as three signed int (4 bytes) for the time/most KO's count, followed by three 21-byte string for the player's name, which must be null-terminated as they are each copied using an unsafe strcpy function. | ||
< | <source lang="C"> | ||
typedef struct track_record_struct { // size is 0xEA bytes | typedef struct track_record_struct { // size is 0xEA bytes | ||
int best_total_time[3]; | int best_total_time[3]; | ||
Line 380: | Line 256: | ||
- 119000 NORMAL.ICO -> standard PS2 savedata icon | - 119000 NORMAL.ICO -> standard PS2 savedata icon | ||
*/ | */ | ||
</ | </source> | ||
===== Bug description ===== | ===== Bug description ===== | ||
Line 401: | Line 277: | ||
* It is guessed that at least 0xB7B bytes of the savedata can be overwritten with a MIPS shellcode without breaking the main menu. | * It is guessed that at least 0xB7B bytes of the savedata can be overwritten with a MIPS shellcode without breaking the main menu. | ||
* savedata string address: 0x61b76c in pcsx2 but may depend on PS2 BIOS: | * savedata string address: 0x61b76c in pcsx2 but may depend on PS2 BIOS: | ||
< | <source lang="C"> | ||
PTR_DAT_00383100 = 0x4339a0; | PTR_DAT_00383100 = 0x4339a0; | ||
MAIN_CTX_OFF = 0x2dc; | MAIN_CTX_OFF = 0x2dc; | ||
Line 408: | Line 284: | ||
player_data_address = main_ctx + CTX_PLAYER_DATA_ADDR_OFF; // =(pcsx2)= 0x60b470 + 0x102f0 = 0x61B760; | player_data_address = main_ctx + CTX_PLAYER_DATA_ADDR_OFF; // =(pcsx2)= 0x60b470 + 0x102f0 = 0x61B760; | ||
player_data_address = *0x00433C7C + 0x102f0; // in summary | player_data_address = *0x00433C7C + 0x102f0; // in summary | ||
</ | </source> | ||
===== Official cheat codes ===== | ===== Official cheat codes ===== | ||
Line 423: | Line 299: | ||
* When using a save data that was badly hand-modified to unlock every characters and circuits, a bug can occur in the record page: only one of the pages can be accessed. Pressing left or right to change track page makes sound but remains on this page. | * When using a save data that was badly hand-modified to unlock every characters and circuits, a bug can occur in the record page: only one of the pages can be accessed. Pressing left or right to change track page makes sound but remains on this page. | ||
==== GTA III | ==== GTA III ==== | ||
* [https://github.com/halpz/re3/blob/9a7fa478578beaba947ea867c15a25e411d641d8/src/save/MemoryCard.cpp#L358 vulnerability] | * [https://github.com/halpz/re3/blob/9a7fa478578beaba947ea867c15a25e411d641d8/src/save/MemoryCard.cpp#L358 vulnerability] | ||
The game does a copy from the memory card into a fixed-size buffer with size supplied by the savedata. | The game does a copy from the memory card into a fixed-size buffer with size supplied by the savedata. | ||
==== Dark Cloud 1 and 2 ==== | ==== Dark Cloud 1 and 2 ==== | ||
Line 531: | Line 323: | ||
Dark Cloud 2 uses a scripting engine described [https://tcrf.net/User:Kojin/Dark_Cloud_2_Technical_Information#Scripting_Engine here]. | Dark Cloud 2 uses a scripting engine described [https://tcrf.net/User:Kojin/Dark_Cloud_2_Technical_Information#Scripting_Engine here]. | ||
==== Soul Calibur III ==== | ==== Soul Calibur III ==== | ||
Line 788: | Line 338: | ||
https://gamefaqs.gamespot.com/boards/915821-playstation-2/79857492?page=3 | https://gamefaqs.gamespot.com/boards/915821-playstation-2/79857492?page=3 | ||
=== Possible vulnerable games === | |||
==== Jak X: Combat Racing ==== | |||
There is a bug with the autosave feature that corrupts save data on memory card. It was fixed in the Platinum version of the game. | |||
https://gamefaqs.gamespot.com/boards/927166-jak-x-combat-racing/41999721 | |||
There is a bug, at least in PCSX2, where when starting the game for the first time and creating a new profile, the game freezes on the memory card saving screen. The save data is however well written and on next tries the game can be played as the save is correctly loaded. | |||
https://github.com/PCSX2/pcsx2/issues/6935 | |||
Profile name is limited to 12 characters by keyboard. The game displays up to ?32? characters and the profile name can be extended by editing saveX-Y-0000000Z.bin in the PSU savedata file. Extending profile name does not create any buffer overflow. The strings in the center of the saveX-Y-0000000Z.bin file cannot be edited for an unknown reason, else the game loops infinitely on the save data loading screen. | |||
==== Metal Gear Solid 3: Subsistence ==== | ==== Metal Gear Solid 3: Subsistence ==== | ||
There is bug with the PCSX2 emulator and MGS3: Subsistence that causes save files to become corrupt. While the exact cause of this issue is unknown, anyone using the PCSX2 | There is bug with the PCSX2 emulator and MGS3: Subsistence that causes save files to become corrupt. While the exact cause of this issue is unknown, anyone using the PCSX2 emulaor with the saves below should wait a few seconds after accessing the memory to save the game and use the US BIOS. This seems to greatly reduce the likelihood of the bug corrupting the file. Also, do not save MGS3 on a memory card file that has a lot of other saves, because the bug corrupts the entire memory card. | ||
https://retromaggedon.com/index.php/metal-gear-solid-3-subsistence-save-files-ps2/ | https://retromaggedon.com/index.php/metal-gear-solid-3-subsistence-save-files-ps2/ | ||
Line 808: | Line 372: | ||
2. I had to restart the game. The game-save between chapters seemed to stop responding, so I turned it off. This corrupted the save file. | 2. I had to restart the game. The game-save between chapters seemed to stop responding, so I turned it off. This corrupted the save file. | ||
==== | ==== All FIFA games ==== | ||
FIFA06, FIFA08, FIFA Street 2 are vulnerable on Nintendo DS. See [https://github.com/CTurt/Dara|DARA by CTurt]. | |||
Moreover, a lot of Electronics Arts games are vulnerable on PSP. | |||
==== Psychonauts ==== | ==== Psychonauts ==== | ||
Line 838: | Line 389: | ||
* SavedGame* file format is "\n"-separated with also bars (|) separators. On each line is a setting. Each setting is made of between 1 and three parts separated by bars. Table|<name>|<value>. The name part is mandatory. | * SavedGame* file format is "\n"-separated with also bars (|) separators. On each line is a setting. Each setting is made of between 1 and three parts separated by bars. Table|<name>|<value>. The name part is mandatory. | ||
* There is a digest check on psu-embedded files as the game says that the "profile is damaged" when the savedata is edited without precaution. Using pypsu by McCaulay, one can extract files contained in the psu, but there are even more digests as any SavedGame* file is detected as "Damaged Save Game" after editing it too much. The SavedGame* files start with a 16-byte MD5 hash of the following data. | * There is a digest check on psu-embedded files as the game says that the "profile is damaged" when the savedata is edited without precaution. Using pypsu by McCaulay, one can extract files contained in the psu, but there are even more digests as any SavedGame* file is detected as "Damaged Save Game" after editing it too much. The SavedGame* files start with a 16-byte MD5 hash of the following data. | ||
==== Lego games ==== | ==== Lego games ==== | ||
LEGO Star Wars II: The Original Trilogy and LEGO Indiana Jones: The Original Adventures use a custom checksum: | LEGO Star Wars II: The Original Trilogy and LEGO Indiana Jones: The Original Adventures use a custom checksum: | ||
Line 955: | Line 397: | ||
* Calc. Length: FileSize - 4 | * Calc. Length: FileSize - 4 | ||
< | <source lang="csharp"> | ||
private int CalculateChecksum(byte[] data) { | private int CalculateChecksum(byte[] data) { | ||
using (var xIO = new MasterIO(data, Endian.Big)) { | using (var xIO = new MasterIO(data, Endian.Big)) { | ||
Line 965: | Line 407: | ||
} | } | ||
} | } | ||
</ | </source> | ||
LEGO Star Wars may use the same checksum or no checksum at all. LEGO Batman: The Videogame may use the same checksum or the newer checksum: | |||
* Offset: 12 | |||
* Calc. Start: 16 | |||
* Calc. Length: Filesize - 16 | |||
<source lang="csharp"> | |||
private int CalculateChecksum(byte[] data, int offset, int size) { | |||
* | int sum = -1; | ||
for (int i = 0; i < size; ++i) { | |||
sum *= 0x1000193; | |||
sum ^= data[offset++]; | |||
* | } | ||
return ~sum; | |||
} | |||
</source> | |||
* | |||
= | |||
* | |||
= | |||
==== List of other games ==== | ==== List of other games ==== | ||
See [https://github.com/libretro/LRPS2/blob/main/resources/GameIndex.yaml a list of almost all PS2 games]. Some may be vulnerable. | See [https://github.com/libretro/LRPS2/blob/main/resources/GameIndex.yaml a list of almost all PS2 games]. Some may be vulnerable. |