Cyber Necromancy: Resurrecting the Dead (Game Servers)

Matthew Halchyshak (Security Technician), Joseph Tartaro (Security Consultant · IOActive)

BruCON 0x06 · Day 2

Overview

In "Cyber Necromancy: Resurrecting the Dead (Game Servers)," Matthew Halchyshak and Joseph Tartaro unveil the intricate and often arduous process of bringing defunct online console game servers back to life. Their presentation at BruCON details the multi-year project to revive the online functionalities of Metal Gear Online 1 (MGO1) for PlayStation 2 and Metal Gear Online 2 (MGO2) for PlayStation 3, both of which were shut down by Konami, leaving players without any official means of online play. The talk is a deep dive into the unique challenges of reverse engineering closed-source, client-only console games when no server-side information or packet captures are available.

Watch on YouTube

Visual summary for Cyber Necromancy: Resurrecting the Dead (Game Servers) by Matthew Halchyshak, Joseph Tartaro
Visual summary for Cyber Necromancy: Resurrecting the Dead (Game Servers) by Matthew Halchyshak, Joseph Tartaro

Key moments

  1. 0:00 Introduction to Cyber Necromancy: resurrecting Metal Gear Online
  2. 7:00 Using PS2 cheat device codes for memory patching to bypass DNAS
  3. 14:00 Konami's advanced SSL certificate pinning requiring binary patching
  4. 18:00 Discovering and bypassing the 4-byte hardcoded XOR key
  5. 34:00 Mapping game items and unlocking hidden DLC and unreleased dev content
  6. 40:40 Overcoming multi-client communication challenges to enable game joining
  7. 46:30 Warnings about project scope, legal aspects, and community management

Cyber Necromancy: Resurrecting the Dead (Game Servers)

Speakers: Matthew Halchyshak (Security Technician); Joseph Tartaro (Security Consultant, IOActive)

Conference: BruCON

YouTube: https://www.youtube.com/watch?v=VUSfPlrbXPg

Overview

In "Cyber Necromancy: Resurrecting the Dead (Game Servers)," Matthew Halchyshak and Joseph Tartaro unveil the intricate and often arduous process of bringing defunct online console game servers back to life. Their presentation at BruCON details the multi-year project to revive the online functionalities of Metal Gear Online 1 (MGO1) for PlayStation 2 and Metal Gear Online 2 (MGO2) for PlayStation 3, both of which were shut down by Konami, leaving players without any official means of online play. The talk is a deep dive into the unique challenges of reverse engineering closed-source, client-only console games when no server-side information or packet captures are available.

This talk is not about traditional exploitation or memory corruption, nor is it a development guide. Instead, it chronicles a remarkable feat of technical perseverance and problem-solving. Halchyshak and Tartaro meticulously describe how they navigated console limitations, proprietary network protocols, and anti-cheat systems with only the game client as their starting point. The project, hosted at savemgo.com, serves as a testament to the dedication of the gaming community and the power of reverse engineering to preserve digital heritage against the obsolescence imposed by server shutdowns.

The significance of this work extends beyond mere nostalgia. It highlights critical security considerations in game development, particularly regarding hardcoded secrets, client-side trust, and the longevity of online services. By demonstrating how to bypass authentication, decrypt custom protocols, and recreate complex server logic, the speakers provide invaluable insights into the vulnerabilities inherent in many online systems and offer a blueprint for similar preservation efforts.

Background

▶ Watch: Introduction to Cyber Necromancy: resurrecting Metal Gear Online (0:00)

The core problem addressed by Halchyshak and Tartaro stems from the ephemeral nature of online-only games, especially those hosted on proprietary servers for consoles. Unlike PC games where private servers are common (e.g., Minecraft, where server binaries or extensive packet captures are often available), console games present a unique set of challenges. When Konami shut down MGO1 after just one year and MGO2 after four, players were left with no way to access the online modes, as there was no local area network (LAN) play option. The developers had no access to the original game servers, their binaries, or any network traffic captures from when the servers were operational. All they had was the game client.

This "client-only" scenario forced a highly unconventional reverse engineering approach. For the PlayStation 2, the console's lack of native debugging features meant that traditional methods of setting breakpoints or examining memory were unavailable. While they eventually found a workaround using emulator memory dumps, the initial hurdle was significant. The PlayStation 3 version presented its own obstacles; an official game update had actually removed the online mode from the game menu, and running modified game binaries necessitated a custom firmware (CFW) on the console itself, limiting accessibility for players on official firmware.

The fundamental process for reproducing any network service involves redirecting traffic, implementing known protocols, and then implementing the game's specific protocol. However, without server-side insight, each step became an exercise in educated guesswork, pattern recognition, and meticulous static and dynamic analysis of the client's behavior. This talk meticulously details how the team tackled these fundamental steps, revealing the layers of complexity beneath seemingly simple online interactions.

Key Findings

▶ Watch: Konami's advanced SSL certificate pinning requiring binary patching (14:00)

The talk meticulously details several key technical findings and bypasses that were critical to resurrecting the Metal Gear Online servers:

  • Traffic Redirection via Custom DNS: The most straightforward initial step was redirecting game traffic. Since acquiring the original domain was legally ambiguous and patching console binaries was difficult for widespread distribution, the team opted for a custom DNS server. Players would configure their console to use this DNS, which would then direct game requests to the savemgo.com private server instead of Konami's defunct servers.
  • STUN Protocol Bypass: The STUN (Session Traversal Utilities for NAT) protocol, used for NAT traversal in peer-to-peer communication, was found to be a non-issue. The team simply ran their own STUN daemon or pointed DNS records to a public server, which easily satisfied the client's requirements.
  • DNAS (Dynamic Network Authentication System) Bypass on PS2: This was a major hurdle. Sony's DNAS was an anti-cheat and anti-piracy system that verified legitimate disks and prevented modified clients from going online. The team used PCSX2, a PS2 emulator, to create memory dumps when the game saved. By analyzing these dumps, they discovered a string: new_dnas_connect. Following the assembly code path associated with this string, they identified a function that, when forced to return zero, bypassed the entire DNAS check. To implement this for real consoles, they leveraged GameShark/Game Genie cheat devices. These devices allow runtime memory modification using specific code formats. A C (conditional) code would check a memory address, and if a condition passed, a 2 (overwrite) code would write a specific value (e.g., 0x00000000) to a target address, effectively patching the DNAS function to return success.
  • PSN Service Bypass on PS3: For MGO2 on PS3, the PlayStation Network (PSN) service presented a similar authentication barrier. A leaked Sony SDK proved invaluable here. The team found a function call responsible for loading the PSN API. Within the associated data structure, a network_type field differentiated between a "network game" (type 0) and a "network game with PSN access" (type 1). By patching this value to type 0, they disabled PSN integration. Further, they identified and patched out calls to psn_api functions that retrieved the user's PSN ID and checked for age restrictions (e.g., for chat). This required a custom firmware (CFW) on the PS3 to run the modified, unsigned game binary.
  • HTTP Protocol Reverse Engineering: Both MGO1 and MGO2 used HTTP for user and account management, and MGO2 additionally used it for version checks and an in-game reward shop. Reversing this involved:
  • Guesswork: Sending null, ASCII zero (hex 0x30), or generic success codes to observe client behavior.
  • Live Debugging: Setting breakpoints on functions like receive web response or URL decode in tools like IDA Pro.
  • Server-Side Manipulation: Modifying their own server's responses and observing client behavior.
  • They found that often, the client would accept a generic success message (e.g., sending 0x00000000) and proceed, even if the server hadn't fully implemented the underlying logic.
  • SSL Certificate Pinning: Konami had implemented SSL certificate pinning correctly on both PS2 and PS3. This meant the client would only trust specific, embedded certificates, preventing a simple Man-in-the-Middle (MITM) attack with custom certificates. This necessitated the binary patching approach (requiring CFW on PS3) to bypass SSL checks altogether.
  • Custom Game Protocol Discovery and Decryption: This was the most complex part.
  • XOR Encryption: Initial raw packet analysis showed repeating patterns (e.g., "ZPZP") and a lack of null bytes. This was a strong indicator of XOR encryption. They discovered a 4-byte hardcoded key that was used across MGO1 (2006), MGO2 (2008), and several other Konami titles, making decryption trivial once identified.
  • Packet Structure: After XOR decryption, a consistent packet structure emerged: an 8-byte header (containing a command code, payload length, sequence number, and an MD5 hash of the payload and header) followed by the actual payload.
  • Payload Reversal: This was an iterative and highly tedious process involving:
  • Pattern Recognition: Identifying sequence numbers (client and server had independent sequences), command codes (e.g., 0x202 for request, 0x203 for response), and payload length indicators.
  • Reflection Testing: For data reflected to the user (e.g., lobby names, player stats), sending modified values (like "AAAA" or "BBBB") to see how they appeared in the game client, thus mapping byte ranges to specific data fields.
  • Bit Field Analysis: User settings and item properties were often stored as complex bit fields, requiring individual bit manipulation and observation.
  • DLC and Dev Items: Through item shop payload reversal, they discovered that much of MGO2's downloadable content (DLC) was already present in the game's initial release (version 1.0), merely locked. They also uncovered unreleased "dev items" like unique masks and outfits.
  • Complex Flow Reversal (Friends List, Join Game): For functionalities like the friends list, they observed a specific list-handling protocol (empty packet, list data packet, empty packet). Joining a game was a multi-step process involving requests for host info, player stats, and complex unknown payloads. For these, they resorted to static analysis, searching for command codes in disassembly, tracing code paths, and patching out unknown or unimplemented sections (e.g., specific player stats payloads) with NOP instructions or forced return values.
  • Peer-to-Peer Gameplay: The actual in-game data (gameplay) was found to occur over UDP in a peer-to-peer fashion, with the server primarily facilitating initial connections by relaying host IP addresses.

Technical Deep Dive

▶ Watch: Discovering and bypassing the 4-byte hardcoded XOR key (18:00)

The technical journey to resurrect Metal Gear Online servers was a masterclass in reverse engineering under severe constraints. The team's approach was a blend of dynamic observation, static analysis, and iterative experimentation.

The initial hurdle of traffic redirection was solved elegantly with a custom DNS server. This allowed them to intercept all game-related network requests from the console. Since the original game servers were offline, the console would query the custom DNS for konami.com or similar game-related domains, receiving the IP address of the savemgo.com server in response, thus routing all traffic.

Bypassing Sony's Dynamic Network Authentication System (DNAS) on the PS2 was a significant challenge. DNAS was designed to prevent piracy and cheating by verifying the authenticity of game discs and client binaries. Without direct debugging access to the PS2, the team utilized PCSX2, a PlayStation 2 emulator. By running the game in the emulator and saving its state, they could generate memory dumps. Scrutinizing these dumps, they stumbled upon the string new_dnas_connect. This string served as a crucial anchor. They then used a disassembler (likely IDA Pro) to locate this string in the game's executable and trace back the code execution path. This led them to a function that was ultimately responsible for the DNAS check. By observing its behavior, they determined that modifying this function to simply return 0 (or a similar success code) would bypass the entire system. Implementing this on physical PS2 consoles was achieved using GameShark cheat codes. These codes, often entered manually by players, are essentially memory patches. The speakers demonstrated a simple C (conditional) code to check a specific memory address (e.g., 0x8xxxxxxx) and a 2 (overwrite) code to write a 4-byte value (e.g., 0x00000000) to the DNAS function's return address, effectively forcing a successful return. This is a classic example of patching an application's logic at runtime.

For the PlayStation 3's PSN integration, a leaked Sony SDK provided an invaluable advantage. This SDK exposed internal function names and data structures, significantly accelerating the static analysis process. The team identified the psn_api loading function. Within the data structure passed to this function, a network_type field dictated how the game interacted with PSN. Changing this from type 1 (network game with PSN access) to type 0 (standard network game) effectively decoupled the game from PSN. Further analysis revealed specific API calls for retrieving the PSN ID and enforcing age restrictions. These were simply patched out using NOP (No Operation) instructions or by forcing a successful return value. These binary patches, however, require the PS3 to be running custom firmware (CFW) to execute unsigned code. The speakers noted that IDA scripts were available to easily unpack and analyze PS3 binaries, further streamlining this process.

The HTTP protocol was reversed through a combination of dynamic observation and guesswork. Since the team controlled the savemgo.com server, they could craft arbitrary responses. By sending null or ASCII 0 (0x30) in response to version checks or authentication requests, they observed how the client reacted. They used IDA Pro to set breakpoints on functions related to receive web response and URL decode to understand how the client parsed server responses and constructed its own requests. This revealed that for many operations, the client would accept a generic success code (e.g., four bytes of 0x00) and proceed, even if no meaningful data was returned. This "faking success" strategy allowed them to progress through many client functionalities without fully implementing the server-side logic initially.

The most intricate part was reversing the custom game protocol. Raw packet captures (obtained from a community member) were initially indecipherable hex data. The absence of null bytes and the presence of repeating 4-byte sequences like "ZPZP" strongly suggested XOR encryption. Through experimentation, they identified a 4-byte hardcoded key that was consistently applied across MGO1, MGO2, and other Konami titles. This key allowed them to decrypt the packets, revealing their true structure.

Decrypted packets revealed a consistent 8-byte header followed by a payload. The header contained the command code, payload length, a sequence number, and an MD5 hash of the header and payload. The sequence numbers were found to be independent for the client and server. The MD5 hash provided integrity checking, ensuring packets hadn't been tampered with.

Reversing the payloads was a highly iterative and often tedious process:

  • Lobby Listing: By sending modified lobby data (e.g., changing names to "AAAA", "BBBB"), they observed how the game client reflected these changes. This allowed them to map byte offsets to specific data fields (e.g., 15 bytes for name, 15 bytes for IP, followed by port). They also found unknown 4-byte identifiers that, despite their best efforts, seemed to have no functional impact when altered, suggesting they might be internal, unused, or simply identifiers.
  • User Settings: These were often represented as large bit fields. The process involved changing a single setting in the client, observing the change in the outgoing packet, and then correlating that change to specific bits within the payload. This required painstaking, byte-by-byte analysis.
  • Item Shop: Similar to user settings, item data was mapped by manipulating item IDs and color codes, sending them to the server, and observing what items and variations appeared in the client. This led to the discovery that much of the game's DLC was already present in the initial release, and they even uncovered unreleased "dev items" like unique masks and outfits.
  • Friends List: This functionality used a specific "list" protocol: an empty packet to initiate, a packet containing the list data, and another empty packet to signify completion. The team had to replicate this specific sequence of command codes (e.g., 0x4580, 0x4581, 0x4582) to get the client to parse the friends list.
  • Joining a Game: This was the most challenging. It involved multiple client-server interactions: requesting game data, host information, and player stats. For unknown payloads (like specific player stats requests, e.g., command 0x4103), they had to resort to static analysis. This involved searching for the command code (0x4103) within the game's disassembled code, tracing the control flow, identifying the corresponding function handler, and then patching it out (e.g., with NOPs or return 0) to allow the client to proceed. Eventually, they discovered that the actual gameplay occurred over UDP in a peer-to-peer fashion, with the server acting primarily as a matchmaker to relay the host's IP address to joining players. The challenge was ensuring the server properly relayed authorization between multiple clients (host and joining player).

Demo / Proof of Concept

▶ Watch: Overcoming multi-client communication challenges to enable game joining (40:40)

While the talk itself did not feature a live, interactive demonstration, the entire savemgo.com project stands as a monumental proof of concept for "Cyber Necromancy." The speakers regularly showed screenshots from the resurrected Metal Gear Online games, illustrating their progress and the functional state of the private servers.

Key visual evidence and demonstrations included:

  • Functional Lobby Listings: Screenshots of the in-game lobby, showing custom server names and player counts, demonstrating successful parsing of the custom game protocol's lobby data.
  • Reflected Data: Examples of how modifying server responses (e.g., sending "AAAA" for a player name) would directly manifest in the game client, validating their understanding of payload structures.
  • Item Shop and Unlocked Content: Visuals of players accessing and equipping items, including those that were originally DLC or even unreleased "dev items" like unique masks and outfits, proving the successful reversal of the item shop protocol and the inherent unlockable nature of in-game content.
  • The "First Game in Six Years": The ultimate success metric was the ability for players to actually join and play a game online. The speakers proudly announced that their efforts led to the "first game in six years" on the resurrected servers, confirming the successful implementation of the complex multi-client, peer-to-peer connection logic.

The project itself, savemgo.com, serves as an ongoing, living demonstration of the techniques and findings presented, allowing players worldwide to experience these "dead" games once more.

Defensive Implications

▶ Watch: Warnings about project scope, legal aspects, and community management (46:30)

The "Cyber Necromancy" project, while a celebration of reverse engineering prowess and game preservation, also unearths several critical defensive implications for developers of online services, particularly games:

  1. Avoid Hardcoded Secrets: The discovery of a 4-byte XOR key hardcoded and reused across multiple Konami titles (MGO1, MGO2, Pro Evolution Soccer) is a glaring security vulnerability. Hardcoded keys are easily extracted through static analysis and, once discovered, compromise all systems using them. Modern security practices demand robust key management, dynamically generated keys, or at minimum, per-session ephemeral keys, coupled with strong, modern encryption algorithms, not simple XOR.
  1. Implement Robust Authentication and Authorization: The DNAS and PSN bypasses highlight weaknesses in authentication logic. Returning 0 from a DNAS function or changing a network_type flag should not be sufficient to bypass core security checks. Servers must always validate client requests thoroughly, and client-side flags should never be trusted for security decisions. Proper server-side authentication, secure token exchange, and robust authorization checks are paramount.
  1. Strong Cryptography, Not Obfuscation: Simple XOR is a form of obfuscation, not encryption. It provides minimal security and is easily defeated. Developers should employ industry-standard, well-vetted cryptographic algorithms (e.g., AES-256 with appropriate modes and key management) for all sensitive network communications. The fact that Konami implemented SSL certificate pinning correctly is a positive defensive measure, as it makes Man-in-the-Middle attacks harder, though even this was bypassed through binary patching requiring custom firmware.
  1. Never Trust the Client: The success of "faking success" and sending generic 0x00 values to trick the client into progressing demonstrates a fundamental flaw: trusting the client. The server should be the single source of truth for game state, user settings, and item ownership. If a server receives a save_settings request, it should validate the settings and persist them, not just send a success message. This principle applies to all online services.
  1. Secure API Design: While the game's custom protocol was complex to reverse, the patterns (command codes, sequence numbers, MD5 hashes) eventually emerged. Clear, well-defined APIs, even if internal, should still be designed with security in mind. Parameter validation, rate limiting, and robust error handling on the server-side can make reverse engineering more difficult and prevent exploitation.
  1. Consider End-of-Life Strategies for Online Games: From a broader perspective, the entire project underscores the need for game developers and publishers to consider the longevity of their online titles. When servers are shut down, the game effectively dies. Companies could adopt strategies to preserve these games, such as releasing server binaries, official private server kits, or comprehensive API documentation to the community. This would foster goodwill, preserve gaming history, and mitigate the need for complex, unauthorized reverse engineering efforts.

Key Takeaways

  • Reverse Engineering Closed Systems is Achievable but Tedious: Resurrecting online console games without server access or packet captures is possible through a painstaking combination of dynamic analysis (emulator memory dumps, live debugging), static analysis (disassembly, code tracing), and iterative guesswork.
  • Weak Security Practices Aid Reversal: Hardcoded XOR keys, simple authentication bypasses (like returning zero from a DNAS function or modifying a network type flag), and excessive client-side trust significantly accelerate reverse engineering efforts.
  • Specialized Tools and Community Contributions are Crucial: Emulators (PCSX2), disassemblers (IDA Pro), and leaked SDKs (Sony SDK) are invaluable. Furthermore, community-provided resources like partial packet captures or shared knowledge can be critical turning points in complex projects.
  • Even Robust Security Measures Can Be Bypassed with Console Access: While Konami correctly implemented SSL certificate pinning, this was ultimately circumvented by binary patching the game client, which required custom firmware on the PS3 to run the modified, unsigned code.
  • Patience and Pattern Recognition are Paramount: Identifying repeating byte sequences, understanding packet headers (command, length, sequence, hash), and meticulously mapping payload data through reflection testing are time-consuming but essential steps in reconstructing unknown protocols.
  • The "Cyber Necromancy" Model Preserves Digital History: This project demonstrates a powerful method for game preservation, allowing players to revisit online experiences that would otherwise be lost to server shutdowns, highlighting the importance of community-driven efforts in digital heritage.

About the Speaker(s)

Matthew Halchyshak is a Security Technician whose day job involves application pen testing. His passion for gaming and reverse engineering led him to co-lead the ambitious Cyber Necromancy project, focusing on the intricate details of protocol analysis and system bypasses for Metal Gear Online.

Joseph Tartaro is a Security Consultant with IOActive. A self-proclaimed Metal Gear Solid player, Joseph brought his professional security expertise to the project, contributing to the complex reverse engineering challenges and the overall architecture of the resurrected game servers.

Reviews

  • Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★

→ Top-rated talks at BruCON 0x06

All talks from BruCON 0x06