Hello, hello everyone. This is Erdener. I'm here with my colleague Gökberk. Hi. Thanks for joining our session. We are very excited to be part of the Red Team Village this year. The title of our session is Executing Red Team Scenarios with Built-in Scenario Plays. First of all, let's start with introducing ourselves a little bit. Hi everyone. I am Gökberk. I am a Penetration Tester and Red Team Operator. I have worked across a variety of industries, including financial service and government service. Currently, I am working as an Offensive Security Engineer at an industry-leading bank. I plan and conduct full-scope Red Team engagements that simulate realistic and targeted attacks. Also, I am responsible for performing host infrastructure penetration testing, web and mobile application testing, social engineering engagements, source code reviews, and wireless penetration tests. In the past, I have given several presentations on malware analysis, Red Team operations, exploit development, and IoT security. Thank you Gökberk. And my name is Erdener. I have about 10 years of experience in IT and information security. During this time, I had a chance to work at research institutes, a Fortune 100 company, and a bug bounty company. I took roles in development teams in security operations and application security teams that are focused on security tool development, penetration testing, and vulnerability assessments. Currently, I am working as an Application Security Engineer. Today, we are going to talk about our tool called Red Team Built-in Scenario Place, also called Manticore platform. We are going to demonstrate how to execute some adversary emulation scenarios like ransomware attack with this tool. We'll start the discussion with a brief introduction to what MITRE ATT&CK framework is, then we'll discuss the challenges concerning adversary emulation and its relation tools to show a little bit about why we needed to build, why we wanted to build such a tool, and later we'll talk about the features of this open source scenario place. Through the end, we'll demo the tool, and we are going to show the user interface, some scenario cards on it, and we'll execute some sample scenarios like APT29, LOL beans, and a simplified ransomware scenario using the command line client. Finally, we'll finish with the feature work. All right, let's start. So, as we all know, Red Team activities are one of the fastest developing solutions against today's cyber attacks. And recently, the number of tools that propose to help Red Teams is increasing quite rapidly. And following this trend, we have also created an adversarial emulation tool for Red Teams. This is an open source tool, and its aim is to aid a Red Team to execute several types of attack scenarios. It also gives more visibility to the Blue Teams to see what's being executed on their endpoints, or what malicious traffic is going through their network during a Red Team exercise. So the initial version of this tool was presented at the previous Red Team Village event back in May. And since then, it has been improved with scenarios, and it has been published on GitHub. Basically, we have categories of scenarios as network-based, endpoint-based, and APT group-based. And there is also a section for Blue Team techniques, showing some hardening controls related to executed scenarios. You can find the GitHub repository link on the slide here. All the scenarios inside the repo that we are releasing are mapped to the MyTrace attack framework. And the techniques and the tactics can be found in this framework. I will talk about the framework in a minute. You will see the reference numbers, the attack IDs of the scenarios, of the techniques, inside the configuration files for each scenario if you go to the GitHub repository. But we will go into detail about this. So, what is MyTrace attack framework? For those of you who see this for the first time, let me briefly explain it. When you visit this website, attack.mytr.org, you see a matrix of items called attack matrix of enterprise. The columns of this matrix are tactics. And tactics are mainly the objective of the attack attempt. The goal that an attacker tries to achieve. So you can see 12 columns here. Each of them represents an attack goal. And under each attack goal, there are techniques. And each of these techniques has an attack ID with it. So in total there are 12 tactics listed in MyTrace. And these tactics have around 250 different techniques. This framework is a great knowledge base classifying these adversary tactics and techniques that are used to attack targets in real life. Of course, this framework is not only beneficial for red teamers, but also organizations are also benefiting from it to learn about the attack methods. And the framework is open to any person and organization for use at no charge. And just like how OWASP's top 10 framework is being embedded in most application security tools, a great resource like this one is becoming a fundamental reference of red teams and adversarial emulation tools. So our open source tool is no exception for this. And as I said, there are 12 tactics almost chronologically starting with the initial access and going to the impact goal of an attack. So in the initial access part, the attacker is trying to penetrate the targets. And then comes the execution, when the attacker is simply trying to run a malicious code. And the list goes on actually, I'm not going to details a lot. Just to see some examples for techniques, let's take the execution tactic. So for the execution tactic, there are 10 techniques listed underneath it. Some of these have some subcategories as well. The techniques listed here are about the methods that an attacker can use to run code, basically execute a code on a local or remote system to reach their main objective. This execution tactic is also often interconnected with other tactics. For example, as a red teamer, your execution technique of using command and scripting interpreter could be running a PowerShell script to perform a file download from a remote server that will be used for the discovery goal. So it would be related to the discovery goal in that sense. You can check out the market's website for more details, and we have seen that there are many great talks in the program about this framework, and we suggest that you check them for getting more insights about it. We just tried to mention the technique and tactic idea here, how we mapped it in our tool. Next, the offensive teams have some common exercises like vulnerability assessments, penetration testing, and adversary emulation. Skipping the first two, the last one, adversary emulation is what we focus actually right now, and it's an activity where red teamers, as the name refers, try to emulate or imitate how an adversary performs during a real-life attack. The platform we'll demo here is focused on adversary emulation, as I've said, performed inside the network of an organization. So in a way, you can think that initial access tactic has been achieved, and we are moving on to the other tactics. Therefore, we can say that this tool will be most useful for internal red teams or purple teams. Now let's discuss some issues faced with adversary emulation, and what we want to see with this tool. So, it's not going to be an answer to all these problems, the tool is not going to be an answer to all these problems, but we think it's a step to solve some of them at least. First of all, emulating adversarial behavior is costly, because their techniques are complex and requires time. And it's not common to see the tools created or used by malicious actors in the wild. That's why adversary emulation is an expensive exercise. Next thing is the scenario transparency. We have seen that adversarial emulation tools do not provide transparency in their scenarios. That's what we wanted to avoid by this tool. In our experience, we saw that there is a need for collaboration between red and blue teams, especially for internal security teams of big organizations. Blue teams cannot easily see the adversarial emulation behavior due to black box nature of the red team's attacks. This causes a problem in terms of improving their incident response capabilities efficiently. Another problem is tool availability. While emulating adversaries, tool availability is another issue. Red teams cannot easily find the tools used by the malicious actors, just like we mentioned in the cost challenge. Therefore, bringing all publicly available scenarios together, we think it will be the best option for red teams. Repeatability is another issue in adversary emulation. Why? Because sometimes during the red team engagement, a test may fail. But the device configuration may be changed at a later point by someone or by some service account. So, the same test may pass on another try. Therefore, it would be great to have some parts of adversary emulation engagements automated, continuous, and repeatable. It's nice to have a system where the security teams are able to schedule these tests to run at frequent intervals. Another issue is that adversary emulation exercises has some malicious softwares used by the red teams. So, these malicious software can cause unexpected situations on corporate devices and networks. It's also a great idea to have visibility on which software will be used during the engagement. What's more, there are also some challenges with regards to other tools used by the red teams. Like for the on-premise installation of simulation tools, updated attacks cannot easily be imported into the infrastructure, into the platforms. With this tool, the security engineer has the chance to point to a URI, to a repo, where everything is up to date. Investigating different commercial or open-source tools, we could get the general idea of how many scenarios are available for a security team. So, we saw that there are about 2000 scenarios in the wild, and all of them cannot be reached from a single place. Most of the tools used for emulation also do not take advantage of the open-source technology. Having a place of scenarios enriched by the red team community would be valuable to everyone. Reporting, on the other hand, is also another issue for the simulation tools. These tools do not provide enough information for understanding the attack surface and attack vectors. And finally, simulation tools are too complex for creating and updating scenarios. They don't have a general structure, like a standard model for scenarios. We tried to standardize this by a scenario model in the JSON format, that you can see in the slide. So, we have the ID specific to the scenario, with the initials of the tactic used there, and the tactic names, the description and name of the scenario, and the mapping to the MITRE ATT&CK framework. We also have the type of the scenario, like is it an endpoint scenario, is it a network or an APT. And also describing the platform, the operating system that it targets. So, overall, the MantCore platform, as we call it, this built-in scenario place, has the following features. First of all, the tool and the methodology we use in emulating adversarial attacks with this tool is open source. And therefore, this is very cost effective compared to commercial tools. We prepared a scenario environment that makes it faster and less complicated for red teamers. They can easily apply the tests from different open sources, like Atomic Red Team or Red Canary. It gives red teamers the access to the scenarios according to specific attack types, as divided in MITRE categories. And what's more important, the blue teamers will be able to see these attacks within a transparent process. The config files clearly show the sources of threat scenarios and the payloads used within it. Of course, organizations may still prefer to perform the blind engagement, blind red team engagement, depending on their security maturity. But we think a visible engagement plan can be much more helpful for most of the organizations. And so, blue teams, we talked about blue team detection and prevention to distribution of scenarios. While checking the scenarios, we saw that commercial and open source tools mostly have bias towards Windows environments. And the number of scenarios is distributed like 60% for Windows and 20% for macOS and 20% for Linux environments. With the community's support, it's possible to increase scenarios on the Mac and Linux side as well. And therefore, balancing this distribution would be a good product at the end. With this platform, APT scenarios can also be recreated and visible to both red teams and blue teams. Since everyone can contribute, red teams will have the chance to add advanced attack scenarios in their toolbox. And build a community to protect and improve defense against attack and breach scenarios. Now I will stop sharing the screen and Jörg Berg is going to tell you how we structured this tool, showing the GitHub repository. And finally, the more exciting part, we will show the demo of the tool and finally talk about our featured work. Hello again. Now we will continue with the presentation. Now we will look at the public threat repository. For this presentation, we released some complex scenarios on our GitHub account. We are mapping these scenarios to the Maitre. So far, we published three complex scenarios named as APT29, LOL beans and ransomware. In the next, this public repository includes publicly known scenarios. You can see this on our GitHub repository. Later we will go deeply into it. In the next slides, we will look at public threat scenarios, public scenario repository. We released threat scenarios on our GitHub account. All scenarios are again prepared with regards to Maitre. From these scenarios, complex scenario groups are generated. For example, if you look at ransomware emulation. Ransomware emulation includes two scenarios included in public scenario repository. It has two JSON files with their IDs. These include attack type, attack payloads and platform information. I will show you later that. For ransomware emulation, in this section, we will look at ransomware emulation scenarios for generating public scenarios. We have two different implementations for ransomware emulation. One of them is written by Go. The other one is PowerShell based. This released implementation is not covering all steps of real ransomware attack, but this is on purpose. Because we wanted to release a simplified implementation of this scenario. There is no CC or server communication or encrypting all files. We are encrypting a file that we create on the fly and decrypt it in this file. Adding the few missing points, these implementations can be converted to full ransomware emulation. Yet, our aim is to test if a defense mechanism could prevent the core function of ransomware, which is encrypting files. In this section, we will speak about Manticore Adversary Emulation CLI tool. This tool is working with public threat scenarios, which I showed earlier in another repository. As we said before, we have seen that adversary emulation tools do not provide transparency in some of their scenarios. Here, we publish command-line based adversary emulation tool that is fully open source to bring some visibility to how emulation works. All threats and scenarios are public and configurable. Red teamers, blue teamers can easily edit this tool according to their aim. Also, this CLI is developed in Go language for achieving multiplatform execution. This tool includes single config CLI, which is shown here, public scenarios, payloads, and threats. With this config CLI, command-line based tool emulates adversary. Now, we will look at our demo for this presentation. We have one remote machine and we will run adversary emulation scenarios here. For looking scenarios, which are used by the CLI tool, here we can see public threat repository. Here, we can see three different kinds of scenario collection. There are many scenarios in our backlog and we are importing all of these gradually. And these scenarios can be easily updated. All kind of these scenarios is compatible with Maitre. Firstly, we will look at our built-in scenario place before the demo. Demo of the CLI tool. Here, we can see which is shown in our public GitHub repository threat scenarios. We can see here too. For example, for PowerShell, one of the example scenarios, execute PowerShell from the CMD executable to collect and compress files of specific extensions. It is used by the Windows platforms. It is designed for the Windows platforms. There, we can see Maitre tags. Maitre tag name. Also, we can go into the scenario here. If we go here, we can see scenario. If we click on it, we can see there is a simple structure of the JS listed as scenario. Here, the technique, attack ID, name, type, platform and command and interface. You can see here, PowerShell is the interface. Also, you can see here the ID. Also, we said before too, we have many scenarios in our backlog. And we will try to import all of these scenarios. And we will release, we will publish them to Red Teamers, Blue Teamers, Purple Teamers. For now, we will execute the scenarios with our CLI tool instead of using UI interface. Next, we will look at our CLI tool, which is published on GitHub repository again. Here, we can see our Adversary Emulation Client CLI tool. You can easily compile this on your own infrastructure. Also, for ease of use, we published a release. Here, you can go into the release and you can download config.ini file. And you can download Manticore CLI executable. You can run this executable with the config.ini file within same directory. config.ini file includes three components. One of them is public direct group URL, which is used for complex scenario collection. Other one is public threat scenarios URL section. It shows threat scenario repository. Last one is the payload location, which is used for scenario payloads. For execution, as we told before, you simply compile or download executable and config.ini file. You cite necessary URLs for parsing repository on the platform. In the threat groups URL, you can give multiple URLs for emulation, as it accepts an array of URLs. Now, we will firstly will emulate LOLbins emulation for Dove landing a file from a remote server. As we can see here, we give threat group URL. We are coming our tool. Here, our config.ini file and multi-core CLI executable. When we run it, emulation is starting. We have some connection problems here. I will connect again. If we can see here, you can see LOLbin emulation. There are two binaries for Dove landing malicious executable. One of them is using certutil for Dove landing a file from a remote server. In the description, we can see this steps Dove landing a file from a remote web server to host using certutil. Also, we have a different second scenario uses bitsadmin.executable to Dove landing a file from a remote server. That can be seen here. Next, we will emulate ransomware which is published on the multi-core GitHub repository. If we go there, clearly we can see. It includes two phases. For generating this scenarios, we used ransomware emulation repository. First one is Go-based ransomware emulation. Second one is PowerShell-based ransomware emulation. If we edit our thread group URL, then we are running our CLI again. Firstly, Go-based multi-platform ransomware emulation is simulated. Also, secondly, PowerShell-based ransomware emulation is simulated. For example, if we look at the first scenario. First, ISK is generated. Then, encrypted ISK is generated via public key. Then, decrypted ISK via generated private key. Here, we can see encrypted file content and decrypted file content. And we can finally see scenario result here. If you wonder, for example, ransomware emulation executable here listed. As we said before, it is compiled from this repository. You can easily compile that and you can run in your infrastructure. Finally, we will add APT29 emulation URL in config file. Which does not show all scenarios, but few of them we will try to emulate. For being clear, if we go into APT21 JSON file. There we can see different scenario phases. And you can easily go into it. In our github repository. For example. In one of the examples, screen capture native api calls were used to collect a screenshot. It imports the getScreenshot.ps1 file, publish shell file, then call the function. And we will emulate now this one. We are closing that. I will check config file again. Here we can see scenario execution is continuing. Here we completed partially APT29 emulation. As we told before, it is partial. We have different kind of scenarios. You can clearly go them in our github repository. We are trying to import all available scenarios into our platform. Easily people can reach them and they can generate complex scenarios from them. If we continue our slides. For the future work, we are continuing to add all available scenarios to the repository. We are also working on the feature of running scheduled scenarios throughout the UI. Another plan is to integrate our threat intelligence framework into this scenario tool to contribute to the scenario generation and attack prevention. In the public release, we will add reporting feature that will be added. In the other hand, for achieving purple team, we will add security management software integration into our CLI tool and UI feature user interface. Easily red teamers, blue teamers can query which scenario is detected or prevented. In the next, we are waiting for the community support for this tool. Thanks for listening. If you have any questions, please ask us live in discord. Also, you can reach us if you want from this email address. Also, we are waiting for your support on our github platform. Thank you so much again.