My name is Connor Morley. This is Lacey Fan. We are Threat Hunters with Cantercept. And we're going to be doing a presentation here about Killsuit. So, what exactly are we going to be covering today? We're going to be covering what Killsuit is, what it does, what happens when it's installed into a system, how to detect and remediate Killsuit, how Killsuit persists in the system using advanced bootkit Solartime, and how to detect and remediate a Solartime infection. So, first things first, what exactly is Killsuit? So, Killsuit is a post exploitation framework that was developed by the Equation Group prior to 2013 and leaked by the Shadow Brokers in the Lost in Translation leak in 2017. It's supposedly developed by the Equation Group, which are strongly associated with the NSA, although not confirmed, so it's likely a state-sponsored actor-level attack framework. We know this is in the Dan Spitz framework, which was inside the leak, and United Rake, which has direct references to it inside its instruction manual. So, this is basically an overview of what Killsuit is. So, what exactly does Killsuit do? So, as we mentioned earlier, it is a post-exploitation modular capability mechanism. It's a bit of a mouthful, but we've done a diagram to basically outline what this means. Effectively, the Dan de Spitz framework uses the Fuzzy Bunch exploitation collection in order to pwn a victim, to install a pedal-cheap agent, which is their advanced C2 channel, which then allows them to install a Killsuit instance, which has underlying Killsuit modules, which allows for a certain functionality. Now, the modules all have individual functionalities, and the instances have individual functionalities. They can't hear me. Do you hear me now? Yeah? All right, fantastic. Sorry about that. Where was I? Yep, so the individual modules all have individual capabilities, and so do all the instances. Some of these can include persistence of the pedal-cheap agent, which is a priority for the Dan de Spitz framework, as this allows persistence of their C2 channel inside the victim. Each instance and module type has a different codename. This is a list of the codenames that we know about. They all have different functionalities, such as Strangeland, which is a covert keylogger, Magic Bean, which is a Wi-Fi man-in-the-middle attack capability enablement, or DarkSky, which is a packet capture utility, which is a module type. Now, we've gone over modules and instances. Basically, this is the way that they fit together. So, you can have instance types which have individual capabilities, but you can install separate modules under them, which allows multiple instances to have the same capability. So, in this diagram, you can see that SOKN, which is Sombernave, and WRWA, which is Wraithwrath, both have the DarkSky module installed, which means that both instances have the capability to do packet capture. Whereas, Magic Bean and Sombernave, which are the two on the left, the one on the left has FluAvenue, which is Flav, which is the IPv4 custom-made IPvTCP stack that the guys use in order to avoid detection, and DMGZ, which is Doorman Gores, which is the IPv6 variant. So, you can have lots of instance types which have different capabilities, and you can install separate modules under them to have either repeated or specific functionality. You see on the right, we also added custom modules. That's because the Kilsu module library had the capacity to add new modules, but we didn't actually find how they built these things or the sort of language they used. They used a custom scripting language to begin with, and then moved over to Python. So, although it has the capacity to load new modules that have never been seen before, we couldn't actually find a way to build these or put them in. So, if anyone wants to have a poke at that, that'd be great. For the main research for this, for the instance types and the module capabilities, a guy, Francisco Donoso, is the one pioneering this. So, we do recommend looking at his work, because that's basically where he focuses. We, however, are focused on basically detection of Kilsu when it's installed on a system. So, we are going to look at what happens when Kilsu is actually installed on a system. So, we did this by obviously creating lots of victim machines and an operating machine, pwning using Fuzzy Bunch, and then installing Kilsu to see exactly what happened. For an example, so, we had to condense this down, but one of the main things that we saw was that we injected into a calculator process using DoublePulsar, and this created this sort of action when Kilsu was installed. I call this the Jones-Bond function, but basically it's an HTML hash generation, which happens inside Calculator, which, as you might imagine, there's no reason it should be generating hashes inside Calculator. Now, that's anomalous, only in processes that shouldn't do it. So, by default, Dynasphere is actually injecting to Lsas, so Lsas generating hashes is not so anomalous, Calculator is very anomalous. So, depending on where the operator decides to inject into, it's quite detectable or not, so it's not a be-all, end-all. However, what it then did with that hash was more interesting. So, we actually traced where that hash was used inside the process, and we found that it basically was used to inject or modify this registry key, OEM Management. Now, OEM Management doesn't actually exist. There's no real reference to that registry key that we could find. And we found that that's actually where it installed the encrypted Kilsu database, where it basically installed its capabilities. Now, in the bottom there, you'll see that we've got a KSModuleStoreRoot. This was basically generated using an internal tool for the framework called DoubleFeature. DoubleFeature is used by the operators in order to basically verify what is already on their system in a network that's being attacked. So, the two operators don't necessarily pwn the same machine. They can see if something's already been installed. Now, the KSModuleStoreRoot actually corresponds to OEM Management. Obviously, in this slide, the ones with key eyes can see that it doesn't match. And the reason for that is, there are a lot of variations about where it put this. These are just some of the registry locations that we found while experimenting. Now, you might see that the second half, CACHE, CFG, CONFIG is actually repeated. And it's split by a capital letter. Now, we found that actually, the first half and second half were actually repeated quite frequently. And eventually, it started to basically recur on itself. So, we came to the conclusion that this was more or less two lists that were being concatenated together and randomly or systematically selected at installation. So, we concluded that if we could find these two lists with inside the framework or the binary, we could therefore generate every combination and have an easy IOC identifier for where the kill C was installed and basically just sweep registries to be able to find this. We wanted to prove that this was what we thought, and we did this by finding the concatenation operation. So, we found that the registry location had two separate strings that were then concatenated together and then added to the end of the registering to verify that this was in fact what we thought it was. So, hooray. So, we broke down basically where we're going to investigate to try and find these lists. And it broke down into three areas. Basically, whether the communic- whether the operator's framework communicated the location to the active, uh, Petalchip agent to install the kill suit. Whether the Petalchip agent, when it was in its DLL form before being injected by DoublePulsar, had it hard-coded. Or whether the payload, uh, the Petalchip agent had both lists already in it and then decided basically to put, uh, on the victim's, uh, victim system variables what options it was going to pick. Now, we very quickly eliminated that it was hard-coded into the payload because reuse of the payload didn't generate the same result so it still was randomized. So, definitely not hard-coded. So, we started looking at, uh, whether it was communicated from the attacker. Now, in order to do this, we had to basically break down, uh, how the commands were used inside the- inside the framework and how it was then transmitted to the agent. And it- it breaks down to this. The Dynaspirit's user interface was then communicated to Demi library which is decibel minute. Uh, this was then handed off to the Dynaspirit or DSZ library which in turn communicated with the primary, uh, the primary binary which is the DD-DDZS core, uh, SC core which communicated with the prototype agent inside the victim which then, uh, enacted, uh, kill suit capabilities. So, we looked at the decibel minute library to start with. Uh, we quickly came to the conclusion that decibel minute, uh, was actually used for all of the, uh, kill suit operations. One of the libraries that this one is inside, the handle connects, is actually, um, uh, is responsible for, uh, dynamically loading and unload module drivers inside a kill suit instance. So, this particular, uh, function allows for, um, changing of the modules inside an active kill suit instance. But, from the bit that I've highlighted, you can see that it actually hands off, uh, to a, uh, MCL dot tasking RPC perform call. And this is inside the Dynaspirit library. Now, the DSZ library in turn calls a hidden underscore, uh, private underscore DSZ library. Now, this is where we actually run into a bit of a problem. The underscore DSZ library and the functions inside it were nowhere inside the framework that we could find. So, all of the libraries were, uh, Python based and this underscore or any of the functions were not in there. And that created a real problem because this was primary to how it communicates with the pedal cheap agent. So, we started looking, because we couldn't find it inside the framework itself, we started looking in the binary. We, uh, sadly analyzed the binary and we found that it did have error captures for particular functions inside, that we knew were inside this private library. But the, uh, function locations that we found for them were all empty. So, a bit more extra research by one of our colleagues, Alex Kornitsa, uh, found that it was in fact a C Python module library that was loaded at runtime, which is why we couldn't find it statically. So, although we were trying to statically analyze it, it wasn't there. So, we moved on to dynamic analysis of the binary, but we ran into even secondary problems. Now, whoever built this tool, uh, the equation group, um, they really didn't want this being analyzed. They put in quite a lot of things to prevent us from analyzing it. One of them was that it detect- detected debug hookers, and if it found one, it would instantly terminate. So, that was just an indicator of they don't want us looking at this. We were actually able to hide the debugger and get it to run anyway, but all the memory locations that we found that were allocated to the function, including the index root for the functions, there were multiple, and a lot of them were dummies. And even the locations for the variables, we found that the data was either loaded and unloaded so quickly we couldn't find it, or we couldn't find the true variable that was actually looking for, which was extremely annoying. So, we actually reached the capability of our analysis, and we had to conclude we don't know if it's there, which was very unfortunate. So, we came to the conclusion of, although we've got to the end of our capability, we're not sure it's there, but if we can eliminate that it's inside the payload, at least we can focus on one particular area. So, we moved on to where the payload was deciding it from environmental variables inside the target. However, this created another set of problems. So, the binary, when it's injected, is actually encrypted, and in looking at the stack of the process injected into, the variables we were looking for for kill suit operations, where instead of being, as far as we can tell, instead of being injected into the process, we're injected into kernel data. Now, we couldn't figure out how it did it, we couldn't figure out why it did it, and we couldn't extract the variables we were looking for, which, again, created the situation of, we don't know if it's there, which made us very upset. So, although this came to the conclusion of, we have a lot of possible variations of the combination of the two lists we have, we couldn't actually find the two lists within the system. Now, if anyone does have expertise in this area, please talk to me, because we really want to find this list, because that would be really awesome. But, although we couldn't find these two lists we were looking for, we didn't let it stop us, and we carried on anyway. And in doing so, we came across this, which we found was, a check that was made against every fresh kill suit installation on a fresh, petal cheap instance on site of victim. And it does this, cryptographic default provider type of type 023 registry check. Now, the first thing of noting is, what exactly is a cryptographic provider type? Now, a cryptographic provider type is basically a plug and play function, or a plug and play description inside the registry, which explains how certain encryption algorithms are to be used with certain variables for specific outcomes. Now, this is under the Windows default, and it has a number for AES, DSS, and Diffie-Hyman, things like that. And it has versions 1, 3, 5, 12, 13, 18, and 24. It does not have a default type of 23. This was confirmed by looking at Microsoft documentation, as accurate as that can be. But we found, we also found no trace of any legitimate form of type 023 within the default provider types. So, we had something that was consistent across all infections, and something that could be easily checked for using registry monitoring. So, we had a consistent point of installation that we can monitor for, using this type 023, and we had a semi-conclusive way of monitoring for legacy installations, using the registry locations that we generated. So, moving on from how we actually did the research, how to detect and actually really remediate killsuit using this information. So, it breaks down into the type 023 default cryptographic type that I just explained. The system function 007, which is the NTML hash generation, depending on which process it's injected into. That has, obviously, quite a big variable for hit and miss, depending on what the operator's injected into. And the, uh, registry directory that installs the encrypted database. Again, that's semi-conclusive at the moment, and not fully conclusive. You'll see that there's an extra box there. That's because, in the final sweep of the framework, we found that there was actually a driver list that was inside the framework. And this contained multiple references to killsuit only, or killsuit remove driver after installation. We found that these actually referred to killsuit loader drivers. Uh, but, after installation and infection of the machine, we couldn't actually find any trace of them ever being used. So, although they were inside the framework, we couldn't find any trace of them on what we were looking at. So, something that could be looked at but we, we couldn't find anything. So, removal and neutering of a killsuit basically requires the understanding of how, uh, killsuit operates. And it focuses basically on that it always refers to this encrypted registry database that I explained. So, the boot pack itself will load the, uh, the killsuit modules from the registry database. The running killsuit instances refer to the database. The Pailchip instance, when it tries to enact killsuit, um, actions, has to refer to the database. So, as you can notice, everything refers to the database. So, if you know what the registry database is, and you remove it, you just, you destroy, you basically neuter killsuit and all of its functionality. Now, that breaks down to knowing where killsuit is. So, um, that, that requires, obviously, a bit more searching of the two lists. And obviously, if we find two lists, we can find all of it. Um, if not, uh, the list that we provided, we have done a research paper, and the two lists that we found of the two halves, and basically, any combination you can find, it's an easy sweep to do across an estate. So, now I've gone over how to find killsuit, and how to remove it. What's more interesting, and what's very important, is how the SOTY there, SOTY bootpack, SOTY bootpack operator, which is their advanced bootloader, works. Um, and for that, I'm going to hand over to Lacey, who did the research. So, thinking about all those, like, complex frameworks that we just saw for defense evasion, um, it will probably be pointless if you do not implement a persisting module, which the attackers could connect back to, should a parallel chip connection be dropped. Installing a persistence mechanism actually means that if the system is patched from the exploits that is present in fastpunch, the attacker will still be able to compromise the system at any time they want. So, how do we find out the different methods of persistence in killsuit? Um, we can type the command kiso-survey in the dendospirits terminal. This figure here shows that there's three types of, um, persistence methods that you can do with killsuit. And the very first one is driver. Then you have soti, which stands for solar time. And then you have juvy, which stands for just visiting. So, one cool thing about this command is that it will tell you whether it is compatible with your victim host. For example, driver is outdated because of code signing policies that in Windows implemented. And just visiting is also outdated because it is built for Windows Vista. So, the only compatible method that we are left with is actually solar time. But what exactly is solar time? So, I was really curious and I wanted to find out whether there are any information available online about this elusive method. And I found out to be as safe as possible equation group when really low level as they can, which is infecting the firmware. So, according to a report made by Kaspersky, solar time was first termed by them as Grayfish. It inserts a pill into the firmware which hijacks the boot sequence of the operating system, and then it gains complete control to install a virtual file system in the registry of the hard drive. And this is the Grayfish architecture presented by Kaspersky. So, in an infected volume boot record, an encrypted container is loaded. The container file will then load a kernel mode orchestrator which then loads the user mode part from registry before starting the payloads. And so what we are going to do is to focus on the left box portion of the diagram. But what exactly is this encrypted container file that is loaded in the volume boot record? To check whether, to check which is the container file being loaded, you can run the solty python script in the dendasprite terminal and it will tell you the solartime container present in the disk. This is the only file that is searchable through the file system on disk. And this container file is stored as a true type font file and will be the very first file loaded by Windows even prior to kernel initialization. So since solartime affects the volume boot record, it is considered as a and before analyzing boot kits, I would like to go through a little bit on the Windows boot process. So the first step is during power on, the BIOS boot code begins with basic system initialization, for example, simplified input output interface. The BIOS then loads the master boot record, which finds the active partition and loads the volume boot record. The volume boot record contains partition layout information in a data structure called the BIOS parameter block. This block describes the physical layout of the data storage volume, for example, is it an NTFS or the FAT file system, was the number of sectors per cluster, etc. The volume boot record then passes control to the initial program loader, which is responsible for parsing the file system. It then loads the boot manager, which manages the boot process until the user chooses a boot option, before loading wingload.exe, which is responsible for starting the kernel. So, after all this reading up and discovering on boot kits and greyfish, how does Solartime actually work in relation to this boot process? So, the very first change we noticed is that Solartime disables error reporting in the volume boot record. Looking at the volume boot record, instead of a hot instruction, Solartime changed it into infinite loop. Operational errors are standardly displayed by hitting a hot command stopping function, so examples could be a missing or compressed boot manager. And Solartime changes this, so even if an operation- operational error occurs, no error reporting actually happens. So, this prevents alerts or cause of investigation into the cause of a boot failure. And the second disparity between a normal boot process and Solartime infected boot is that it relocates the IPL. And right before passing control to the IPL, Solartime replaces multiple instructions with NOTBYTES and overwrites the jump destination. And so the reason for overwriting this destination is that Solartime hides a lot of data at 7E7A. So this forces Solartime to use an alternate location to launch the IPL from within the volume boot record. So this is a sample from an infected boot. You can see that the address 7E7A contains lots of random bytes. And so it turns out that these bytes store the file reference and encryption key that are used later on to load and decrypt the file. So if the control passed to the IPL, Solartime then starts to locate and load the container file. And to do that, Solartime uses many of the in-built loading functions already in a normal boot by inserting an ECX flag. So this way, Solartime can control when to load its malicious file without affecting the normal IPL process. So reusing standard bootcode is more efficient because Solartime will not have to rewrite everything which would probably introduce a lot more instability in the system. As the IPL file system, I'll squeeze in a little information on that. So NTFS is the file system of Windows, and everything on an NTFS volume is a file. And one of the special file you have in NTFS is object ID which contains unique IDs given to every file. So the attributes of object ID are the five shown here at the different offsets. And I would like to draw your attention to the third attribute which is index root. Index root is the root node and contains a list of all index entries of the object IDs. So a typical index entry structure in the index root of the object ID file is called the O index. And Solartime identifies its container file by comparing the GU ID object ID value in the O index with the object ID stored at address 7E7A. MFT file reference can be fetched to load the file record. So this diagram shows how Solartime actually hijacks a normal operation of the IPL and loads its container file. And in the malicious flow, Solartime passes the object ID index root depending on the ECX register. This object ID file is not usually loaded or needed in the IPL section of a normal boot process. And if the ECX register is set, a standard load will occur. If not, it will load the- load the index root of the object ID file, locates the index entry of the container file, and then load the file record before loading the file data. So on the left shows the file record of the boot pack loaded with the name david byte or ttf. And on the right are the contents of the file being loaded to address 600,000. And so after loading the true type font file, SOTY decrypts the malware using the encryption key hidden under 7E7A. After decryption of the malware, Solartime then proceeds on to calculate a CRC32 hash to verify the file integrity. So how can we detect and remediate Solartime? Since Qsuit can only use Solartime to install on modern operating systems that are still using the legacy boot, detecting Solartime will be a solution to detecting all Qsuit instances. Installation of Solartime can be determined in two ways. First, you can use the checked Solartime Python script, but this is inconvenient because you probably need to pawn your own machine to check it. Examination of the script did reveal things that are helpful which are the various names the kernel driver container could be stored under. So in this slides. And the second way of detection is to check the volume boot record itself. As mentioned, Solartime alters the VBR, changing the jump address when transferring control to the IPL. And in doing so, it inputs two NOP commands at the 267 and 268 bytes of the VBR. So this alteration can be searched by using Python. We modified the open source code PyMBR written by Hamtas. And in our version, find the first section of the MBR to find the start of the VBR. We then check the data in the VBR at byte 267 and 268 for the hex value 90, which is code for NOP. And if the NOP value in place is in place, we can confirm that the VBR has been modified. So Solartime is really hard to prevent because it infects the However, since Solartime does only affect the legacy boot systems, opting for UEFI secure boot would prevent Solartime from working. Okay, so this is supposed to be a talk given by Francisco Donoso, but internet is definitely not working now. But this is what inspired our research. And this is a book that is also fantastic for my research, so do check them out if you have time. And yep, we're done.