Time Traveling Exploitation: Remote Code Execution in a 10,000 Day Old Game Protocol

Riley Kidd (Adversary Simulation Specialist · National Australia Bank)

BSides Canberra VIII (2025) · Day 1 · Main Track

Overview

In "Time Traveling Exploitation: Remote Code Execution in a 10,000 Day Old Game Protocol," Riley Kidd of National Australia Bank takes attendees on a fascinating journey through the evolution of software exploitation, using the classic real-time strategy game Age of Empires as a case study. The talk demonstrates how a single, ancient buffer overflow vulnerability in the game's multiplayer protocol could be exploited using techniques spanning over two decades, from rudimentary methods prevalent in the late 90s to modern, AI-assisted approaches. Kidd's personal connection to the game, which fostered his early interest in hacking, provides a unique narrative framework, drawing parallels between the game's "ages" and the progression of cybersecurity tools and attacker methodologies.

Watch on YouTube

Visual summary for Time Traveling Exploitation: Remote Code Execution in a 10,000 Day Old Game Protocol by Riley Kidd
Visual summary for Time Traveling Exploitation: Remote Code Execution in a 10,000 Day Old Game Protocol by Riley Kidd

Key moments

  1. 0:00 Introduction and Time Traveling Exploitation premise
  2. 2:50 Discovering sprintf buffer overflow in DirectPlay protocol
  3. 5:50 Tool Age: Custom bad byte encoding for shellcode
  4. 8:45 Bronze Age: Introducing Return-Oriented Programming (ROP)
  5. 11:00 Leveraging code page translation to expand ROP gadgets
  6. 14:00 Iron Age: Evaluating LLMs for reverse engineering tasks
  7. 20:00 Live demo: Remote code execution via game name overflow
  8. 21:00 Evolution of exploitation: Changes and enduring principles

Time Traveling Exploitation: Remote Code Execution in a 10,000 Day Old Game Protocol

Speakers: Riley Kidd, Adversary Simulation Specialist, National Australia Bank

Conference: BSides Canberra

YouTube: https://www.youtube.com/watch?v=7dXaGKF-73Y

Overview

In "Time Traveling Exploitation: Remote Code Execution in a 10,000 Day Old Game Protocol," Riley Kidd of National Australia Bank takes attendees on a fascinating journey through the evolution of software exploitation, using the classic real-time strategy game Age of Empires as a case study. The talk demonstrates how a single, ancient buffer overflow vulnerability in the game's multiplayer protocol could be exploited using techniques spanning over two decades, from rudimentary methods prevalent in the late 90s to modern, AI-assisted approaches. Kidd's personal connection to the game, which fostered his early interest in hacking, provides a unique narrative framework, drawing parallels between the game's "ages" and the progression of cybersecurity tools and attacker methodologies.

The presentation is a masterclass in foundational exploitation concepts, illustrating how core principles like controlling the instruction pointer and bypassing mitigation techniques have evolved. It meticulously details the technical nuances of crafting exploits in different eras, from manual shellcode generation and custom bad byte decoders to leveraging Return-Oriented Programming (ROP) and the nascent capabilities of large language models (LLMs) for reverse engineering and script generation. Beyond the nostalgic appeal, the talk serves as a critical reminder that fundamental vulnerabilities, especially in legacy systems, can persist for extended periods and remain exploitable, albeit with increasingly sophisticated techniques required to bypass modern defenses.

Ultimately, this talk matters because it bridges the gap between historical exploitation and contemporary security challenges. It highlights the enduring relevance of low-level technical understanding for security professionals, even as tools and mitigations become more advanced. Furthermore, Kidd's exploration of LLMs for offensive security tasks provides valuable insights into the current state and future potential of AI assistance in vulnerability research, demonstrating both impressive capabilities for repetitive tasks and significant limitations in complex, creative problem-solving required for full exploit chain development.

Background

▶ Watch: Introduction and Time Traveling Exploitation premise (0:00)

The genesis of this talk lies in the historical real-time strategy game, Age of Empires, a title that profoundly influenced speaker Riley Kidd's early interest in computers, hacking, and the internet. Released over 10,000 days ago, the game utilizes a venerable multiplayer protocol known as DirectPlay, an old peer-to-peer system that manages game sessions through unencrypted packet exchanges. This protocol, predating modern networking stacks and security considerations, forms the vulnerable foundation for the entire exploitation narrative.

Kidd frames the evolution of exploitation techniques using an analogy from Age of Empires itself, where players advance through different "ages" to gain access to new tools and technologies. This structure allows for a chronological exploration of how a single vulnerability would be approached across different periods:

  • Stone Age (Early 2000s): Characterized by rudimentary understanding, relying on pre-compiled "hacks" downloaded from the internet.
  • Tool Age (Mid-2000s): Marked by the emergence of early debuggers like OllyDbg, network analyzers like Ethereal (now Wireshark), and disassemblers such as IDA Pro. This era focused on manual reverse engineering and exploit development.
  • Bronze Age (Late 2000s - Early 2010s): Saw the rise of exploit frameworks like Metasploit and more advanced techniques like Return-Oriented Programming (ROP), designed to bypass early exploit mitigations.
  • Iron Age (Modern Day - 2025): Represents the contemporary landscape, featuring advanced reverse engineering frameworks like Ghidra and the experimental application of Large Language Models (LLMs) to security tasks.

The core problem that persists across these ages is a classic buffer overflow vulnerability within the game's sprintf function. This function, used to format strings into a buffer, was found to be vulnerable because it set a counter to the maximum signed 32-bit value for bounds checking. If the caller's buffer was smaller than the generated format string, data would overflow past the buffer without proper bounds checks, potentially allowing an attacker to control the execution flow. The target of this vulnerability was the game name advertised by players when hosting a multiplayer session, which was sent unencrypted over the DirectPlay protocol.

Key Findings

▶ Watch: Tool Age: Custom bad byte encoding for shellcode (5:50)

The talk uncovers several significant findings regarding both the specific vulnerability and the broader landscape of exploitation:

  1. Persistent Vulnerability in Legacy Protocols: A buffer overflow in the sprintf function within the Age of Empires DirectPlay protocol, identified in a game released over 10,000 days ago, remains the fundamental flaw throughout the presentation. This highlights how vulnerabilities in old, unmaintained codebases can persist indefinitely, especially in protocols designed without modern security considerations.
  1. Evolution of Exploitation Techniques: The talk meticulously demonstrates the progression of exploitation methods:
  • From simple stack-based overflows leveraging the absence of mitigations in Windows XP.
  • To more sophisticated Return-Oriented Programming (ROP) chains necessary to achieve reliable execution when static addresses are not guaranteed.
  • And finally, to the experimental use of Large Language Models (LLMs) for assisting with various stages of the exploit development process.
  1. Impact of Exploit Mitigations: A crucial finding is the dramatic increase in difficulty for exploitation as modern operating system mitigations are introduced. While the vulnerability was trivially exploitable on Windows XP due to the lack of DEP (Data Execution Prevention) and ASLR (Address Space Layout Randomization), these protections, along with Stack Canaries and Control Flow Integrity (CFI), would effectively render this specific exploit chain unfeasible on a modern system. This underscores the effectiveness of contemporary security measures in raising the barrier to entry for attackers.
  1. LLMs as Powerful, Yet Limited, Security Assistants: The "Iron Age" section provides a nuanced view of LLM capabilities in offensive security:
  • Strengths: LLMs, especially when integrated with tools like Ghidra via an MCP server, proved excellent at reverse engineering tasks such as adding comments, renaming functions and variables, and understanding control flow. They were also highly effective at generating and refining fuzzing scripts.
  • Limitations: LLMs struggled significantly with identifying the specific vulnerable call in the binary without explicit guidance, often fixating on non-existent format string vulnerabilities. Crucially, they failed to autonomously complete complex exploit chain elements, such as correctly interfacing with the game's DirectPlay protocol or designing a functional ROP chain that accounted for all control flow changes, or creating a robust shellcode decoder for a restricted character set. Their ethical guardrails also sometimes hindered refining "hacking-related" code.
  1. Foundational Concepts Endure: Despite the vast changes in tools and mitigations, the core principles of understanding memory corruption, controlling instruction flow, identifying bad bytes, and performing low-level assembly analysis remain fundamental. The talk emphasizes that while the "game has changed," these foundational skills are still paramount for vulnerability identification and exploit development.

Technical Deep Dive

▶ Watch: Leveraging code page translation to expand ROP gadgets (11:00)

The technical core of this talk is structured around the "ages" of exploitation, each building upon the last with increasing sophistication.

Stone Age: Initial Discovery and Basic Exploitation Concepts

The journey begins in the Stone Age (analogous to the early 2000s), where the speaker, as a young enthusiast, would download "hacks" for Age of Empires from sites like Ask Jeeves. This era, exemplified by tools like Neutrorain (a generic "hacker tool"), represents a time of rudimentary understanding. The key takeaway here is the concept of running untrusted binaries, often leading to undesirable outcomes. While not technically deep, it sets the stage for the personal motivation behind the research.

Tool Age: Manual Reverse Engineering and Stack Overflow

Advancing to the Tool Age (mid-2000s), the focus shifts to manual reverse engineering and exploit development. Tools like OllyDbg (a debugger), Ethereal (now Wireshark for network analysis), and IDA Pro (a disassembler/decompiler) become central.

  1. Vulnerability Identification: By opening the game binary in IDA, Kidd identified a classic sprintf pattern. This function, used to format strings into a buffer, was found to be vulnerable because it used a max signed 32-bit value for bounds checking. If the caller's buffer was smaller than the generated format string, data would overflow. Cross-references in IDA and dynamic hooking with OllyDbg helped pinpoint calls to this function. The critical instance was found when advertising a multiplayer game, where the game name was passed to sprintf. Static analysis revealed 144 bytes reserved on the stack for this buffer.
  1. Protocol Analysis: Using Ethereal, unencrypted packets containing the game name were observed. Extensive packet analysis and documentation review revealed the use of DirectPlay, an old peer-to-peer protocol. Crucially, the protocol specification allowed for game names much larger than the 144-byte stack buffer. This confirmed the potential for a remote buffer overflow.
  1. Exploitation on Windows XP: With the vulnerability identified, the goal was to control the instruction pointer.
  • Offset Determination: A De Bruijn sequence was sent as the oversized game name to precisely determine the offset to the saved instruction pointer on the stack.
  • Bad Bytes: Sending every possible byte revealed bad bytes (null bytes, and bytes in the 0x80-0x9F range, which were converted to 0x2D). These bytes needed to be avoided in the shellcode.
  • Mitigation Absence: Windows XP lacked modern mitigations like DEP and ASLR, meaning the stack was executable, and system DLLs loaded at predictable addresses.
  • Jump ESP: To execute shellcode on the stack, a jump ESP instruction was located in user32.dll. This instruction would transfer execution to the address currently in the ESP register, which would point to the attacker's payload. The exploit structure on the stack was: overflow bytes, followed by the address of jump ESP, which then redirected to the payload.
  1. Custom Shellcode and Decoder: Due to the bad bytes, a custom decoder stub was necessary.
  • Decoder Logic: The decoder stub first sets up the payload length using negation. A jump/call instruction is used to push the current location to the stack. Registers like EDI (pointing to shellcode) and ESI (pointing to the decoder) are set up. The decoder then loops through each encoded byte, subtracting one (to avoid null bytes, which are bad) and then subtracting pre-calculated encoder values in place to restore the original shellcode. This method allows encoding any byte, including those that would otherwise be considered bad.
  • Manual Shellcode: The shellcode itself was manually crafted to achieve a reverse shell. This involved:
  • Setting up a stack frame.
  • Traversing the Process Environment Block (PEB) to locate loaded modules.
  • Calculating hashes to resolve LoadLibraryA and GetProcAddress.
  • Loading ws2_32.dll and using its functions to set up a TCP socket.
  • Creating a command process (cmd.exe) and redirecting its input/output pipes to the established socket, thus providing remote code execution.

Bronze Age: Return-Oriented Programming (ROP) and Encoding Bypass

The Bronze Age (late 2000s - early 2010s) introduces more advanced techniques, acknowledging the limitations of hardcoded addresses.

  1. Reliability Challenge: The jump ESP address from user32.dll was static for a specific OS version, making the exploit unreliable across different Windows XP installations. Alternatives like partial overwrites, SEH overwrites, or heap spraying were deemed unfeasible.
  1. Return-Oriented Programming (ROP): Inspired by publications like Phrack 58 (2001), ROP was chosen. ROP leverages small snippets of existing code (called gadgets) that typically end in a RET instruction. By chaining these gadgets, an attacker can perform arbitrary operations while maintaining control of the stack. The goal was to find a ROP chain that would ultimately lead to a jump ESP instruction.
  • Gadget Search Challenges: The main game binary, EmpireX.exe, had a preferred load address containing a null byte, making its internal jump ESP unusable directly. A language library loaded by the game had usable memory addresses, but its gadgets were not suitable for pivoting to the stack.
  1. Code Page Translation for Bad Byte Reduction: A critical insight was gained from observing how the game handled the wide string (UTF-16LE) game name, which was converted to ASCII for display. This code page translation mechanism, using functions like WideCharToMultiByte, revealed that certain UTF-16LE sequences could translate into single-byte ASCII values that were previously considered bad bytes (e.g., C62 (UTF-16LE) could become 88 (ASCII), which is useful). This effectively reduced the bad bytes corpus, making shellcode and gadget finding easier.
  1. ROP Chain Construction: With a reduced bad byte set, a ROP chain was constructed from the language library to achieve a jump ESP.
  • Gadget 1 (Control Registers): A gadget to pop values from the stack into specific registers (e.g., ECX, ESI).
  • Gadget 2 (XOR Data): A gadget to XOR data at an address with a value in EBX.
  • Gadget 3 (Jump to Address): A gadget to jump to the value at a specific address.
  • Chain Logic: The plan was to use the first gadget to prepare the stack and registers. Then, using the second gadget, XOR a specific known memory location with a calculated value to write the address of the jump ESP instruction (from the main game binary, which now had a usable address after the code page trick). Finally, the third gadget would jump to this newly written address, leading to the jump ESP and ultimately to the shellcode on the stack.
  • MSFVenom: The shellcode and decoder generation were significantly simplified using tools like MSFVenom, a component of Metasploit.

Iron Age: LLMs for Reverse Engineering and Exploit Assistance

The Iron Age (modern day) explores the use of Large Language Models (LLMs) with advanced tools like Ghidra. The primary question was whether LLMs could perform or assist with reverse engineering, vulnerability finding, and exploit chain completion.

  1. LLM for Reverse Engineering: Integrated with Ghidra via an MCP server, the LLM demonstrated strong capabilities:
  • Adding comments to decompiled code.
  • Renaming functions and variables.
  • Understanding control flow.
  • Focusing on specific prompted areas (e.g., multiplayer code).
  • The resulting code was significantly more readable than raw IDA output. Conclusion: Yes, LLMs can help with reverse engineering.
  1. LLM for Vulnerability Finding: This was less clear-cut.
  • The LLM was "obsessed" with non-existent format string vulnerabilities.
  • It eventually identified the sprintf function but struggled to find the specific vulnerable call without direct hints.
  • It did, however, identify other vulnerabilities (a one-byte overflow, arbitrary null byte write) that the speaker hadn't noticed.
  • **Conclusion: No, for finding this specific vulnerability autonomously, but capable of finding others with coaching.**
  1. LLM for Fuzzing Scripts: This was a strong point for the LLM.
  • It successfully created and updated fuzzing scripts.
  • It helped test ideas, like searching for byte sequences that could act as pointers.
  • It made good suggestions, such as looking for offsets instead of direct matches.
  • It could "beautify" working exploit scripts. Ethical guardrails sometimes required framing requests as "homework" to bypass.
  • Conclusion: Yes, absolutely, LLMs can create useful fuzzing scripts.
  1. LLM for Completing the Exploit Chain: This proved to be the LLM's weakest area.
  • Game Interface: Despite understanding the general process, the LLM failed to generate code that could correctly create valid DirectPlay packets to interface with the game.
  • ROP Chain: The LLM proposed an "elegant" XCHG instruction gadget, but it failed to account for the resulting control flow, causing a jump to a random location instead of returning to the stack.
  • Shellcode Decoder (Restricted Charset): The LLM produced a similar decoder stub to the manual one but with significant limitations: a static key, a 255-byte shellcode limit, and crucially, no usable key for actual working shellcode. Attempts to refine it often led to a loop where the LLM refused to help further, citing "hacking" objections.
  • Conclusion: No, LLMs cannot complete the exploit chain without significant, specific human intervention and correction.

Demo / Proof of Concept

▶ Watch: Iron Age: Evaluating LLMs for reverse engineering tasks (14:00)

The talk culminates in a compelling live demonstration of the "Tool Age" exploit, showcasing the practical impact of the vulnerability.

  1. Exploit Setup: The demo begins with the exploit script running. This script, which the LLM had previously "beautified" with extensive logging, is designed to listen for and respond to DirectPlay game advertisements.
  2. Victim Action: On the right side of the screen, a user is shown searching for a new game within Age of Empires. This action triggers the game to send broadcast packets over the network, seeking available game sessions.
  3. Exploit Execution:
  • The running exploit script intercepts these DirectPlay packets.
  • It processes the incoming packet, extracting debug information.
  • It then crafts a malicious response packet, embedding the specially engineered buffer overflow payload, including the custom decoder stub and the reverse shell shellcode.
  • This crafted packet is sent back to the victim machine, advertising a "fake" game name that is intentionally oversized.
  • When the victim's game client processes this malformed game name, the sprintf buffer overflow is triggered, allowing the attacker to control the instruction pointer.
  1. Remote Code Execution: The jump ESP instruction (or the ROP chain in the Bronze Age variant) redirects execution to the decoder on the stack, which then restores and executes the embedded shellcode. The shellcode establishes a reverse shell back to the attacker's machine.
  2. Interactive Shell: The demonstration concludes with the attacker gaining an interactive command prompt on the victim's machine. Riley Kidd successfully executes commands, proving remote code execution. He notes that a cleaner exploit would involve hiding the command window and allowing the game to continue running without crashing, but this was beyond the scope of the demonstration.

This demo effectively illustrates the full lifecycle of the exploitation, from network packet interception to gaining control over the remote system, reinforcing the severity of the vulnerability and the efficacy of the developed exploit chains.

Defensive Implications

▶ Watch: Evolution of exploitation: Changes and enduring principles (21:00)

The "Time Traveling Exploitation" talk offers critical insights for defenders, highlighting both the enduring nature of fundamental attack techniques and the evolution of defensive strategies.

What's Changed (and what defenders should leverage):

  1. Network Infrastructure: The shift from peer-to-peer DirectPlay with required port forwarding to centralized, encrypted communication streams significantly raises the bar for network-based attacks. Defenders should prioritize encrypted protocols (TLS/SSL), robust authentication, and minimize direct peer-to-peer connections in modern applications.
  2. Tools: The evolution from basic scripting to advanced frameworks like Metasploit, sophisticated disassemblers like IDA Pro and Ghidra, and now LLM-assisted analysis, means attackers have more powerful tools. Defenders must similarly leverage advanced security tools for static/dynamic analysis, threat intelligence, and automated vulnerability scanning.
  3. Exploit Mitigations: The most profound change is the widespread adoption of exploit mitigations:
  • ASLR (Address Space Layout Randomization): Randomizes memory locations, making jump ESP addresses and ROP gadget locations unpredictable, thus breaking hardcoded exploits.
  • DEP (Data Execution Prevention): Prevents code execution from data segments (like the stack), directly thwarting stack-based shellcode.
  • Stack Canaries: Detects buffer overflows on the stack by placing a sentinel value before the return address.
  • Control Flow Integrity (CFI): Ensures that code execution follows expected paths, further complicating ROP chains.
  • Defenders must ensure these mitigations are enabled and properly configured on all systems, especially for critical applications. Patching and updating operating systems and software is paramount to benefit from these advancements.
  1. Higher Barrier to Entry: Trivial bugs are less common, and modern exploitation often requires complex chains. This means defenders should focus on defense-in-depth, as attackers need to bypass multiple layers.
  2. Automated Payload Generation: Frameworks like MSFVenom automate shellcode and encoder generation. Defenders should use Endpoint Detection and Response (EDR) solutions that can detect known malicious payloads and post-exploitation activity.

What's Stayed the Same (and why foundational knowledge is crucial for defenders):

  1. Base Concepts: Understanding memory corruption, controlling instruction flow, and basic exploit conditions remains foundational. Defenders need to grasp these low-level concepts to truly understand the impact of vulnerabilities and design effective countermeasures. This knowledge is essential for incident response, malware analysis, and vulnerability assessment.
  2. Basic Exploit Process: Identifying offsets, finding bad characters, and navigating mitigations are still core to exploitation. Defenders should perform regular security assessments, including penetration testing and red teaming, that simulate these processes to uncover weaknesses.
  3. Vulnerability Identification: Reverse engineering, fuzzing, and code tracing are timeless discovery tools. Defenders should encourage and invest in secure code reviews, static application security testing (SAST), dynamic application security testing (DAST), and fuzzing as part of their Software Development Life Cycle (SDLC).
  4. Low-Level Primitives: Understanding assembly, op codes, calling conventions, and registers is vital for analyzing exploits and understanding the true nature of RCEs. Security analysts, especially those in incident response and malware analysis roles, benefit immensely from this deep technical understanding.

Specific Recommendations for Age of Empires-like Legacy Systems:

  • Input Validation: Implement stringent input validation for all user-supplied data, especially for network protocols. Never trust user input, particularly for string lengths or format. Use safe string handling functions (e.g., snprintf with proper size arguments) instead of vulnerable ones like sprintf.
  • Protocol Security: Avoid unencrypted, unauthenticated protocols like DirectPlay for any modern application. If legacy protocols must be used, encapsulate them within secure tunnels (e.g., VPNs) and apply strict network segmentation.
  • Code Review and Auditing: For critical legacy applications, perform thorough code audits to identify and remediate known vulnerability patterns, especially buffer overflows.
  • Isolation and Sandboxing: Run legacy applications in isolated environments or virtual machines to limit the blast radius of any successful exploitation.

In conclusion, while the tools and mitigations have evolved dramatically, the underlying principles of exploitation remain constant. Defenders must not only keep pace with modern defenses but also maintain a deep understanding of these foundational attack concepts to effectively protect against both new and "time-traveling" threats.

Key Takeaways

  • Foundational Exploitation Concepts Endure: Despite two decades of technological advancement, core principles like understanding memory corruption, controlling instruction flow, and identifying bad bytes remain fundamental to exploitation, highlighting the importance of low-level technical skills for security professionals.
  • Modern Mitigations are Critical: The journey from Windows XP's lack of defenses to today's ASLR, DEP, Stack Canaries, and CFI demonstrates the profound impact of exploit mitigations in raising the barrier to entry for attackers and making trivial exploits nearly impossible on modern systems.
  • LLMs as Powerful, Yet Limited, Assistants: Large Language Models excel at repetitive and analytical tasks like reverse engineering (commenting, control flow analysis) and generating fuzzing scripts, but they currently struggle with complex, novel vulnerability identification and the creative, context-aware problem-solving required for full exploit chain development, especially concerning specific protocol interactions or nuanced gadget selection.
  • Protocol Analysis is Paramount: Deep understanding of network protocols, even ancient ones like DirectPlay, is crucial for identifying and exploiting network-based vulnerabilities, particularly when dealing with unencrypted traffic and undocumented packet structures.
  • Legacy Systems are Enduring Targets: The demonstration of remote code execution in a "10,000 day old game protocol" underscores that vulnerabilities in unmaintained, legacy software and protocols can persist indefinitely and remain exploitable, requiring defenders to consider the security posture of their entire technological stack, not just modern components.
  • Encoding and Code Page Nuances Matter: Understanding how character encodings (e.g., UTF-16LE to ASCII) and code page translation mechanisms work can be a critical technique for bypassing bad byte restrictions, expanding the range of usable characters for shellcode and ROP gadgets.

About the Speaker(s)

Riley Kidd is an Adversary Simulation Specialist at the National Australia Bank, where his work focuses on proactively emulating the tactics, techniques, and procedures of tracked threat actors. Beyond his role at the bank, Riley is a prolific contributor to the cybersecurity community, having created numerous training courses available on platforms such as Udemy, TCM, and Pluralsight. He also actively runs the 247 CTF, maintains a YouTube channel, and shares his insights through a personal blog. An avid collector of security-related items, Riley is a self-professed Age of Empires fan, a passion that directly inspired the "Time Traveling Exploitation" talk. This presentation marked his first time attending BSides Canberra, an event he had long wished to experience.

Reviews

→ Top-rated talks at BSides Canberra VIII (2025)

All talks from BSides Canberra VIII (2025)