Deserialization Payloads for Exploits Made Easy with Go-Based .NET and Java Gadget Generation

Jonathan Peterson (VulnCheck)

Wild West Hackin' Fest @ Mile High 2026 · Day 1

Overview

In this insightful talk from Wild West Hackin' Fest @ Mile High, Jonathan Peterson of VulnCheck presents a novel approach to generating deserialization payloads for both .NET and Java targets. The presentation, titled "Deserialization Payloads for Exploits Made Easy with Go-Based .NET and Java Gadget Generation," introduces a Go-based library and command-line interface (CLI) tool that fundamentally simplifies the exploit development process for a prevalent class of vulnerabilities. Peterson, a vulnerability researcher and exploit developer, outlines the limitations of existing methods and demonstrates how his team's work addresses these challenges, offering a more portable, transparent, and user-friendly solution.

Watch on YouTube

Visual summary for Deserialization Payloads for Exploits Made Easy with Go-Based .NET and Java Gadget Generation by Jonathan Peterson
Visual summary for Deserialization Payloads for Exploits Made Easy with Go-Based .NET and Java Gadget Generation by Jonathan Peterson

Key moments

  1. 0:00 Introduction to Go-based deserialization payloads
  2. 2:00 Challenges with existing Ysoserial tools
  3. 4:37 The third option: constructing gadgets directly from protocols
  4. 6:38 Modeling serialization protocols as Go structs
  5. 8:45 Go's cross-compilation advantage and library usage
  6. 10:20 Live demo: Generating and exploiting with Java gadget
  7. 13:00 Q&A: .NET vs Java protocol implementation challenges

Deserialization Payloads for Exploits Made Easy with Go-Based .NET and Java Gadget Generation

Speakers: Jonathan Peterson, Initial Access Intelligence Team, VulnCheck

Conference: Wild West Hackin' Fest @ Mile High

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

Overview

In this insightful talk from Wild West Hackin' Fest @ Mile High, Jonathan Peterson of VulnCheck presents a novel approach to generating deserialization payloads for both .NET and Java targets. The presentation, titled "Deserialization Payloads for Exploits Made Easy with Go-Based .NET and Java Gadget Generation," introduces a Go-based library and command-line interface (CLI) tool that fundamentally simplifies the exploit development process for a prevalent class of vulnerabilities. Peterson, a vulnerability researcher and exploit developer, outlines the limitations of existing methods and demonstrates how his team's work addresses these challenges, offering a more portable, transparent, and user-friendly solution.

The core of Peterson's work lies in programmatically reconstructing serialization gadgets directly within Go, eliminating the need for external tools like Ysoserial or Ysoserial.net, which often impose significant environmental and operational hurdles. This innovation is particularly relevant for exploit developers, penetration testers, and security researchers who frequently encounter deserialization vulnerabilities. By abstracting away the complexities of setting up specific runtime environments or manually patching opaque binary blobs, the Go-based approach streamlines the creation of malicious payloads, making weaponization of these critical flaws more efficient and accessible.

This talk highlights VulnCheck's commitment to advancing initial access intelligence and exploit development through open-source contributions. The presented library is a key addition to their Go exploit framework, designed to provide robust and portable exploit capabilities. For organizations and individuals operating in secure or constrained environments, this tool represents a significant leap forward, enabling the generation of necessary payloads without compromising security policies or incurring lengthy approval processes for third-party executables.

Background

▶ Watch: Introduction to Go-based deserialization payloads (0:00)

Deserialization vulnerabilities continue to be a significant threat vector, often leading to remote code execution (RCE). Exploiting these flaws, however, traditionally comes with its own set of operational complexities. Jonathan Peterson outlines the two primary methods currently employed for generating deserialization payloads and elaborates on their respective drawbacks, which ultimately motivated VulnCheck's development of a new Go-based solution.

The most common approach involves leveraging well-known tools like Ysoserial.net for .NET targets or Ysoserial for Java targets. While highly effective, these tools introduce substantial environmental dependencies. Ysoserial.net, for instance, typically requires a Windows environment to run, which can be a hurdle for developers primarily working on Linux or macOS systems. Similarly, Ysoserial necessitates a specific Java Runtime Environment (JRE) version 8, potentially conflicting with other Java applications or requiring careful environment management. For security vendors or penetration testers delivering exploits to clients, instructing them to set up these specific environments or obtain additional software can be problematic. Furthermore, customers operating in highly secure environments often face stringent approval processes, delaying the deployment and use of such tools for months, if approval is granted at all. This friction point can severely impede the timely weaponization and deployment of critical exploits.

The second common method involves generating a raw binary blob from Ysoserial or Ysoserial.net and then dynamically patching specific fields within that blob at runtime. This approach attempts to circumvent the environmental dependencies but introduces new challenges. Serialization protocols, particularly for .NET, can be deceptively complex. What might appear as a simple 2-byte length encoding can actually be a more intricate 7-bit encoding scheme, leading to easily broken payloads if patched incorrectly. Beyond the technical difficulty and proneness to error, this method suffers from a critical lack of transparency. When an exploit contains a large, opaque binary blob, users are justifiably obligated to deobfuscate and scrutinize its contents to ensure no malicious or unintended commands are embedded. This manual verification process is time-consuming and undermines trust, especially in commercial exploit offerings.

VulnCheck's work stems from its mission to provide initial access intelligence and develop exploits for emerging, unauthenticated RCE vulnerabilities. Their internal exploit development framework, Go exploit, built entirely in Go, necessitated a more integrated and portable solution for deserialization payload generation. The existing methods were incompatible with their framework's design philosophy and their customers' operational constraints. The need for a solution that was portable, transparent, and easy to integrate into their Go-based ecosystem became paramount, leading to the development of the Go-based deserialization gadget generator.

Key Findings

▶ Watch: The third option: constructing gadgets directly from protocols (4:37)

Jonathan Peterson's research and development efforts yielded several key findings that underpin the efficacy and utility of his Go-based deserialization gadget generator. These discoveries not only address the practical limitations of existing tools but also offer a deeper understanding of the underlying serialization protocols.

Firstly, a fundamental realization was that serialization protocols, whether for Java or .NET, can be effectively modeled as data structures. By meticulously analyzing existing gadgets and comparing them against official specifications from Microsoft and Java, Peterson determined that the binary streams comprising these payloads are not arbitrary but are structured collections of records. Each record, such as a serialization version header, class information, object ID, or length prefix, can be represented as a distinct data structure (or struct in Go). This insight allowed for a systematic, programmatic approach to payload generation, moving away from opaque blobs or environment-dependent tools.

Secondly, the research confirmed that programmatic generation of deserialization payloads is not only feasible but superior to existing methods. By implementing the logic of the serialization protocols directly in code, the new tool achieves higher accuracy, greater flexibility, and enhanced transparency. This eliminates the guesswork and potential errors associated with manual patching of binary data and removes the environmental overhead of running external, platform-specific tools.

Thirdly, Go's inherent cross-compilation capabilities emerged as a critical advantage. Unlike C or Rust, which often require complex setups for cross-compilation, Go simplifies the process to merely changing a couple of environment variables. This property means that the Go-based gadget generator can be effortlessly compiled for virtually any target platform—Windows, Linux, macOS, or even a Raspberry Pi—without requiring a specific runtime environment on the target system. This unparalleled portability is a significant contribution, making the tool highly adaptable to diverse operational environments.

Finally, Peterson observed striking similarities between the .NET and Java serialization protocols, particularly in how fundamental data types are represented. Despite their distinct ecosystems and complexities (e.g., .NET's specific encoding schemes vs. Java's verbosity), the underlying principles for structuring serialized data share common patterns. This observation facilitated the development of a unified approach to understanding and implementing both protocols within the same Go library, highlighting a deeper, shared architectural lineage in how these platforms handle object serialization. He also mentioned the utility of the Zcar tool, written in Go, which helped in reversing Java binary gadgets by dumping their individual sections, providing a valuable aid in understanding and re-implementing these structures.

Technical Deep Dive

▶ Watch: Modeling serialization protocols as Go structs (6:38)

The technical core of Jonathan Peterson's work revolves around the complete re-implementation of .NET and Java serialization protocols in Go. This approach allows for the dynamic and programmatic construction of malicious payloads, sidestepping the limitations of traditional methods.

The fundamental principle is to treat the serialized data stream as a sequence of well-defined records, each corresponding to a specific part of the serialization protocol. Peterson's process involved:

  1. Dissection of Existing Gadgets: He began by taking known deserialization gadgets (e.g., from Ysoserial) and analyzing their binary structure.
  2. Specification Mapping: These binary patterns were then meticulously mapped against the official serialization specifications provided by Microsoft and Java. This step was crucial for understanding the meaning of each byte sequence and its role within the overall payload. Peterson noted that the .NET documentation could be particularly challenging, often requiring intuition beyond what was explicitly stated.
  3. Struct-Based Modeling: The identified records, such as serialization version headers, system class definitions, object IDs, length prefixes, and data types, were then modeled as custom Go structs. For example, a System.String object in .NET, or a java.lang.String in Java, would have a corresponding Go struct that captures its serialized representation, including its length and character encoding.

For .NET serialization, Peterson highlighted specific complexities. The protocol uses a combination of 2-byte length encoding and 7-bit encoded integers for various fields, which can be easily misinterpreted. A simple change in a command string's length could break a manually patched payload if these encoding rules weren't strictly followed. The Go implementation precisely replicates these encoding schemes within the structs and their associated methods, ensuring accurate payload generation regardless of the input command's length. Additionally, the tool supports generating view state payloads for ASP.NET and addresses the complexities of newer .NET Framework versions (4.5 and above) that employ encryption, HMAC signing, and the SP 108 key derivation algorithm. This requires passing decryption keys and other parameters, mirroring the capabilities of Ysoserial.net but within the portable Go framework.

For Java serialization, while simpler in terms of encoding details compared to .NET, Peterson noted its verbosity. Java gadgets often involve deeply nested serialized objects, where an entire serialized object might be a value within an array, which itself is a value in another array, and so on. This creates a large, complex binary structure. The Go implementation handles this by allowing structs to contain other structs, effectively mirroring the nested object graph within the serialized stream. The Zcar tool, a Go-based utility, proved invaluable in reversing Java gadgets by parsing them into their constituent sections, aiding in the accurate re-implementation of these complex structures.

The actual generation process in Go involves:

  1. Instantiating the relevant Go structs, populating them with user-defined parameters (e.g., the command to execute).
  2. Calling methods on these structs, which apply the serialization logic specified in the protocols, converting the structured data into raw bytes.
  3. Concatenating these byte sequences in the correct order to form the final malicious deserialization payload.

The result is a highly modular and extensible library. As a library, it's designed for simple integration: a single line of Go code can generate a complex gadget. For users unfamiliar with Go, a thin CLI wrapper called Go serializer was developed. This tool mimics the command-line interface of Ysoserial and Ysoserial.net, allowing users to generate payloads with familiar flags, but leveraging the underlying Go library. This provides the best of both worlds: a powerful, flexible library for developers and an easy-to-use CLI for quick payload generation, all without the environmental overhead. The entire framework, including Go exploit and Go serializer, is open-source and available on GitHub, encouraging community contribution and use.

Demo / Proof of Concept

▶ Watch: Live demo: Generating and exploiting with Java gadget (10:20)

Jonathan Peterson provided a concise yet effective demonstration of the Go serializer CLI tool, showcasing its practical application in generating and deploying a Java deserialization payload against a vulnerable target. The demo underscored the ease of use and portability of the Go-based solution.

The demonstration unfolded in several clear steps:

  1. Vulnerable Target Setup: The first action involved spinning up a vulnerable Tomcat host using Docker Compose. This simulated a real-world target susceptible to a known, though unspecified, deserialization CVE. The use of Docker ensured a clean, reproducible environment for the demonstration.
  2. HTTP Server for Command Execution Confirmation: Concurrently, a local HTTP server was set up. The purpose of this server was to act as a listener, receiving an HTTP request from the payload once command execution was achieved on the vulnerable Tomcat server. This provided a tangible and immediate visual confirmation that the injected command had successfully executed.
  3. Payload Generation with Go serializer: Peterson then used the Go serializer CLI tool to generate a Java deserialization gadget. The command-line flags were analogous to those one might use with Ysoserial, specifying the desired gadget chain and the command to execute (in this case, a curl command designed to send a request back to the local HTTP listener). The tool wrote the generated binary payload to a file.
  4. Payload Delivery and Execution: Finally, the generated payload file was passed as binary data to a curl command. This curl command sent the malicious serialized object to the vulnerable Tomcat server. Upon successful processing by the Tomcat application, the deserialization vulnerability was triggered, executing the embedded curl command.
  5. Proof of Concept: The local HTTP server immediately registered an incoming request, displaying the details of the curl command initiated from the compromised Tomcat server. This visual feedback served as definitive proof of successful remote code execution, demonstrating the end-to-end functionality of the Go serializer tool.

Peterson emphasized that the outcome would be identical if Ysoserial were used with the same vulnerable program, highlighting that Go serializer achieves the same exploit capability but with significantly reduced environmental friction. The demo successfully conveyed the tool's intuitive workflow and its effectiveness in weaponizing deserialization vulnerabilities.

Defensive Implications

▶ Watch: Q&A: .NET vs Java protocol implementation challenges (13:00)

While Jonathan Peterson's talk focuses on enabling attackers and researchers to more easily generate deserialization payloads, the implications for defenders are significant and multi-faceted. The increased ease, portability, and transparency of payload generation directly translate into a heightened threat landscape for organizations susceptible to deserialization vulnerabilities.

  1. Increased Attack Surface and Velocity: The primary defensive implication is that deserialization vulnerabilities become even more attractive and easier to exploit for attackers. By removing environmental hurdles and simplifying payload creation, tools like Go serializer lower the barrier to entry for weaponizing these flaws. Defenders must assume that attackers can generate sophisticated payloads quickly and efficiently, increasing the velocity of potential attacks.
  2. Prioritize Patching and Secure Development: Given the ease of exploitation, organizations must redouble their efforts in patching known deserialization vulnerabilities across their applications, particularly those exposed to untrusted input. Furthermore, secure development practices, emphasizing safe deserialization techniques (e.g., using allow-lists for classes, avoiding deserialization of untrusted data entirely, or employing secure serialization frameworks), become even more critical.
  3. Enhanced Monitoring and Detection: Defenders should focus on implementing robust monitoring solutions that can detect anomalous behavior indicative of deserialization attacks. This includes:
  • Runtime Application Self-Protection (RASP) solutions that can inspect deserialization attempts in real-time and block malicious payloads.
  • Endpoint Detection and Response (EDR) systems that monitor for unusual process creation (e.g., cmd.exe, powershell.exe, curl, wget) originating from application processes that typically do not launch such commands.
  • Network Intrusion Detection Systems (NIDS) that look for suspicious outbound connections (like the curl callback in the demo) from internal application servers.
  1. Understanding Deserialization Protocols: For advanced defenders and incident responders, a deeper understanding of .NET and Java serialization protocols, as detailed in Peterson's research, can be invaluable. This knowledge can aid in dissecting malicious payloads found in logs or network captures, understanding their intent, and developing more specific detection signatures. The transparency offered by the Go-based generation tool could, paradoxically, also assist defenders in understanding how these payloads are constructed.
  2. Supply Chain Security: Organizations should scrutinize third-party libraries and components for deserialization vulnerabilities. Since these flaws often reside in dependencies, ensuring that all components are up-to-date and securely configured is paramount. The ease of generating payloads means that even obscure deserialization bugs in rarely used libraries could become viable attack vectors.

In essence, the work presented by Jonathan Peterson serves as a stark reminder that deserialization remains a critical and evolving attack surface. Defenders must respond by hardening their applications, enhancing their detection capabilities, and fostering a deeper understanding of these complex vulnerabilities to stay ahead of increasingly sophisticated and readily available attacker tools.

Key Takeaways

  • The Go serializer tool and its underlying Go library significantly simplify the generation of .NET and Java deserialization payloads.
  • This approach eliminates the need for environment-specific tools like Ysoserial and Ysoserial.net, bypassing setup complexities and security approval delays.
  • Payload generation is now more transparent, reducing the security risks associated with opaque binary blobs and improving trust in exploit code.
  • Leveraging Go's robust cross-compilation capabilities, the tool offers unparalleled portability, allowing exploit developers to target virtually any platform (Windows, Linux, macOS, Raspberry Pi) from a single codebase.
  • The research demonstrates that complex serialization protocols can be accurately modeled and programmatically implemented using Go structs, enabling precise and flexible payload construction.
  • VulnCheck's Go exploit framework and the Go serializer CLI tool are open-source, encouraging community contributions and broader adoption in the security research community.

About the Speaker(s)

Jonathan Peterson is a distinguished member of the Initial Access Intelligence Team at VulnCheck. His professional journey began in penetration testing, where he honed his offensive security skills. Transitioning into vulnerability research and exploit development, he now specializes in discovering and weaponizing critical vulnerabilities. Peterson's work at VulnCheck focuses on analyzing emerging threats and developing robust exploit capabilities, often contributing to their open-source Go exploit framework. He is known by his handles "Lobster Jerusalems" for work-related content and "Dead Jax" for personal endeavors. His expertise lies in translating complex protocol specifications into practical, portable exploit tools, as demonstrated by his work on Go-based deserialization gadget generation.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

Peterson got sick of fighting Java version conflicts and Windows VMs just to generate deserialization payloads, so he rebuilt the ysoserial ecosystem natively in Go. It doesn't drop new gadget chains, but it fixes the operational nightmare of weaponizing the ones we already have. Every exploit dev writing cross-platform tooling is going to use this.

Heather Calloway (CISO) — SOLID

An offensive tooling talk demonstrating a Go-based payload generator for Java and .NET deserialization vulnerabilities. While geared strictly toward exploit developers, the strategic takeaway for leaders is that the time-to-weaponize for these specific legacy flaws is shrinking.

→ Top-rated talks at Wild West Hackin' Fest @ Mile High 2026

All talks from Wild West Hackin' Fest @ Mile High 2026