DEF CON SG1 - CSIT Village - Liu Wen Kai, Martin Koh - Your Next Forensic Analyst is AI Agents
Transcript
Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.
Hello everybody. What if I told you that your next forensic analyst might be a team of AI agents? Before that, let's get the introductions out of the way. I'm Meng Kai and this is Martin. We both of us are NSFs working at the Digital Intelligence Service. We have developed this tool as AI engineers at the Defense Cyber Command's Cyber Defense Test and Experimentation Center, or Cytec for short.
Through consulting and working with subject matter experts, along with observing the participants in the cyber exercises Cytec conducts, we found that digital forensics is a time-consuming and repetitive process. Just imagine how boring it is to scroll through a million lines in Excel trying to find four entries of useful information. Forensic analysts go through this exact same process, looking through millions of lines of logs just to find any piece of useful information. We believe and have found that AI has the potential to shorten the analysis process from days to just hours. Our ambition is to make the digital forensics process more efficient and scalable by creating an AI product that can conduct fully autonomous end-to-end digital forensics analysis with minimal human intervention.
Specifically, we are focusing on the identification and analysis portion of relevant artifacts, the two most manpower intensive and expertise intensive steps. Our work has shown that with the help of a structured workflow and specialized taskings, AI can pinpoint the search to relevant locations out of the thousands possible and correlate the found artifacts to reconstruct the attack narrative.
Our workflow consists of a multi-agent pipeline with each agent having specific tasks for conducting identification of artifacts and analyzing them. Cumulating in the generation of a final verified instant report.
The only human involvement in our pipeline is in initializing the investigation by providing an instant context that can be as minimal as just a rough time of when the incident could have happened. Afterwards, the AI agents take over identifying relevant artifacts by directly referencing the disk image sources that we provide and analyzing the artifacts internally.
This AI-powered analysis is done using a hierarchical multi-agent workflow which, in multiple use cases, literature has shown to be highly effective in breaking down complex problems, delegating specific roles to each agent for deeper analysis.
In our case, our delegation follows the MITRE ATTACK framework which describes the tactics, which are the broad steps an attacker needs to take to compromise the system and techniques, which are the ways the attack the attacker achieves these broader steps. Most of our agents are tied to one of these tactics or techniques which allows us to reconstruct the attack narrative from start to finish.
The way our agents reconstruct the narrative is by starting from the highest level orchestrated agent which is responsible for directing the investigation across a single host. This agent then autonomously decides, based on the provided context by the human analyst, which of the broad tactics to investigate first.
And pass the relevant tactic analyst agent to act as a sub-orchestrator agent to direct an investigation into this tactic specifically. Similarly, this agent then decides which of the potential techniques used to accomplish this tactic should be investigated. And pass the relevant technique expert agent to investigate. This process repeats itself with the expert agents tasking numerous summarizer agents and each tactic agent tasking numerous technique agent.
Throughout the process, the context given to each of these agents increases as we go down the stack. At the start, we only provide the single host analyst agent with a time frame to investigate within, which is provided by the human investigator. Then, the single host analyst specifies which tactic to investigate, in this case initial access, adding on to the provided context. And then the tactic analyst specifies which technique to investigate, in this case phishing. Lastly, the technique agent specifies exactly where to look for potential evidence pertaining to this, in this case looking through Outlook email logs.
In essence, as we move down the stack, the context given to the agents becomes increasingly specific, allowing us to target the search to the precise locations containing high-value evidence out of the thousands of possible locations that may exist.
This specific context is passed down to the summarizer agents, which uses tools to read and identify the most relevant artifacts directly from the disk image.
These agents perform a two-step smart summarization and search for relevant artifacts. The first summarizer agent, the bulk summarizer agent, performs bulk filtration by using filter conditions to narrow down the raw data. For example, filtering out all artifacts created after a certain date or only searching for files of a certain extension type. When the preliminary filtration is complete, the bulk summarizer agent has the tools to evaluate the filtered data like peeking at the first few rows or some of the column values. This allows the agent to decide whether filtration is complete and decide between either re-performing filtration or handing the data off to the second summarizer agent.
This second summarizer agent, the precise summarizer, then performs in-depth filtration looking at each individual row and reasoning through row by row to extract the relevant information. For example, here, the technique expert agent, the red um the one providing the context, has tasked the summarizer to only look at the partial module logs. And the precise summarizer then determines that only the second row that was returned from the filter is relevant. By using this two-step row-specific filtration method, our summarizer agents can efficiently increase the information relevancy and decrease the output that is sent back to the other agents, thus reducing the risk of context length overflow from large volumes of data being passed around to the agents.
Beyond the analysis of log-based artifacts, to provide more information and enhance the fidelity of our analysis, our workflow is also capable of analyzing other types of artifacts like file system artifacts and malicious executables. To do this, we introduce specialized agents outside of ones in the earlier stack with these specialist agents having specific tools to achieve their functionalities. The first specialist is the file analysis specialist. And his goal is to locate files on disk from a nebulous query. This process begins with a query from any agent on the summarization stack asking for analysis of a specific file that found. The specialist agent begins by utilizing methods to locate the requested file depending on if it is a file path, carved, or an MFT entry.
After the file is found its file type is then determined and depending on the type of file the agents can then autonomously decide whether to perform entropy analysis, extract its contents via a variety of methods, or perform malware analysis.
Malware analysis is done in the event that the file is a suspicious executable. And any malicious file is handed over to our second specialist agent, the malware analysis specialist. This agent utilizes numerous tools to perform both static and dynamic analysis of the malware using an external malware analysis suite. As such, these specialized tools and agents allow our orchestrator stack to be able to investigate all types of artifacts on a single host Windows disk image. However despite our best efforts to enable targeted search and summarization through the multi-agent workflow and the summarizer agents the risk of hallucination due to information overload still remains. Especially with the large amount of data due to the conversation between the agents.
This then resulted in knowledge fragmentation where each agent ended up with with understanding of the incident. And this significantly dropped the reliability of our pipeline.
To address this, we added a common database to act as a single source of truth between all agents. And to ensure that each of them have a common understanding of the incident. This knowledge database also allows them to return as much data as required.
Additionally, all the information uploaded to the knowledge database is tagged to the agent that gave the information. So, there's no confusion regarding the origin of any source of data. Another way that we combat hallucination is in the implementation of a judge agent. When the analysis is complete, all the information in the knowledge database is available to a report generator agent, which then produces a preliminary incident report. This preliminary report gets fed to a judge agent, which directly asks the lowest-level agents, the experts, to access and check the raw data and ensure that every point in this report is accurate. This bypasses all the middle layers of the stack, ensuring in less opportunities for hallucination.
At the end of judging, if any reports if any errors in the report or any pointers are determined as inaccurate, they are given as feedback to the to the agent stack, so that they can reinvestigate and correct these errors. This process repeats until a final trustworthy report is generated.
>> So, we'll now be moving on to a demonstration of the pipeline in action. For this demonstration, the screen the screen is split into three components. On the left, you'll see the whole tree of agents, which represents which agents are talking to each other and which agents have requested for which other agents to be part of the sub orchestration. On the right, you see a diagram of the relevant agents being used in every step of the investigation where the relevant agents are highlighted with colors. And the arrows on this diagram also correspond to different things. A down arrow corresponds to the higher level agent calling for the lower level agent to be part of the investigation.
And an up arrow represents the lower level agent sending the higher level agent information. And on the middle, this is where most of the demonstration will be happening where you get to see the thoughts, prompts, actions, tool calls, and other relevant aspects of the agents in action. Additionally, if the banner on the top left corner of the screen is white like here, then it's something about the run that's taking place. But if it's beige in color like this, then we are taking a step back to look at the prompts behind some of these agents. So, in this case, the investigation begins with the single host analyst agent.
And this agent has quite a few aspects to its prompt. The first is informing it of which of the tactic agents it has available under it to call for the investigation. So, here it has access to initial access, execution, persistence, and impact. Additionally, the prompt also consists of instructions for the single host analyst agent to correlate the information from one tactic analyst to better orchestrate the rest of its investigation. So, this correlation allows it to make sure that at every step of the investigation, it gets more information which is able which it is able to use to better direct the next steps of the investigation.
Furthermore, the single host agent prompt also specifies which tool the agent should use at different stages of the investigation like the final answer tool call to output a preliminary draft report. Additionally, it also specifies the time frame to investigate within and specific features to highlight in the investigation like the domain names, file paths, file names, etc.
With this prompt, the single host analyst agent kicks off the investigation by autonomously tasking the initial access tactic agent to look into possible entry points into the system. The initial access agent then takes over deciding, "Okay, I want to look for possible phishing emails that may or may not have been used in this investigation." And in this case, it calls the summarizer agents to look specifically at Outlook emails for any possible phishing emails that led to the compromise of the system.
After using the earlier tool step broad to narrow filtration method that one can mention earlier, we get this result where the summarizers find a possible phishing email that they send back up to the expert and tactic analyst agents who agree that this is indeed suspicious due to the typosquatted domain name which likely indicates that something malicious is going on. Then this is sent back up to the single host agent who agrees that it is malicious and decides to move on. So, with this information, the single host analyst agent then decides to call the execution tactic agent to look into
possible files or things that were executed from this phishing email.
At this juncture, I would also like to highlight the prompt behind these individual analyst agents. So, in this case, for the analyst agents, we'll be using the execution one as a specific example to highlight the prompts. Besides the information regarding the investigative actions it can take like searching for artifacts, aggregating evidence, identifying suspicious behaviors, we also include the available technique experts, much like the single host analyst agent in terms of the tactic analyst, but here we are indicating the
expert agents that are one level below the analyst agents that are available for the sub-investigation. The prompt also includes other things like the things to output, the names of the executable or specifying the name of the executable, the number of executions, and also the steps to follow for the investigation. But for this prompt, it differs quite significantly from the single host analyst agents one in terms of the fact that this prompt also contains information that is unique to every run. So, this aspect of the prompt comes directly from the single host analyst agent specifying the files to investigate for this specific investigation. So, this uniqueness of prompt that is different in every single run allows us to tailor the investigation to the specific case at hand, making it more detailed and allowing us to better correlate the attack narrative.
With this prompt, the execution analyst agent sub-orchestrates its own investigation, asking the different technique experts to investigate different things like SRUM, ShimCache, etc. Eventually returning evidence of suspicious behavior across a few files.
This process repeats across other areas like persistence and impact, finding relevant information that we'll be skipping over since it's quite a repetitive process. But all of this eventually results in
the possibility of going to the specialist agents as well if they're necessary. In this case, the single host analyst agent has determined that the malware analysis specialist is necessary in this case. And after the specialist uh uses the tool called to output its evaluation of the suspected malicious file, the investigation is concluded and the single host analyst agent believes that it has found almost all of the relevant information that can be found for this specific case. And here, a preliminary report is generated, version one, by the single host analyst agent who has handed it off to the judge agent for a verification of the information in this report.
So, now we'll be taking a step back to look at the prompt that goes into the judge agent for this self-verification to ensure the validity of the report.
So, much like every other prompt, we also inform the judge agent of which of the direct low-level expert agents it has access to to call for the specific verification of pointers in the report.
Additionally, we also specified the judging criteria that the judge agent should use when looking at the different pointers in the report. So, in this case, we have asked the judge agent to reject any information with insufficient evidence to make sure that the points in the report are as accurate as possible. And the prompt also specifies to include any further analysis that could be taken to further verify any of the points in the report that already have some verification behind them, but could have even more to ensure the validity of these points. Additionally, the prompt also comprises of the report from the single host analyst agent for the judge agent to view.
So, this prompt results in this kind of feedback being given to the entire stack of agents for reinvestigation of certain fixed points. And when these uh points are given to the stack, they proceed with re-verification and have a back and forth between the stack and the judge agent, the stack and the judge agent, until the judge agent is satisfied and a final verified report is produced.
For this specific single host, it took slightly less than 3 hours to generate this report from just a single prompt from the human analyst. Additionally, we would also like to make some clarifications on the workflow at this juncture. For one, no models are being trained. This is purely inference time work and comes in the form of the prompts that we have shown earlier. Uh secondly, we are using Kimik2 as the model for every single one of the agents in the stack. And lastly, that we have tested this workflow both on and off premise. And the workflow gives similar results in both cases. We've tested our workflow on numerous cases from the compromised host of the critical infrastructure and defense exercise, which is a national national-level cyber defense exercise that the cyber defense test and experimentation center plays a significant role in organizing.
If we look at one of these specific reports from one of the single host within the exercise network, we see that one of the notable pros of the report is how highly comprehensive it is. And it's extremely technical, with the report going into the timeline of how different steps of the attacks were carried out, which files are responsible, and the evidence behind these claims. However, given how technical this report is, one of the major drawbacks that we feel this pipeline has is that there is very little incident context in this report. So, beyond the executive summary all the way at the top of the report, there is really minimal other context provided. And the report focuses on the proof and low-level evidence behind the claims, which makes it very difficult for someone non-technical or not closely involved in the digital forensics workflow to understand what happened.
Meaning that this report would have to be interpreted by someone highly skilled in digital forensics and to take the relevant information out and frame it with more incident context to present to other people. However, this presenting and taking out the relevant information shouldn't be too difficult for someone technically skilled since the report breaks down the attack chain into the different steps of the MITRE attack framework, which we will go deeper into in the next few slides. For this specific report, the findings begin from the initial access, which was a phishing email from a typosquatted domain carrying a malicious attachment, whereby the AI agents were able to find and autonomously determine that a successful spear phishing attempt was the entry point into the system.
And these agents also managed to find the sender, the malicious attachment, and also identified that this was a form of social engineering. The agents were also able to correctly identify that the execution came about from a dropper called update.cpl, and this dropper was used to introduce a C2 executable, followed by the persistence mechanism being this C2 executable running hourly.
And the impact was over 6,000 files being renamed with a {dot} ransom extension. Additionally, in some different cases, uh not in the previous report shown, the Tango host analyst agent also gave an autonomous tasking to the malware analysis specialist agent to analyze a dropped malware payload uh payload. The agent uses A-cube, a tool to analyze the malware to complete the analysis.
To measure the reliability of the report generated on one specific case, we used a confusion matrix and opted to use the F1 score, which is the harmonic mean between the precision and recall, with the precision representing how many of the malicious uh predicted malicious files are actually malicious, and recall representing how many of the actually malicious files are correctly identified. This data is obtained from 20 runs of each individual agent except for the single host analyst agent where 10 runs of the full incident report were used to obtain the F1 score. If we look at the individual agents and their F1 scores, we see that generally across the board the F1 scores are pretty good at above 90% indicating good reliability of the framework.
However, if we look at specifically at the execution tactic analyst agent, we see that the F1 score dropped significantly to around 65%. And we attribute this to this specific case having a lack of available forensic evidence where even a human analyst would struggle to make accurate deductions. However, interestingly enough, if we look at the single host analyst agent, the F1 score is 75% and
this is quite surprising given the fact that in this specific case most of the evidence and deductions came from the execution analyst agent. So, even though we have introduced another agent for another layer of hallucination, the F1 score increased from around 65 to 75%. And we attribute this increase to be due to the judge agent which read through the different pointers in the report and verified the information making sure that information with insufficient evidence was omitted or re-verified in the report. In our work, we also aim to leverage the best LLM model for optimal results. To do this, we tested five models on a set of five questions from from the Cyber Defenders Corporate Secrets Lab which was a forensic exercise on a Windows disk image and we found that out of the available models at the time of testing which was Q3 last year, we found that Kimik 2 and GPT-4 all performed the best.
But since they had a tight score, we further tested these two models on a broader set of questions and opted for Kimi K2 as it performed better.
Despite the work we have done, we believe that our solution is still incomplete and aim to incorporate multi-host functionalities for an enterprise-wide investigation instead of our current single-host functionalities. And also aim to include the capability of including network images and memory captures. So, we've come to the end of roughly 30 minutes of content. But, the key takeaways are that we found that using the hierarchical multi-agent stack comes with numerous benefits. The first being to it being able to increase the context specificity as we go down the stack, which means that just from a broad incident context from the human analyst, the agents are able to go all the way down to identify which of the locations and which of the artifacts are the ones that it should be investigating.
And this allows for an automatic targeted search and summarization, choosing the specific locations out of the over thousands that may exist. And the second benefit is that the agents are able to use specific tools and have specific prompts. So, that each agent is tied to one specific idea to investigate, which makes the investigation more accurate. Furthermore, we have taken two main steps to minimize the hallucination. The first is using a knowledge database to act as a single source of truth, preventing information overload between the agents and minimizing the effect of knowledge fragmentation within agents. The second is using an agent as a judge framework for a self-verification loop between the stack and the judge agent.
And this judge agent goes directly to the lowest-level agents for its self-verification to minimize the hallucination in the tracking phase that might occur by going through the entire stack and passing the information through many different hands.
And all of this has led to us being able to demonstrate that Atlantic digital forensic teams are capable of generating technical incident reports across different forensic scenarios. Obtaining good reliability of an overall F1 score of 71 75% demonstrating the reliability behind these teams and the potential of these teams being used in tandem or autonomously to conduct rapid digital forensics investigation. With that, we've come to the end of our presentation and I'd like to thank all of you for your attention.





