DEF CON SG1 - Theodore Lee - Ashes To Analysis: Deconstructing Malware With Aether
Transcript
Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.
So, next up, ladies and gentlemen, let's talk about something every um malware analyst knows. Malware reverse engineering is slow, painful, but necessary. But does it necessarily have to be slow and painful? So, in this session, we're going to have Theodor Lee explore how AI agents and large language
models are transforming the RE process. So turning hours of deep manual work into something faster uh smarter and more scalable. So if you have ever stared at obsculated code internally willed in despair and wish for a shortcut uh this might be it. So let's welcome Theodor. Let's give him a big round of applause.
So So hi everyone. And I'm Theodore, the ex product lead of and I'll be telling you more about this new product that CST has made. So a bit about myself first. Uh you can find me on LinkedIn, GitHub and fun fact, I got into computing by installing a root kit all the way back in 2015. So that's fun. And since then
I've been privileged to do stuff like CIS admin, gamedev, and other things. Yeah, you can see some of the stuff I've been making of late, computer use agents, pool and the like. But enough about me. Let's hear about the product. ATA is essentially an AI copilot to help you reverse reverse malware easily. It aims to balance between three aspect of automation, human verifiability and on premises. So in essence, you can see a sneak peek of what does here. In essence, when you run, you will get the functions renamed to their logical what they actually do. You'll get comments telling you what a function does and the variables are also logically renamed. Here we have a advanced sample from USC3 AA6 and here is the Google track intelligence report.
You can see that at has successfully reversed the C23 in just 17 seconds using a local LM nonetheless but first well uh why would we build a right so just imagine that you receive a malware sample and you pass it to an agent to analyze. We use a frontier model like maybe cloud sonnets and a good agentic harness like cloud code, cyro code or whatever your favorite is. Everyone has their own. Then the agent gets to work and we go get some coffee.
When we come back, our analysis environment has been nuked because someone else was prompting the agent. Hackers are not stupid. They know that we're using AI to add reverse and they have embedded a gift for the AI a prom injection which essentially deletes the entire environment rf we all know this and this may seem hypothetical surely with how far LM has come this isn't a problem but actually one of our fellow colleagues has demonstrated a code execution via form injection in copilot chat just last year and it will result in arbitrary code execution and this actually almost happened when I was trying to automate these slides using clots sonnet as cloud sonnet kept tripping it a safety filter getting over itself and eventually I made the slides myself because this was too much trouble so we try again we pass the sample to the AI again and give better prompts better handling better safety filters oh and the report comes out very good so we look at it right and then we build our whole defense based on this report snot rules yara rules everything.
And two weeks later, we're having another cup of coffee where we get a suspiciously familiar sample again. It's not the same hash, but the TTP is essentially the same. Uh, well, it goes without saying that the analysis was wrong. But why? The C23 might have been completely hallucinated because the agent didn't get the functions it needs. This does have consequences because now these rules, these Yara rules, these not rules which we built our defense on are completely wrong and they have been propagated to partners which is oh dear.
And while this is not some fantasy scenario or some sea monster you're fighting in your head, right? This is real. Co famously ended their bug bounty program because there were too many AI slot reports. Furthermore, there is a very differing incentive between a buck bounty and your daily MA work. In a buck bounty, you might just make the AI slot report, look at it one time, and submit it because the burden isn't on you. It's on the developer of the project to check that the report actually makes sense, right? Whereas when you an analyst in the government are signing off on a sample to say that I analyze this sample well that defense might be used across the estate to do proper defense with Yara and snot. So if your analysis is wrong, the complications are really noticeable.
And furthermore, um well, I'm sure all of you has used AI agents, right? Surely you have had the frustrating thing where it loses coherence on a long task or it famously compacts and forgets what it was doing or it claims it did something, but when you look at it, it did something else. The general term for this will be AI misalignment. Uh here's a really good article on it which goes into in depth but essentially it will be things like reviewer sub agents appraising the report to be better than it was or asking for a review that is much less serious because you're essentially asking the agent to check itself own self check own self right so as someone who has way too many tokens in g copilot this has happened way too often so yes this collusion with sub
agents and task avoidance and long horizon lack of coherence are really big problems with asking an AI to analyze malware that is potentially complex and offcated. Furthermore, malware analysis is not software engineering. With software engineering, we can make unit tests and other ways to formally check the compliance of our code. With malware analysis, it's really about how sure am I that analysis correct. So, there's a lot of complaints about AI, even though it does really help us, right? But what do analysts actually want? When you speak to our analysts, they want this trifecta of human verifiability, automation, and readiness to deploy on premises. And yes, that's why we made it. So yes, it surgically automates tedious parts of the MA process while keeping it easy for you, the analyst to understand the difficult parts.
Essentially, we want to automate and speed up the process, right? while maintaining a human verifiability and oversight and integrating strongly into a software like ID Pro so that you can have a side-by-side view of the software that is being analyzed and the AI agents thoughts on it and you can oversee the whole process too and furthermore we have operational requirements that require they operate on premises so like it has to work with air gap environments and local LMS which are not as strong as cloud LMS from day one that is an additional design constraint. But first, what exactly do analysts find complex? Well, it's what we call the context problem. Essentially, when you have a malware, the function names are all stripped unless the attacker is dumb.
And the analyst has to go through all these functions, click down, click down, and click down, see what it does, and then click all the way back up. That takes a lot of time, and it's very boring. And I will call it more tedious than difficult because when you analyze it, it's not very rewarding, right? You just see, oh, I found out what this function does. I found out what the function above it does. [snorts] It's rinse and repeat. So the analyst time will be better spent on like offuscated or packing stuff. And well, it's hard for the AI too. When we get ID Pro MCP which was actually the red genesis for to do the analysis we can see that it will not get the pseudo code of functions of important functions because LM laziness and so when it doesn't get the pseudo code and it has to make an inference it will go like yes I think this is a secondary module which
it doesn't tell us anything
and so since it's hard for AI agents too it wastes tokens trying to decide what functions to get and there are more chances for mistakes. So what if we forcefed the context the most likely context using certain huristics like function length and function name and yes that's v1. So essentially at v1 was very simple it just used two calls and heristics to get the most likely functions and then pass them to the AI agent in one step instead of five while eliminating common functions like print f. So that was essentially a v1. We can see here that v1 alone has a significant improvement over raw agent because we are passing the whole context in and the agent doesn't have to waste its time and tokens asking for context that will obviously be needed.
Without context you get stuff like oh it's likely a payload or secondary module and the LM simply does not have the information it needs to make inferences. Whereas with the context we get the comments that make sense right out of the box. So okay, how does it help you the analyst? I spent a lot of time talking about the preamble. How does it help? Before you run a your mware looks like this, you got all your v1, v2, v6, v7,
and you got all your unnamed functions which don't really make sense. After you run a will automatically rename the functions, rename the variables and put comments there to guide you in the analysis. And since it's right in the IDA pseudo code view, you can just click in to verify that it's correct or it's wrong. So this analysis sub agent as it later became essentially works like this. You as the user, you right click an AT and trigger the analysis and it will collect the pseudo code by the function. It will call the sub functions called by the function and then it will pass it to LM and use heristics like function length and function name to decide what is important and what can be eliminated.
Then this goes to the annotator in one single LM call instead of five or 10. And the LM call renames variables, functions, and adds commands. And so this is actually the flagship feature. It's accessible in IDA Pro by clicking on the top toolbar or by right clicking in pseudo code view and selecting a and selecting the annotate this function. Uh once it's done, it just takes 17 seconds, less than a minute most of the time. and the AI rename variables and zero code appear in the view and another important feature of developed by one of my colleagues is automated str creation. So essentially when we have the malware all the strone right so we want to recover the strs to assist in our understanding. This was the initial results of the str creator which
we did a bit more research and we got something usable. So first we run the annotator to inform on what the functions do and then we select and then
we select the generate struck from generate str from variable and then we get an AI infert in this case a trampoline for doing yes and when you apply the str becomes much more readable and well this is 2026 so we can't get by without an agentic mode so So we build an agentic mode. This is a supervised and guardrail agentic mode where we very carefully decide what tool calls to allow the agent to use and give it memory scratch pad all the fittings of a usual agent but with our signature guard rails to prevent it from doing nonsensical analysis or for example escalating to rce.
So you just need to write uh the agent has the context of the current function and you can just tell it what to do. It's a bit like G co-pilot or other AI agents in the sense that it has the context of what you're currently looking at. So you don't have to select it and once it does the analysis it usually takes a few seconds also and you get whatever you ask for in the chatbot view
and hallucinations that's a big part of our worries when using LMS right so we do a specific thing called function based grounding and citations so essentially we force the LM to back any assertions it makes using actual source code from the functions before it makes that assertion Since LMS generate text auto reggressively, they go for token by token. We can ask the LM to generate the source code that it will site first followed by the inference or assertion it wants to make. This means that the LM will use those tokens it created before to actually inform its analysis. Because a common symptom of AI hallucination is that when we have the assertion and we ask the LM to justify, it's not actually going to go back to the code. it'll look at the assertion and make some make some madeup
information on why it thought that way which is what we like to call retros retroactive justification. So you can see here that all the function names that the LM read are actually cited here to reduce hallucinations and improve accuracy. That's a lot of features and a lot of talk a lot of technical architecture. How does it actually perform? So we have a need to have a established methodology where we test against different models such as Gemma, Devstro and quentry coder across model sizes and intelligence levels. Then we run it several times because a success the first time might not mean a success the second time since LMS are slightly random.
We verify this against public CTI and our own CTI and then we compare the models against each other. And then we create learning points and areas for improvement because we know our product's not perfect. So essentially this is the LM versus LM comparison. Our test suite is sort of like this. We have a known ground truth
and when the LM renames variables or comments to the expected values, we mark it as a pass. When it renames them to something generic and useless like fail like data bite or data pointer, that's not helpful at all. So we mark it as a fail. So this is a standardized pass fail test suite for all LMS and it's about did it rename it correctly. Then we validate each LM in different size class such as 35B or 120B if you are rich and have many GPUs across different intelligence levels. And so after we did our evaluation we found that Gemma 4 Quinn and Gemini perform favorably with and those are the models we recommend.
Furthermore, iter uses the standard OpenAI compatible format. So you can actually quite easily swap in other models using stuff like open router.
So this is the sample from earlier which is I red from UNC 386. We can see that has correctly renamed the functions in the C2 command tree.
And here is a more fascinating sample from the Whitefly AP all the way back in 2018. So after we do a manual IAT patching, ATA is able to take over quite a renaming all the variables and functions to the expected values. It can also recover the strcts used for stuff like explore exe hooking and C2 command tree.
And what is even more fascinating is that to do as part of our benchmarking we ran ather with quentry coder against GPT4 uh GPT5 which was at the time state-of-the-art frontier model. What surprised us the most was that with our bespoke harness and the correct agentic scaffolding we are actually able to get quentry coder which is empirically a much worse performing model to perform better than GPT5 due to our specialized harness. This shows that the LM harness you use is very important and is a testament to well it actually works. But of course there are limitations. We have to concede that in some aspects we are weaker than cloud opers and cloud code simply because those are the frontier models at this time. And furthermore it has different priorities where we using on premises infrastructure. We don't want to just throw more tokens at the problem because of our limited compute. And furthermore, we are also prioritizing human verifiability within IDA over pure autonomy.
And so being bound by our design principles, we have different design goals which lead to differing performance in various scenarios. One way to think about it is of as a force multiplier where basically it's a specialized harness to do agentic re using specialized agents. So it works well with constrained hardware such as what you might have in your air gap networks such as maybe just one or two RTX 3090. So in a sense helps local LMS work above their weight class despite being local and small maybe just on the order of 30 BS or 120BS and it outperforms ID pro MCP. So yes essentially that's all that's all
from it. Tomorrow there will be a talk by enit on the str creator diving into the technical details. You can check it out. You can visit our booth over there to test it out live and check out our g repository and give us a star. Uh you can also find me on LinkedIn and let's connect there. Thank you very much. Thank you, Theodore, for showing us how AI is reshaping the way we fight malware.





