1 00:00:00,000 --> 00:00:01,100 My name is Connor Morley. 2 00:00:01,100 --> 00:00:02,260 This is Lacey Fan. 3 00:00:02,260 --> 00:00:03,900 We are Threat Hunters with Cantercept. 4 00:00:03,900 --> 00:00:06,780 And we're going to be doing a presentation here about Killsuit. 5 00:00:07,080 --> 00:00:09,260 So, what exactly are we going to be covering today? 6 00:00:09,260 --> 00:00:23,560 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. 7 00:00:23,920 --> 00:00:28,060 So, first things first, what exactly is Killsuit? 8 00:00:28,060 --> 00:00:38,360 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. 9 00:00:38,900 --> 00:00:49,220 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. 10 00:00:49,340 --> 00:00:56,020 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. 11 00:00:56,020 --> 00:00:59,880 So, this is basically an overview of what Killsuit is. 12 00:00:59,880 --> 00:01:02,740 So, what exactly does Killsuit do? 13 00:01:03,040 --> 00:01:09,540 So, as we mentioned earlier, it is a post-exploitation modular capability mechanism. 14 00:01:09,540 --> 00:01:13,880 It's a bit of a mouthful, but we've done a diagram to basically outline what this means. 15 00:01:14,640 --> 00:01:32,560 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, 16 00:01:32,560 --> 00:01:34,660 which allows for a certain functionality. 17 00:01:35,180 --> 00:01:39,740 Now, the modules all have individual functionalities, and the instances have individual functionalities. 18 00:01:40,460 --> 00:01:41,640 They can't hear me. 19 00:01:42,480 --> 00:01:43,620 Do you hear me now? 20 00:01:43,860 --> 00:01:44,600 Yeah? 21 00:01:44,600 --> 00:01:45,360 All right, fantastic. 22 00:01:45,360 --> 00:01:46,280 Sorry about that. 23 00:01:46,920 --> 00:01:48,060 Where was I? 24 00:01:48,060 --> 00:01:52,960 Yep, so the individual modules all have individual capabilities, and so do all the instances. 25 00:01:52,960 --> 00:02:02,400 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. 26 00:02:02,600 --> 00:02:05,040 Each instance and module type has a different codename. 27 00:02:05,040 --> 00:02:07,800 This is a list of the codenames that we know about. 28 00:02:08,300 --> 00:02:23,660 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. 29 00:02:23,660 --> 00:02:25,960 Now, we've gone over modules and instances. 30 00:02:26,180 --> 00:02:28,380 Basically, this is the way that they fit together. 31 00:02:28,480 --> 00:02:37,820 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. 32 00:02:37,980 --> 00:02:50,220 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. 33 00:02:50,440 --> 00:03:06,420 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. 34 00:03:06,600 --> 00:03:16,400 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. 35 00:03:16,840 --> 00:03:18,940 You see on the right, we also added custom modules. 36 00:03:18,940 --> 00:03:27,720 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. 37 00:03:27,720 --> 00:03:31,100 They used a custom scripting language to begin with, and then moved over to Python. 38 00:03:31,240 --> 00:03:37,580 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. 39 00:03:37,580 --> 00:03:40,140 So, if anyone wants to have a poke at that, that'd be great. 40 00:03:40,700 --> 00:03:47,420 For the main research for this, for the instance types and the module capabilities, a guy, Francisco Donoso, is the one pioneering this. 41 00:03:47,420 --> 00:03:50,980 So, we do recommend looking at his work, because that's basically where he focuses. 42 00:03:51,120 --> 00:03:56,080 We, however, are focused on basically detection of Kilsu when it's installed on a system. 43 00:03:56,140 --> 00:04:01,660 So, we are going to look at what happens when Kilsu is actually installed on a system. 44 00:04:01,840 --> 00:04:09,900 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. 45 00:04:10,640 --> 00:04:26,040 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. 46 00:04:26,040 --> 00:04:37,560 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. 47 00:04:37,560 --> 00:04:42,200 Now, that's anomalous, only in processes that shouldn't do it. 48 00:04:42,240 --> 00:04:49,680 So, by default, Dynasphere is actually injecting to Lsas, so Lsas generating hashes is not so anomalous, Calculator is very anomalous. 49 00:04:49,680 --> 00:04:55,580 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. 50 00:04:55,580 --> 00:04:58,420 However, what it then did with that hash was more interesting. 51 00:04:58,420 --> 00:05:10,040 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. 52 00:05:10,040 --> 00:05:12,600 Now, OEM Management doesn't actually exist. 53 00:05:12,600 --> 00:05:17,100 There's no real reference to that registry key that we could find. 54 00:05:17,240 --> 00:05:25,640 And we found that that's actually where it installed the encrypted Kilsu database, where it basically installed its capabilities. 55 00:05:25,740 --> 00:05:29,320 Now, in the bottom there, you'll see that we've got a KSModuleStoreRoot. 56 00:05:29,320 --> 00:05:34,000 This was basically generated using an internal tool for the framework called DoubleFeature. 57 00:05:34,000 --> 00:05:40,120 DoubleFeature is used by the operators in order to basically verify what is already on their system in a network that's being attacked. 58 00:05:40,120 --> 00:05:42,900 So, the two operators don't necessarily pwn the same machine. 59 00:05:42,900 --> 00:05:44,820 They can see if something's already been installed. 60 00:05:45,140 --> 00:05:48,300 Now, the KSModuleStoreRoot actually corresponds to OEM Management. 61 00:05:48,300 --> 00:05:51,660 Obviously, in this slide, the ones with key eyes can see that it doesn't match. 62 00:05:51,720 --> 00:05:56,160 And the reason for that is, there are a lot of variations about where it put this. 63 00:05:56,160 --> 00:06:00,760 These are just some of the registry locations that we found while experimenting. 64 00:06:01,160 --> 00:06:06,520 Now, you might see that the second half, CACHE, CFG, CONFIG is actually repeated. 65 00:06:06,620 --> 00:06:08,360 And it's split by a capital letter. 66 00:06:08,360 --> 00:06:12,220 Now, we found that actually, the first half and second half were actually repeated quite frequently. 67 00:06:12,220 --> 00:06:15,440 And eventually, it started to basically recur on itself. 68 00:06:15,440 --> 00:06:24,580 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. 69 00:06:24,580 --> 00:06:37,540 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. 70 00:06:37,860 --> 00:06:42,520 We wanted to prove that this was what we thought, and we did this by finding the concatenation operation. 71 00:06:42,800 --> 00:06:50,880 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. 72 00:06:50,980 --> 00:06:51,860 So, hooray. 73 00:06:51,860 --> 00:06:55,760 So, we broke down basically where we're going to investigate to try and find these lists. 74 00:06:55,780 --> 00:06:57,360 And it broke down into three areas. 75 00:06:57,360 --> 00:07:06,200 Basically, whether the communic- whether the operator's framework communicated the location to the active, uh, Petalchip agent to install the kill suit. 76 00:07:06,200 --> 00:07:11,400 Whether the Petalchip agent, when it was in its DLL form before being injected by DoublePulsar, had it hard-coded. 77 00:07:11,480 --> 00:07:24,720 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. 78 00:07:24,720 --> 00:07:31,920 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. 79 00:07:32,060 --> 00:07:33,660 So, definitely not hard-coded. 80 00:07:33,760 --> 00:07:36,900 So, we started looking at, uh, whether it was communicated from the attacker. 81 00:07:36,900 --> 00:07:45,920 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. 82 00:07:46,080 --> 00:07:47,860 And it- it breaks down to this. 83 00:07:48,260 --> 00:07:53,160 The Dynaspirit's user interface was then communicated to Demi library which is decibel minute. 84 00:07:53,440 --> 00:08:06,880 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, 85 00:08:06,880 --> 00:08:08,520 uh, kill suit capabilities. 86 00:08:08,880 --> 00:08:12,920 So, we looked at the decibel minute library to start with. 87 00:08:12,920 --> 00:08:19,020 Uh, we quickly came to the conclusion that decibel minute, uh, was actually used for all of the, uh, kill suit operations. 88 00:08:19,100 --> 00:08:29,320 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. 89 00:08:29,320 --> 00:08:35,480 So, this particular, uh, function allows for, um, changing of the modules inside an active kill suit instance. 90 00:08:35,580 --> 00:08:43,060 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. 91 00:08:43,060 --> 00:08:45,120 And this is inside the Dynaspirit library. 92 00:08:45,320 --> 00:08:51,880 Now, the DSZ library in turn calls a hidden underscore, uh, private underscore DSZ library. 93 00:08:51,880 --> 00:08:54,240 Now, this is where we actually run into a bit of a problem. 94 00:08:54,240 --> 00:08:58,480 The underscore DSZ library and the functions inside it were nowhere inside the framework that we could find. 95 00:08:58,480 --> 00:09:04,240 So, all of the libraries were, uh, Python based and this underscore or any of the functions were not in there. 96 00:09:04,240 --> 00:09:09,320 And that created a real problem because this was primary to how it communicates with the pedal cheap agent. 97 00:09:09,520 --> 00:09:14,980 So, we started looking, because we couldn't find it inside the framework itself, we started looking in the binary. 98 00:09:15,340 --> 00:09:22,540 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. 99 00:09:22,540 --> 00:09:26,440 But the, uh, function locations that we found for them were all empty. 100 00:09:26,640 --> 00:09:36,140 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. 101 00:09:36,220 --> 00:09:39,100 So, although we were trying to statically analyze it, it wasn't there. 102 00:09:39,100 --> 00:09:42,900 So, we moved on to dynamic analysis of the binary, but we ran into even secondary problems. 103 00:09:42,900 --> 00:09:47,720 Now, whoever built this tool, uh, the equation group, um, they really didn't want this being analyzed. 104 00:09:47,720 --> 00:09:50,420 They put in quite a lot of things to prevent us from analyzing it. 105 00:09:50,420 --> 00:09:55,860 One of them was that it detect- detected debug hookers, and if it found one, it would instantly terminate. 106 00:09:55,980 --> 00:09:59,180 So, that was just an indicator of they don't want us looking at this. 107 00:09:59,180 --> 00:10:09,480 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. 108 00:10:09,560 --> 00:10:19,340 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. 109 00:10:19,340 --> 00:10:26,940 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. 110 00:10:27,080 --> 00:10:36,600 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. 111 00:10:36,680 --> 00:10:41,700 So, we moved on to where the payload was deciding it from environmental variables inside the target. 112 00:10:41,700 --> 00:10:44,080 However, this created another set of problems. 113 00:10:44,220 --> 00:10:57,240 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, 114 00:10:57,240 --> 00:10:58,800 we're injected into kernel data. 115 00:10:58,920 --> 00:11:10,620 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. 116 00:11:11,160 --> 00:11:20,480 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. 117 00:11:20,480 --> 00:11:28,200 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. 118 00:11:28,200 --> 00:11:33,000 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. 119 00:11:33,620 --> 00:11:44,100 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. 120 00:11:44,140 --> 00:11:49,480 And it does this, cryptographic default provider type of type 023 registry check. 121 00:11:49,580 --> 00:11:54,000 Now, the first thing of noting is, what exactly is a cryptographic provider type? 122 00:11:54,000 --> 00:12:05,680 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. 123 00:12:05,760 --> 00:12:10,660 Now , this is under the Windows default, and it has a number for AES, DSS, and Diffie-Hyman, things like that. 124 00:12:10,660 --> 00:12:13,980 And it has versions 1 , 3, 5, 12, 13 , 18, and 24. 125 00:12:13,980 --> 00:12:16,740 It does not have a default type of 23. 126 00:12:16,740 --> 00:12:21,420 This was confirmed by looking at Microsoft documentation, as accurate as that can be. 127 00:12:21,620 --> 00:12:28,840 But we found, we also found no trace of any legitimate form of type 023 within the default provider types. 128 00:12:28,840 --> 00:12:35,580 So , we had something that was consistent across all infections, and something that could be easily checked for using registry monitoring . 129 00:12:35,580 --> 00:12:47,240 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. 130 00:12:47,820 --> 00:12:54,500 So, moving on from how we actually did the research, how to detect and actually really remediate killsuit using this information. 131 00:12:54,900 --> 00:12:59,680 So, it breaks down into the type 023 default cryptographic type that I just explained. 132 00:12:59,680 --> 00:13:05,060 The system function 007, which is the NTML hash generation, depending on which process it's injected into. 133 00:13:05,060 --> 00:13:09,780 That has, obviously, quite a big variable for hit and miss, depending on what the operator's injected into. 134 00:13:09,780 --> 00:13:13,420 And the, uh, registry directory that installs the encrypted database. 135 00:13:13,420 --> 00:13:16,320 Again, that's semi-conclusive at the moment, and not fully conclusive. 136 00:13:16,340 --> 00:13:17,840 You'll see that there's an extra box there. 137 00:13:17,840 --> 00:13:22,840 That's because, in the final sweep of the framework, we found that there was actually a driver list that was inside the framework. 138 00:13:22,940 --> 00:13:28,980 And this contained multiple references to killsuit only, or killsuit remove driver after installation. 139 00:13:28,980 --> 00:13:32,060 We found that these actually referred to killsuit loader drivers. 140 00:13:32,260 --> 00:13:37,440 Uh, but, after installation and infection of the machine, we couldn't actually find any trace of them ever being used. 141 00:13:37,440 --> 00:13:42,120 So, although they were inside the framework, we couldn't find any trace of them on what we were looking at. 142 00:13:42,120 --> 00:13:45,920 So, something that could be looked at but we, we couldn't find anything. 143 00:13:46,100 --> 00:13:52,140 So, removal and neutering of a killsuit basically requires the understanding of how, uh, killsuit operates. 144 00:13:52,240 --> 00:13:58,220 And it focuses basically on that it always refers to this encrypted registry database that I explained. 145 00:13:58,220 --> 00:14:03,160 So, the boot pack itself will load the, uh, the killsuit modules from the registry database. 146 00:14:03,160 --> 00:14:05,820 The running killsuit instances refer to the database. 147 00:14:05,820 --> 00:14:10,320 The Pailchip instance, when it tries to enact killsuit, um, actions, has to refer to the database. 148 00:14:10,320 --> 00:14:13,320 So, as you can notice, everything refers to the database. 149 00:14:13,320 --> 00:14:20,440 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. 150 00:14:20,720 --> 00:14:23,420 Now, that breaks down to knowing where killsuit is. 151 00:14:23,440 --> 00:14:27,420 So, um, that, that requires, obviously, a bit more searching of the two lists. 152 00:14:27,420 --> 00:14:29,360 And obviously, if we find two lists, we can find all of it. 153 00:14:29,580 --> 00:14:39,220 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. 154 00:14:39,660 --> 00:14:43,440 So, now I've gone over how to find killsuit, and how to remove it. 155 00:14:43,440 --> 00:14:50,680 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. 156 00:14:50,820 --> 00:14:53,660 Um, and for that, I'm going to hand over to Lacey, who did the research. 157 00:14:59,910 --> 00:15:14,950 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. 158 00:15:15,630 --> 00:15:27,230 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 . 159 00:15:29,050 --> 00:15:33,530 So, how do we find out the different methods of persistence in killsuit ? 160 00:15:33,530 --> 00:15:37,650 Um, we can type the command kiso -survey in the dendospirits terminal. 161 00:15:38,530 --> 00:15:44,410 This figure here shows that there's three types of, um , persistence methods that you can do with killsuit. 162 00:15:44,410 --> 00:15:46,850 And the very first one is driver. 163 00:15:47,370 --> 00:15:50,870 Then you have soti, which stands for solar time. 164 00:15:50,870 --> 00:15:53,870 And then you have juvy, which stands for just visiting. 165 00:15:55,050 --> 00:16:01,310 So, one cool thing about this command is that it will tell you whether it is compatible with your victim host. 166 00:16:01,470 --> 00:16:07,990 For example, driver is outdated because of code signing policies that in Windows implemented. 167 00:16:08,390 --> 00:16:13,410 And just visiting is also outdated because it is built for Windows Vista. 168 00:16:14,130 --> 00:16:19,450 So, the only compatible method that we are left with is actually solar time. 169 00:16:20,810 --> 00:16:23,710 But what exactly is solar time? 170 00:16:23,850 --> 00:16:32,410 So, I was really curious and I wanted to find out whether there are any information available online about this elusive method. 171 00:16:32,670 --> 00:16:41,850 And I found out to be as safe as possible equation group when really low level as they can, which is infecting the firmware. 172 00:16:42,590 --> 00:16:49,970 So, according to a report made by Kaspersky , solar time was first termed by them as Grayfish . 173 00:16:50,270 --> 00:17:02,230 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 . 174 00:17:05,780 --> 00:17:10,180 And this is the Grayfish architecture presented by Kaspersky . 175 00:17:10,480 --> 00:17:15,440 So , in an infected volume boot record, an encrypted container is loaded. 176 00:17:15,700 --> 00:17:24,380 The container file will then load a kernel mode orchestrator which then loads the user mode part from registry before starting the payloads . 177 00:17:24,560 --> 00:17:29,040 And so what we are going to do is to focus on the left box portion of the diagram . 178 00:17:32,140 --> 00:17:37,360 But what exactly is this encrypted container file that is loaded in the volume boot record ? 179 00:17:37,540 --> 00:17:50,160 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. 180 00:17:50,220 --> 00:17:54,560 This is the only file that is searchable through the file system on disk. 181 00:17:55,080 --> 00:18:04,760 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 . 182 00:18:07,450 --> 00:18:18,770 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 . 183 00:18:19,670 --> 00:18:29,670 So the first step is during power on , the BIOS boot code begins with basic system initialization , for example, simplified input output interface . 184 00:18:30,670 --> 00:18:37,230 The BIOS then loads the master boot record , which finds the active partition and loads the volume boot record . 185 00:18:38,430 --> 00:18:45,730 The volume boot record contains partition layout information in a data structure called the BIOS parameter block . 186 00:18:45,750 --> 00:18:56,450 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 . 187 00:18:58,930 --> 00:19:06,310 The volume boot record then passes control to the initial program loader , which is responsible for parsing the file system . 188 00:19:07,310 --> 00:19:18,790 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 . 189 00:19:21,050 --> 00:19:28,790 So, after all this reading up and discovering on boot kits and greyfish , how does Solartime actually work in relation to this boot process ? 190 00:19:30,610 --> 00:19:37,190 So , the very first change we noticed is that Solartime disables error reporting in the volume boot record. 191 00:19:38,750 --> 00:19:45,150 Looking at the volume boot record , instead of a hot instruction , Solartime changed it into infinite loop . 192 00:19:45,550 --> 00:19:54,850 Operational errors are standardly displayed by hitting a hot command stopping function , so examples could be a missing or compressed boot manager. 193 00:19:55,090 --> 00:20:02,530 And Solartime changes this , so even if an operation - operational error occurs , no error reporting actually happens . 194 00:20:02,530 --> 00:20:07,990 So, this prevents alerts or cause of investigation into the cause of a boot failure . 195 00:20:12,110 --> 00:20:20,650 And the second disparity between a normal boot process and Solartime infected boot is that it relocates the IPL . 196 00:20:22,230 --> 00:20:31,030 And right before passing control to the IPL , Solartime replaces multiple instructions with NOTBYTES and overwrites the jump destination. 197 00:20:31,370 --> 00:20:38,450 And so the reason for overwriting this destination is that Solartime hides a lot of data at 7E7A . 198 00:20:38,990 --> 00:20:45,850 So this forces Solartime to use an alternate location to launch the IPL from within the volume boot record. 199 00:20:49,020 --> 00:20:51,680 So this is a sample from an infected boot . 200 00:20:51,680 --> 00:20:56,160 You can see that the address 7E7A contains lots of random bytes . 201 00:20:56,600 --> 00:21:04,020 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 . 202 00:21:06,600 --> 00:21:12,300 So if the control passed to the IPL , Solartime then starts to locate and load the container file. 203 00:21:13,040 --> 00:21:20,160 And to do that, Solartime uses many of the in-built loading functions already in a normal boot by inserting an ECX flag. 204 00:21:20,160 --> 00:21:26,680 So this way , Solartime can control when to load its malicious file without affecting the normal IPL process . 205 00:21:27,400 --> 00:21:36,720 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 . 206 00:21:38,480 --> 00:21:45,300 As the IPL file system, I'll squeeze in a little information on that. 207 00:21:45,440 --> 00:21:50,820 So NTFS is the file system of Windows, and everything on an NTFS volume is a file . 208 00:21:50,920 --> 00:21:57,860 And one of the special file you have in NTFS is object ID which contains unique IDs given to every file . 209 00:21:58,540 --> 00:22:03,320 So the attributes of object ID are the five shown here at the different offsets . 210 00:22:03,320 --> 00:22:08,500 And I would like to draw your attention to the third attribute which is index root. 211 00:22:08,940 --> 00:22:14,620 Index root is the root node and contains a list of all index entries of the object IDs . 212 00:22:16,560 --> 00:22:23,000 So a typical index entry structure in the index root of the object ID file is called the O index . 213 00:22:23,060 --> 00:22:32,440 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 . 214 00:22:35,540 --> 00:22:39,380 MFT file reference can be fetched to load the file record. 215 00:22:40,740 --> 00:22:47,220 So this diagram shows how Solartime actually hijacks a normal operation of the IPL and loads its container file . 216 00:22:47,360 --> 00:22:53,500 And in the malicious flow , Solartime passes the object ID index root depending on the ECX register. 217 00:22:53,800 --> 00:22:59,720 This object ID file is not usually loaded or needed in the IPL section of a normal boot process . 218 00:22:59,740 --> 00:23:03,600 And if the ECX register is set , a standard load will occur. 219 00:23:03,600 --> 00:23:14,420 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. 220 00:23:16,400 --> 00:23:22,800 So on the left shows the file record of the boot pack loaded with the name david byte or ttf. 221 00:23:22,900 --> 00:23:27,840 And on the right are the contents of the file being loaded to address 600,000. 222 00:23:28,800 --> 00:23:36,860 And so after loading the true type font file, SOTY decrypts the malware using the encryption key hidden under 7E7A. 223 00:23:36,860 --> 00:23:44,280 After decryption of the malware, Solartime then proceeds on to calculate a CRC32 hash to verify the file integrity . 224 00:23:45,820 --> 00:23:49,740 So how can we detect and remediate Solartime ? 225 00:23:49,740 --> 00:24:01,220 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. 226 00:24:02,300 --> 00:24:05,700 Installation of Solartime can be determined in two ways . 227 00:24:05,700 --> 00:24:13,280 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. 228 00:24:13,660 --> 00:24:20,620 Examination of the script did reveal things that are helpful which are the various names the kernel driver container could be stored under . 229 00:24:20,620 --> 00:24:21,400 So in this 230 00:24:25,660 --> 00:24:26,520 slides. 231 00:24:26,880 --> 00:24:31,500 And the second way of detection is to check the volume boot record itself. 232 00:24:31,500 --> 00:24:38,500 As mentioned, Solartime alters the VBR, changing the jump address when transferring control to the IPL. 233 00:24:38,500 --> 00:24:45,780 And in doing so, it inputs two NOP commands at the 267 and 268 bytes of the VBR. 234 00:24:46,520 --> 00:24:50,480 So this alteration can be searched by using Python. 235 00:24:50,480 --> 00:24:54,760 We modified the open source code PyMBR written by Hamtas. 236 00:24:54,760 --> 00:25:00,120 And in our version, find the first section of the MBR to find the start of the VBR. 237 00:25:00,120 --> 00:25:08,680 We then check the data in the VBR at byte 267 and 268 for the hex value 90, which is code for NOP. 238 00:25:09,100 --> 00:25:14,400 And if the NOP value in place is in place, we can confirm that the VBR has been modified. 239 00:25:15,400 --> 00:25:18,680 So Solartime is really hard to prevent because it infects the 240 00:25:25,660 --> 00:25:33,780 However, since Solartime does only affect the legacy boot systems, opting for UEFI secure boot would prevent Solartime from working. 241 00:25:35,080 --> 00:25:41,340 Okay, so this is supposed to be a talk given by Francisco Donoso , but internet is definitely not working now . 242 00:25:42,140 --> 00:25:45,480 But this is what inspired our research . 243 00:25:45,480 --> 00:25:53,780 And this is a book that is also fantastic for my research , so do check them out if you have time . 244 00:25:54,640 --> 00:25:57,280 And yep, we're done.