Reverse Engineering Go-Based Malware with AI
This talk demonstrates techniques for reverse engineering Go-based malware, which often presents challenges due to its static linking, large binary size, and lack of standard string delimiters. The speakers analyze several Go-based malware samples, including GoBruteForcer, GoRat, and the ICS-centric FrostyGoop, to identify their functionality and network indicators. They introduce a hybrid toolkit approach, combining traditional reverse engineering tools like Radare2 and Ghidra with AI-assisted plugins like r2ai and GhidraMCP to automate analysis and improve efficiency. The presentation concludes with a practical demonstration of using these tools to decompile and analyze a custom-packed Go binary from a CTF challenge.
Reverse Engineering Go Malware: Why Your Static Analysis Pipeline is Failing
TLDR: Go-based malware is increasingly common, but its static linking and lack of standard string delimiters make traditional reverse engineering tools struggle. By building a hybrid toolkit that combines disassemblers like Radare2 with AI-assisted plugins like r2ai and GhidraMCP, researchers can automate the identification of malicious logic and network indicators. This approach significantly reduces the time required to decompile and analyze complex, custom-packed binaries.
Go has become the language of choice for modern malware authors. Its ability to produce self-contained, statically linked binaries that run across diverse operating systems makes it a nightmare for traditional static analysis. When you drop a Go binary into a disassembler, you aren't just looking at a few functions; you are looking at a massive, statically linked runtime that obscures the actual malicious code. If your current workflow relies on grepping for strings or simple function signature matching, you are missing the vast majority of the threat.
The Go Binary Problem
The primary challenge with Go binaries is their structure. Unlike C or C++ programs, which often rely on dynamic linking to standard libraries, Go binaries include all necessary runtime components within the executable. This results in massive file sizes that can easily evade security scanners with strict file-size limits. Furthermore, Go strings are not null-terminated. They are stored as a structure containing the length of the string and a pointer to the underlying bytes. Standard string-scanning tools, which look for a null terminator to identify the end of a string, often fail to parse these correctly, leading to a jumbled mess of data in your analysis output.
When you analyze a sample like the FrostyGoop malware, which targets ICS environments, you are dealing with a binary that has been specifically engineered to disrupt critical infrastructure. The complexity of these binaries means that manual analysis is often prohibitively slow. You need a way to cut through the noise of the Go runtime to find the actual command-and-control (C2) logic and the specific OWASP A03:2021-Injection vulnerabilities, such as command injection, that these samples often exploit.
Building a Hybrid Analysis Toolkit
Efficiency in a red team engagement or a bug bounty hunt comes down to how quickly you can pivot from "I have a binary" to "I know what this binary does." The most effective approach today is a hybrid toolkit. You should not rely solely on AI to do the work for you, as it will hallucinate and miss critical details. Instead, use AI to handle the tedious, repetitive tasks while you focus on the high-level logic.
Tools like GoReSym are essential for this. They can parse the Go metadata, including function names and package paths, which are often left in the binary even when symbols are stripped. Once you have the metadata, you can use r2ai to query the binary. Instead of manually tracing every function call, you can ask the model to explain the purpose of a specific function or to identify the C2 endpoints.
For example, when analyzing a binary for CVE-2018-10561 or CVE-2018-10562, you can use the following command in your analysis environment to quickly identify the relevant network indicators:
# Using r2ai to query function purpose
r2ai -e model=gemini-2.5-pro
r2ai > "Explain the purpose of the function at 0x00491aa0"
This command allows you to leverage the reasoning capabilities of large language models to interpret the assembly, which is far more efficient than manually reversing thousands of lines of Go runtime code.
Real-World Application and Evasion
During a recent engagement, we encountered a custom-packed binary that used a "LOLI" signature to indicate its packing routine. The binary was designed to perform large-scale SSH brute-force attacks, a common technique for T1059: Command and Scripting Interpreter. The binary used a custom decompression algorithm that standard tools could not handle. By using the hybrid approach, we were able to identify the decompression routine and use the debugger to dump the unpacked binary from memory.
The impact of these Go-based threats is significant. Because they are so portable, they are frequently used to target IoT devices and routers, which often have limited security monitoring. If you are testing these devices, you need to be prepared to handle Go binaries. The goal is not to let the AI replace your expertise, but to use it as a force multiplier. When you are staring at a massive, stripped Go binary, the AI can act as a "clippy" for your reverse engineering process, suggesting commands and helping you navigate the complex function trees that Go creates.
Defensive Considerations
Defenders should focus on behavioral analysis rather than relying on static signatures. Because Go binaries can be easily recompiled with different packing routines or obfuscation, static file hashes are largely useless. Instead, monitor for the specific network patterns associated with these tools, such as the HTTP POST requests used for command injection or the specific SSH brute-force signatures. Implementing robust egress filtering on your IoT network segments is one of the most effective ways to mitigate the impact of these threats.
Stop treating Go binaries as black boxes. The tools to deconstruct them exist, and the combination of traditional reverse engineering and AI-assisted analysis is currently the most effective way to stay ahead of the curve. If you find yourself stuck on a binary, don't just walk away. Map the sections, identify the Go build ID, and start asking the right questions. The answers are in the binary, you just need the right toolkit to extract them.
Vulnerability Classes
Target Technologies
Attack Techniques
OWASP Categories
Up Next From This Conference

Reverse Engineering Go-Based Malware with AI

No Brain, No Gain: The Next Frontier in IoT/ICS Authentication

Never Enough About Cameras - The Firmware Encryption Keys Hidden Under the Rug
Similar Talks

Kill List: Hacking an Assassination Site on the Dark Web

Hacking Apple's USB-C Port Controller

