1 00:00:00,000 --> 00:00:01,960 Good afternoon DEF CON. 2 00:00:02,060 --> 00:00:08,880 I'm Agostino aka Vanish and I'm here to talk about slaying dragons. 3 00:00:08,880 --> 00:00:19,320 Not the mythical one so we are not talking about the orbit but we are talking about the one that got modern software through sophisticated virtualization based techniques. 4 00:00:21,820 --> 00:00:24,960 This is the agenda for the next 45 minutes. 5 00:00:25,420 --> 00:00:28,300 We are going to start with a brief introduction. 6 00:00:28,740 --> 00:00:31,420 We are going to see the VM protection evolution. 7 00:00:32,060 --> 00:00:37,140 I'm presenting the VM dragon slayer architecture and we do a deep dive. 8 00:00:37,140 --> 00:00:39,720 We do some live demos because it's cool. 9 00:00:40,440 --> 00:00:53,740 We do some, we analyze some performance and validation and we analyze the limitation, the future work and the community that I hope to build around the project after this talk. 10 00:00:55,180 --> 00:00:57,680 Let's set up the expectation. 11 00:00:58,260 --> 00:01:03,440 Why VM protection is winning the arm race? 12 00:01:03,440 --> 00:01:06,100 This is what we are going to analyze today. 13 00:01:06,380 --> 00:01:14,640 How VM dragon slayer, that is the framework that I'm presenting today, defeats this protection using hybrid analysis techniques. 14 00:01:14,960 --> 00:01:24,760 We do some live demos as I said before and also after the talk the entire framework will be completely open source to everyone to use it. 15 00:01:25,900 --> 00:01:42,500 The talk is aimed for malware analyst, reverse engineer, instant response, instant responder, security researcher and frankly anyone who is tired of being defeated by obfuscated code or is trying to build better obfuscated code. 16 00:01:43,740 --> 00:01:50,000 So before we jump into the technical myth, let me introduce myself. 17 00:01:50,000 --> 00:01:57,540 I'm a security researcher with over 15 years in engineering. 18 00:02:00,300 --> 00:02:04,380 I'm the maintainer of the project that I'm presenting today. 19 00:02:08,000 --> 00:02:15,440 I'm also the maintainer of spider foot today, a fork of spider foot that is being revived. 20 00:02:16,220 --> 00:02:23,460 And the framework that is the framework for exploitation that I'm going to present tomorrow. 21 00:02:25,060 --> 00:02:30,540 My research focus is everything that's weaponizable. 22 00:02:30,640 --> 00:02:31,700 That's it. 23 00:02:32,240 --> 00:02:39,180 And when I'm not breaking things, I love scuba diving because I love the exploration. 24 00:02:39,740 --> 00:02:44,400 I'm also the owner, the proud owner of three cuts. 25 00:02:44,400 --> 00:02:49,840 And while I'm speaking they are probably planning the world conquest. 26 00:02:50,390 --> 00:02:52,460 That's why they are looking at us. 27 00:02:54,710 --> 00:03:04,610 Now, how many of you have ever tried to reverse engineer software protected by VM protect for instance? 28 00:03:04,610 --> 00:03:11,530 Or encounter custom VM based malware that made you question your career choice? 29 00:03:13,430 --> 00:03:18,170 I know some of you have done, otherwise you would not be here doing this talk. 30 00:03:18,690 --> 00:03:20,270 We all have been there. 31 00:03:20,510 --> 00:03:29,310 Staring at the sample code that looks like it was written by an alien civilization having a particularly bad day. 32 00:03:29,750 --> 00:03:32,530 Let me show you what we are dealing with. 33 00:03:33,570 --> 00:03:38,750 This is what happens when a simple three line function gets the VM protect treatment. 34 00:03:39,030 --> 00:03:43,150 On the left, we have an elegant readable assembly. 35 00:03:43,210 --> 00:03:49,270 A basic function that any first year computer science student could understand. 36 00:03:49,710 --> 00:03:51,750 Three sections, easy. 37 00:03:51,750 --> 00:03:54,850 Load two values, add them, return the result. 38 00:03:55,150 --> 00:03:59,950 On the right, we have what I like to call the algorithmic nightmare fuel. 39 00:04:00,410 --> 00:04:07,970 Over 500 lines of deliberately obfuscated code that will make Lovecraft proud. 40 00:04:08,610 --> 00:04:10,610 This isn't just obfuscation. 41 00:04:10,670 --> 00:04:13,930 It's a complete architectural transformation. 42 00:04:14,840 --> 00:04:19,550 But there is what makes it truly nightmare-ish from a technical perspective. 43 00:04:19,550 --> 00:04:29,130 Behind those 500 lines, we have a constraint satisfaction problem with over 1,200 pod constraints. 44 00:04:29,230 --> 00:04:33,330 More than 256 virtual registers. 45 00:04:33,710 --> 00:04:39,790 64 custom VM handlers implementing a unique instruction set. 46 00:04:39,790 --> 00:04:44,990 Dynamic propagation across more than 47 execution pods. 47 00:04:44,990 --> 00:04:46,450 That's what we have. 48 00:04:46,610 --> 00:04:57,050 And if it was not enough, a symbolic execution, the challenge that will break traditional analysis engine. 49 00:04:57,970 --> 00:05:01,450 The original control flow, it's gone. 50 00:05:02,690 --> 00:05:09,290 It's been completely destroyed and it's been replaced by custom virtual machine. 51 00:05:09,290 --> 00:05:18,550 The data flow, hidden behind constraint satisfaction problems that require advanced symbolic reasoning. 52 00:05:19,930 --> 00:05:29,650 This isn't just a problem, an academic problem or something that affects a few security researchers. 53 00:05:29,650 --> 00:05:32,130 Let me share some statistics. 54 00:05:32,270 --> 00:05:38,010 We are living through an arm race that's fundamentally changing the landscape of software protection. 55 00:05:38,250 --> 00:05:50,390 I analyze almost 300, 400 samples over 2024 of advanced threat factors. 56 00:05:50,470 --> 00:05:52,950 And the results are striking. 57 00:05:52,990 --> 00:06:00,110 70 percent of them employ some form of virtualization-based protection. 58 00:06:00,450 --> 00:06:03,270 Think about the numbers for a moment. 59 00:06:04,050 --> 00:06:14,990 Seven out of ten advanced threats are using techniques that completely breaks our traditional analysis approach. 60 00:06:15,890 --> 00:06:21,690 The success rate of existing tools, less than 15 percent. 61 00:06:22,070 --> 00:06:30,650 This means that 85 percent of the time, your current tool chain is failing you. 62 00:06:30,750 --> 00:06:41,330 Manual analysis time has ballooned to two to six months per sample. 63 00:06:41,370 --> 00:06:48,890 And we are seeing over 200 thousand variation per day nowadays. 64 00:06:48,890 --> 00:06:52,410 The mathematics are unforgiving. 65 00:06:52,410 --> 00:06:55,910 We are losing this world through shared numbers. 66 00:06:58,310 --> 00:07:04,590 But let me trace the evolution that brought us to this special circle. 67 00:07:06,130 --> 00:07:15,230 Do you remember the good old days when you peaks was the hate of sophistication? 68 00:07:15,910 --> 00:07:22,010 These early protection protectors focused on compression and simple encryption. 69 00:07:22,010 --> 00:07:23,090 That's it. 70 00:07:23,610 --> 00:07:31,510 You could defeat most of them with generic or just setting the right break point. 71 00:07:32,910 --> 00:07:35,730 Life was simple back then. 72 00:07:35,750 --> 00:07:38,290 We didn't realize it, but it was simple. 73 00:07:38,710 --> 00:07:42,070 The typical analysis process was almost ritualistic. 74 00:07:42,430 --> 00:07:44,290 Set a break point. 75 00:07:45,250 --> 00:07:47,810 Run until you hit it. 76 00:07:48,990 --> 00:07:51,050 Fix the import. 77 00:07:51,150 --> 00:07:53,790 Celebrate with beer because you're done. 78 00:07:54,290 --> 00:08:03,550 And then in 2010, VM protect 1.6 came out and everything changed. 79 00:08:04,210 --> 00:08:16,330 It was like going from child play to adult play to casino play. 80 00:08:16,330 --> 00:08:27,330 The introduction of 686 instructions were converted into custom VM byte codes. 81 00:08:27,690 --> 00:08:30,930 The protection wasn't just about adding code anymore. 82 00:08:30,930 --> 00:08:34,890 It was about a fundamental architecture transformation. 83 00:08:35,610 --> 00:08:38,650 But then we move on phase 3. 84 00:08:38,650 --> 00:08:39,690 It's like the MCU. 85 00:08:39,690 --> 00:08:41,170 We are going forward. 86 00:08:41,770 --> 00:08:44,150 And we got VM protect 3.X. 87 00:08:44,150 --> 00:08:45,850 We got VM. 88 00:08:46,070 --> 00:08:48,250 We got code visualizer. 89 00:08:49,330 --> 00:08:52,130 Those two raised the bar even higher. 90 00:08:53,310 --> 00:08:54,950 These weren't just protectors. 91 00:08:54,950 --> 00:08:58,390 They were more like code transformers engine. 92 00:09:01,010 --> 00:09:04,270 After that, we got to phase 4. 93 00:09:04,610 --> 00:09:06,970 We got to the next level. 94 00:09:07,370 --> 00:09:14,150 And perhaps the most concerning development is the proliferation nowadays of custom VM. 95 00:09:15,390 --> 00:09:20,430 We are no longer dealing with commercial protectors. 96 00:09:21,170 --> 00:09:23,130 That we can study. 97 00:09:23,130 --> 00:09:25,110 That we can analyze. 98 00:09:25,990 --> 00:09:33,310 We are dealing with malware family that now implement their own protection. 99 00:09:34,210 --> 00:09:40,690 APT groups deploy custom protection scheme that can be analyzed with commercial tool. 100 00:09:40,690 --> 00:09:42,990 So they fail us completely. 101 00:09:43,430 --> 00:09:51,370 I've seen nation state malware with VMs that will make commercial developer jealous. 102 00:09:51,530 --> 00:09:52,370 Honestly. 103 00:09:53,630 --> 00:10:02,430 To understand why this is such a critical problem, let's examine what makes VM protection so effective. 104 00:10:02,430 --> 00:10:04,770 I call it the three headed dragon. 105 00:10:08,610 --> 00:10:12,230 The original code isn't just hidden. 106 00:10:16,310 --> 00:10:19,650 The original code isn't just hidden. 107 00:10:19,650 --> 00:10:24,310 It's completely transformed into a custom byte code. 108 00:10:25,070 --> 00:10:29,170 That exists nowhere else in the universe. 109 00:10:29,970 --> 00:10:31,950 That's frightening. 110 00:10:32,090 --> 00:10:40,050 We are dealing with custom instruction set that contain more than 200 opcodes with no documentation, no standards. 111 00:10:40,290 --> 00:10:46,470 We got polymorphic byte code generation, dynamic generation and context dependent semantics. 112 00:10:47,370 --> 00:10:50,450 Let me give you a concrete example. 113 00:10:50,850 --> 00:10:53,010 From VM protect. 114 00:10:53,290 --> 00:11:03,290 A simple instruction like the move is just one instruction representing one single memory load. 115 00:11:03,290 --> 00:11:11,490 From one instruction we get 247 instruction in the protected binary. 116 00:11:11,570 --> 00:11:16,110 This means that we have a 247 to one ratio. 117 00:11:20,100 --> 00:11:25,020 The VM itself is designed as a fortress. 118 00:11:25,720 --> 00:11:32,540 These protectors deploy an anti-analysis arsenal with over 50 techniques. 119 00:11:33,680 --> 00:11:38,040 Debugging detection include is debugger present, that is the common one. 120 00:11:38,240 --> 00:11:56,800 Debug, flag monitor, debug point detection, time based detection and everything can be actually mapped to understand what's going on at the VM . 121 00:11:56,800 --> 00:12:02,260 And if the sample is running in a safe environment for them. 122 00:12:03,640 --> 00:12:10,380 We got dynamic countermeasure that includes self modification dispatcher, the changes you analyze them. 123 00:12:11,160 --> 00:12:19,480 Code flow integrity check and exception based control flow that require symbolic execution across exception handles. 124 00:12:20,660 --> 00:12:35,780 But even if you manage to identify individual VM instruction, understanding the overall program logic require mapping the VM internals to something that should be meaningful. 125 00:12:37,180 --> 00:12:43,560 There is where even experienced analysts just give up on a certain point. 126 00:12:44,620 --> 00:12:47,480 VM register don't correspond to CPU register. 127 00:12:47,480 --> 00:12:56,740 A VM may have more than 246 virtual registers versus the 16 that we have in the x86 architecture. 128 00:12:57,000 --> 00:13:03,600 Using custom segmentation scheme and VM specific implementation, that's a nightmare. 129 00:13:03,880 --> 00:13:05,340 That's the idea. 130 00:13:06,620 --> 00:13:11,300 So when we face this threat, what we do? 131 00:13:11,300 --> 00:13:14,600 We try to forge better weapon. 132 00:13:15,060 --> 00:13:19,760 And that's what I've done with VM Dragon Slayer. 133 00:13:20,880 --> 00:13:34,400 After years hiding these dragons with stone knives and bare skin, I decided that it was time to build a proper dragon slaying weapon. 134 00:13:35,280 --> 00:13:41,080 VM Dragon Slayer represents a fundamental shift in how we approach VM. 135 00:13:41,940 --> 00:13:46,020 The core innovation lies in the analysis approach. 136 00:13:46,020 --> 00:13:52,620 We use dynamic team tracking plus symbolic execution plus machine learning. 137 00:13:52,620 --> 00:13:56,420 And we got an automated VM defecation. 138 00:13:57,600 --> 00:14:04,140 Here are some key insights on how this works and why this works. 139 00:14:04,560 --> 00:14:07,480 VM must read byte codes. 140 00:14:07,480 --> 00:14:09,680 That's our team source. 141 00:14:10,080 --> 00:14:13,160 VMs must dispatch the handler. 142 00:14:13,320 --> 00:14:16,480 And that's our control flow target. 143 00:14:16,480 --> 00:14:19,720 Handlers have semantic patterns. 144 00:14:19,760 --> 00:14:22,600 That's where symbolic analysis shines. 145 00:14:22,880 --> 00:14:27,200 Patterns are universal across protectors. 146 00:14:27,200 --> 00:14:31,880 And that's where machine learning does its job best. 147 00:14:34,920 --> 00:14:40,240 VM Dragon Slayer is built as a research framework, honestly. 148 00:14:40,500 --> 00:14:43,840 But it's built with enterprise in mind. 149 00:14:43,840 --> 00:14:46,000 So it has a modular architecture. 150 00:14:46,500 --> 00:14:48,980 Let me walk you through the system completely. 151 00:14:49,500 --> 00:14:53,440 We have a multi -platform plug-in suite supporting Ghidra. 152 00:14:53,440 --> 00:14:55,380 That is the one available today. 153 00:14:55,700 --> 00:14:59,800 We have the alpha release of IDA Pro. 154 00:15:00,260 --> 00:15:05,020 And we plan to do the same for Binary Ninja. 155 00:15:06,040 --> 00:15:12,960 This integrates with the REST API that is built on the server side. 156 00:15:13,260 --> 00:15:18,020 The core analysis engine includes the dynamic tracking using Intel pin. 157 00:15:18,020 --> 00:15:24,920 A symbolic execution with a Python implementation using Z3 and Angular. 158 00:15:25,120 --> 00:15:30,240 And a machine learning engine for pattern classification and confidence scoring. 159 00:15:30,240 --> 00:15:36,680 We also got some ZPU acceleration support for CUDA and OpenCL. 160 00:15:36,680 --> 00:15:37,680 But it's in alpha release. 161 00:15:37,680 --> 00:15:43,940 And you can make it work, but it's not really stable. 162 00:15:45,600 --> 00:15:49,560 The system includes some benchmarking and validation. 163 00:15:49,920 --> 00:15:54,680 But also it's CICD compliant. 164 00:15:54,680 --> 00:15:59,700 Means that you can use the framework in your pipeline without any issue. 165 00:15:59,700 --> 00:16:01,620 Because it's just an API. 166 00:16:03,380 --> 00:16:06,920 Let's deep dive into some of those models. 167 00:16:07,340 --> 00:16:11,360 The DTT implementation is built on Intel pin. 168 00:16:11,360 --> 00:16:13,340 With a custom Python wrapper. 169 00:16:13,800 --> 00:16:16,200 Let me show you how this works. 170 00:16:17,060 --> 00:16:24,060 The pin configuration use the custom DLL that is available in the source code. 171 00:16:24,060 --> 00:16:30,080 We are not going to cover it in detail because we are needing more than an hour just to go over there. 172 00:16:31,900 --> 00:16:34,880 With 300 second timeout. 173 00:16:35,000 --> 00:16:37,680 We define 10 source as VM by 10 second timeout. 174 00:16:37,680 --> 00:16:39,260 And we have a white code section. 175 00:16:39,820 --> 00:16:46,160 Typically for VM protect, we go for 4010 to 4050 in the other. 176 00:16:46,600 --> 00:16:50,620 The point is this is the only input that you have to take. 177 00:16:50,760 --> 00:16:52,560 We have to put into the framework. 178 00:16:52,620 --> 00:16:55,160 It's the only input that you have to get. 179 00:16:55,800 --> 00:17:00,700 Because if you put it too wide, this is going to run forever. 180 00:17:05,120 --> 00:17:11,400 Some features that we have in the DTT includes instruction level precision for memory reads. 181 00:17:11,400 --> 00:17:14,800 Automatic discovery via control flow analysis. 182 00:17:15,100 --> 00:17:17,560 Multithreaded propagation tracking. 183 00:17:17,700 --> 00:17:19,760 And real time confidence scoring. 184 00:17:20,120 --> 00:17:24,020 And this is just the DTT. 185 00:17:25,740 --> 00:17:28,240 This is how it works in practice. 186 00:17:28,240 --> 00:17:29,560 Everything is a library. 187 00:17:29,560 --> 00:17:33,740 So you can call the entire framework or you can call part of it. 188 00:17:34,680 --> 00:17:37,980 If you run it, you have just the output. 189 00:17:39,620 --> 00:17:43,680 And then the Python process it and produce the summary statistics. 190 00:17:44,220 --> 00:17:51,180 In this case for this sample, we have 47 VM discovered in 2.3 seconds. 191 00:17:51,960 --> 00:17:54,440 2,847 instruction. 192 00:17:55,320 --> 00:17:58,680 156 propagation chains identified. 193 00:17:58,680 --> 00:18:03,120 And we have a 100 percent accuracy rate for entry points. 194 00:18:04,700 --> 00:18:10,980 Our symbolic execution engine is completely implemented in Python supporting Z3. 195 00:18:12,000 --> 00:18:18,540 The configuration uses symbolic execution with a maximum depth of 100. 196 00:18:18,580 --> 00:18:21,260 Up to 1,000 concurrent paths. 197 00:18:21,340 --> 00:18:23,600 We have a timeout of 300 seconds. 198 00:18:24,140 --> 00:18:26,500 And the state merging is usually enabled. 199 00:18:26,500 --> 00:18:27,400 But you can disable it. 200 00:18:27,400 --> 00:18:29,560 It's just from configuration perspective. 201 00:18:30,040 --> 00:18:33,320 VM context modeling include program counter tracking. 202 00:18:33,320 --> 00:18:35,480 Symbolic values for registry and memory. 203 00:18:35,480 --> 00:18:39,460 And machine learning guided path prioritization. 204 00:18:40,060 --> 00:18:44,700 Path exploration because you can explore the binary that you have. 205 00:18:44,700 --> 00:18:46,720 Use machine learning guidance. 206 00:18:47,800 --> 00:18:54,940 With VM pattern weights, priority scoring for an intelligent exploration. 207 00:18:56,860 --> 00:19:00,100 Let me show you how it's implemented. 208 00:19:00,100 --> 00:19:02,260 The symbolic execution is implemented. 209 00:19:02,480 --> 00:19:06,680 The core class initialized with a path prioritizer. 210 00:19:06,980 --> 00:19:12,300 Execution queue management and configuration from the VM configuration. 211 00:19:12,420 --> 00:19:18,620 The main execution loop runs asynchronously. 212 00:19:18,620 --> 00:19:23,660 So it means that it just runs without you needing to pull it. 213 00:19:24,440 --> 00:19:26,460 Processing the execution queue. 214 00:19:27,180 --> 00:19:34,020 For each context, we get the highest priority path. 215 00:19:34,200 --> 00:19:36,600 Execute one symbolic step. 216 00:19:37,180 --> 00:19:44,940 And process result by adding terminal states to completed path and non-terminal states back to the queue. 217 00:19:45,560 --> 00:19:52,760 The path prioritizer use machine learning guided path exploration with VM pattern weights. 218 00:19:52,980 --> 00:19:59,220 We define the dispatcher access with a weight of 2.5. 219 00:19:59,320 --> 00:20:02,120 The handler entry gets a 2. 220 00:20:02,120 --> 00:20:05,820 The VM registry access gets a 1.8. 221 00:20:06,040 --> 00:20:09,340 The byte code fetch gets a 2.2. 222 00:20:09,340 --> 00:20:13,240 And the anti-analysis checks gets a 3. 223 00:20:15,670 --> 00:20:22,230 Our pattern classifier implements a multi-method approach with automatic method selection. 224 00:20:22,350 --> 00:20:29,430 The system supports rule-based classification, similarity matching, machine learning classification, and hybrid approach. 225 00:20:30,530 --> 00:20:36,870 The auto-classification logic tries rule-based first because it's fastest. 226 00:20:37,710 --> 00:20:45,010 If confidence of the rule base is below 0.8, it tries similarity matching. 227 00:20:45,010 --> 00:20:50,650 If that's below 0.7, it falls back to machine learning exploratory mode. 228 00:20:51,270 --> 00:20:54,890 The pattern database user is back to SQLite. 229 00:20:55,930 --> 00:21:06,810 The full pattern that had been added to the platform are, for instance, VM add stack, VM conditional branch, and so on. 230 00:21:08,450 --> 00:21:11,750 But that's just part of the framework. 231 00:21:11,750 --> 00:21:13,530 We also have the Guider plugin. 232 00:21:14,130 --> 00:21:16,830 Let's have a quick view of the Guider plugin. 233 00:21:17,970 --> 00:21:24,350 The Guider plugin just shows how you can interact with the framework. 234 00:21:24,350 --> 00:21:31,350 So you can define which kind of engine you want to use, which kind of confidence you can set from the framework. 235 00:21:32,450 --> 00:21:34,030 You can get the result view. 236 00:21:34,030 --> 00:21:38,210 So you have all the path, all the VM discovered, all the path, everything. 237 00:21:39,530 --> 00:21:44,890 And you have statistics over the engines that are running. 238 00:21:47,090 --> 00:21:49,290 But let's begin the hunt. 239 00:21:49,290 --> 00:21:50,890 Let's see how it works. 240 00:21:51,930 --> 00:21:56,310 Let's start with a real VM protect 3.6 sample. 241 00:21:56,890 --> 00:22:03,270 This is a commercial license validation function that contained initially 47 instructions. 242 00:22:03,470 --> 00:22:11,350 After VM protect, it became 2,847 instructions. 243 00:22:12,370 --> 00:22:14,970 A 60 to 1 ratio. 244 00:22:15,450 --> 00:22:21,210 Protection feature includes virtual machine byte code, anti debugging and so on. 245 00:22:21,710 --> 00:22:27,850 The manual analysis estimated for this sample is from three to four weeks. 246 00:22:30,530 --> 00:22:42,290 As you can see, the VM layer initialized the dynamic team tracking and launched the Intel pin with our custom DLL. 247 00:22:42,630 --> 00:22:48,630 Within seconds it detects the VM entry point with high confidence. 248 00:22:48,850 --> 00:22:54,230 The ender table is discovered and contains 51 entries. 249 00:22:54,870 --> 00:22:58,470 The symbolic execution phase starts from there. 250 00:23:00,290 --> 00:23:06,990 And ender analysis complete with 47 ender discovered and 43 analyzed. 251 00:23:07,210 --> 00:23:11,310 We have a roughly 90 percent success rate. 252 00:23:12,090 --> 00:23:21,830 The semantic operation discovered include VM load license, string compare, conditional jump and return value. 253 00:23:22,290 --> 00:23:27,810 And everything is done in roughly three minutes. 254 00:23:30,770 --> 00:23:35,790 The transformation that comes from this process is actually pretty dramatic. 255 00:23:35,970 --> 00:23:42,030 The version shows thousands online of unreadable assembly. 256 00:23:42,950 --> 00:23:46,850 The version reveals the true algorithm. 257 00:23:47,150 --> 00:23:56,330 Load license key, decrypt XOR using the key, compare with the expected value and jump if invalid, return success. 258 00:23:57,170 --> 00:24:00,070 Clear algorithm after the process. 259 00:24:00,670 --> 00:24:06,970 Just three weeks reduced to three minutes plus the analyst enrichment time. 260 00:24:06,970 --> 00:24:08,230 That's it. 261 00:24:09,890 --> 00:24:12,450 Let's analyze the second sample. 262 00:24:13,790 --> 00:24:20,670 It targets a real world bank in Trojan from an instant response case. 263 00:24:20,730 --> 00:24:29,850 This sample used completely custom VM architecture and three teams completely failed to analyze it over six months. 264 00:24:31,970 --> 00:24:39,010 VM layer in exploratory mode handles also unknown architecture. 265 00:24:39,870 --> 00:24:44,330 Automatically if it doesn't find any signature it goes. 266 00:24:45,870 --> 00:24:55,830 The custom VM implementation is discovered with a 64 entry ender table using ash base dispatch. 267 00:24:56,910 --> 00:25:12,150 It's 4K of XOR encrypted content and VM context 256 bytes and roughly 60 bit opcodes. 268 00:25:12,150 --> 00:25:18,630 Everything is being done in roughly 18 minutes. 269 00:25:21,290 --> 00:25:23,650 But there is more. 270 00:25:23,650 --> 00:25:28,330 The actual framework automatically identifies VM operation and their purpose. 271 00:25:28,430 --> 00:25:32,150 This is part of the report that the framework gave you. 272 00:25:32,550 --> 00:25:40,670 We have VM load URL that loads the URL from an encrypted config. 273 00:25:40,890 --> 00:25:52,470 We have VM hook browser that install browser API hooks using set windows hook X and plus DLL injection. 274 00:25:52,690 --> 00:25:59,410 We have VM capture creds that extract credentials from browser, chrome, firefox and ash in this case. 275 00:26:00,090 --> 00:26:10,950 And we have VM custom crypto that implements a custom CRC 32 variant that it was never seen before. 276 00:26:10,990 --> 00:26:16,890 So it was a good attribution part, technical attribution IOC. 277 00:26:17,890 --> 00:26:21,450 The intelligence value from this report is actually immense. 278 00:26:21,990 --> 00:26:25,530 The complete behavior profile extracted automatically. 279 00:26:25,530 --> 00:26:33,570 The attribution markers in custom crypto algorithm and we have the TTP that can be easily mapped to the attack framework. 280 00:26:34,090 --> 00:26:40,370 Everything being done in less than 20 minutes. 281 00:26:40,370 --> 00:26:48,010 Plus the time that the analyst needs to read the report and then reach it. 282 00:26:50,640 --> 00:26:55,660 But now let's see some more dynamic demo. 283 00:26:56,540 --> 00:27:09,170 Let me show you what happened if we load multiple samples to the platform and how we handle it. 284 00:27:09,810 --> 00:27:17,310 In this case we have three samples that are loaded through API. 285 00:27:18,070 --> 00:27:25,090 Those three samples are VM protect base and the custom VM. 286 00:27:25,430 --> 00:27:34,090 We have the first one that is actually analyzed in almost three minutes. 287 00:27:34,330 --> 00:27:47,510 And we get the actual handler number and the handler type. 288 00:27:55,040 --> 00:27:59,100 Then we have the second sample that is the one. 289 00:27:59,340 --> 00:28:02,360 It's a little bit more difficult to analyze. 290 00:28:03,180 --> 00:28:06,660 So we got some details from it. 291 00:28:08,340 --> 00:28:16,940 And some of those details are also regarding the handler and all the address of the handler and how it has been used. 292 00:28:18,000 --> 00:28:21,100 So we have DTT, a symbolic execution. 293 00:28:21,100 --> 00:28:23,980 Everything is guided through machine learning. 294 00:28:24,820 --> 00:28:27,340 The third sample is just custom VM. 295 00:28:27,340 --> 00:28:28,720 So we don't have anything. 296 00:28:28,720 --> 00:28:30,240 We don't have documentation. 297 00:28:30,240 --> 00:28:31,660 We don't have standards. 298 00:28:32,420 --> 00:28:40,120 And also in this case we got some handlers to lift the sample and try to decrypt it. 299 00:28:40,120 --> 00:28:42,360 And try to deobfuscate it. 300 00:28:47,350 --> 00:28:55,050 But let's see how it works from a statistical perspective. 301 00:28:55,710 --> 00:29:04,250 We have performed a complete evaluation and we use roughly 300 samples over 12 months. 302 00:29:04,690 --> 00:29:17,170 Those 300 samples were de-obfuscated and then we divided between 15 protected families and almost 50 malware families. 303 00:29:17,170 --> 00:29:20,670 Among those we have 25 nested samples. 304 00:29:20,670 --> 00:29:22,710 It means VM inside the VM. 305 00:29:23,690 --> 00:29:26,910 And this is the success rate of the platform. 306 00:29:27,570 --> 00:29:38,330 So we got from roughly 60 percent of manual success rate for VM protect 2.X to 84. 307 00:29:38,330 --> 00:29:44,990 And we got an overall 70 percent of success rate from different families. 308 00:29:44,990 --> 00:29:47,190 But that's not the point. 309 00:29:47,190 --> 00:29:50,570 The real improvement comes from the time. 310 00:29:50,730 --> 00:29:57,790 Because we went from two to six months in analyst time to roughly one hour. 311 00:29:57,950 --> 00:30:00,090 That's the key point. 312 00:30:00,090 --> 00:30:03,150 So we are saving analyst time. 313 00:30:03,210 --> 00:30:08,950 In this way the analyst can focus on something that is truly important for the organization. 314 00:30:09,650 --> 00:30:20,150 For instance, for example, we went from roughly $40,000 of analyst time to 50. 315 00:30:20,170 --> 00:30:22,170 That's a huge drawing. 316 00:30:24,250 --> 00:30:31,370 Let's see some case study in which we used VM Dragon Slayer. 317 00:30:31,770 --> 00:30:36,770 The case study involves a financial institution facing a bank in Troia. 318 00:30:36,890 --> 00:30:42,350 The sample used custom VM plus VM protect 3.6. 319 00:30:42,710 --> 00:30:46,810 The traditional analysis took over three months. 320 00:30:46,810 --> 00:30:48,570 Showed complete failure. 321 00:30:49,970 --> 00:30:56,890 We have a partial analysis using IDA pro and x-ray the compiler failed completely. 322 00:30:58,590 --> 00:31:03,810 We required six senior reverse engineers on the case. 323 00:31:03,810 --> 00:31:09,650 Means roughly $200,000 in analyst time. 324 00:31:09,650 --> 00:31:11,370 For four months. 325 00:31:12,510 --> 00:31:25,090 The VM Dragon Slayer took the sample and the results after three hours of analysis were 73 VM endless, 91 percent of endless classification. 326 00:31:25,210 --> 00:31:33,650 We identified seven novel evasion methods and provided full integration with a documented binary. 327 00:31:33,650 --> 00:31:38,110 Total cost, $150 roughly. 328 00:31:38,330 --> 00:31:40,590 Plus the computational resource. 329 00:31:43,480 --> 00:31:54,840 The technical breakthrough of this implementation includes the finding of a novel browser certificate bypass never been documented before. 330 00:31:55,000 --> 00:31:59,420 A polymorphic VM handler with a four hour mutation cycle. 331 00:31:59,460 --> 00:32:02,980 And a complete attack chain reconstruction for defensive development. 332 00:32:04,600 --> 00:32:06,920 That's the second case study. 333 00:32:07,460 --> 00:32:19,720 In which we analyze a batch of state sponsor generated malware that contain almost 47 implants. 334 00:32:19,720 --> 00:32:23,660 Developed all with VM protection technology. 335 00:32:24,520 --> 00:32:32,060 Traditional approach will require six analysts, mostly, 12 to 18 months to analyze everything. 336 00:32:32,080 --> 00:32:38,780 Means almost $1 million in analyst time. 337 00:32:39,420 --> 00:32:42,660 We take it in one weekend. 338 00:32:42,660 --> 00:32:52,400 So we batch it, we give them to the platform and in 48 hours we go back to the platform and we analyze the data . 339 00:32:52,400 --> 00:32:56,120 And we got 70 percent success rate across all the samples. 340 00:32:57,580 --> 00:33:08,020 The intelligence breakthrough of this analysis include infrastructure, the campaign infrastructure completely mapped. 341 00:33:09,140 --> 00:33:13,980 The code reuse pattern we find across the samples. 342 00:33:14,380 --> 00:33:23,320 And also, and this is important, the development timeline was reconstructed from VM evolution over time. 343 00:33:23,320 --> 00:33:28,300 Because we see how they change over time, the implementation of the VM. 344 00:33:28,880 --> 00:33:36,940 And this is actually a unique IOC for the specific architecture. 345 00:33:38,620 --> 00:33:42,020 But the platform is good. 346 00:33:42,320 --> 00:33:44,320 I developed it so I can say that. 347 00:33:45,100 --> 00:33:47,000 But it's imperfect. 348 00:33:48,200 --> 00:33:53,300 We have a 30 percent failure rate across challenge scenario. 349 00:33:53,660 --> 00:34:02,060 We have complex control flow that accounts for roughly 13 percent of failure. 350 00:34:02,200 --> 00:34:08,840 In some cases it's really because the sample is too complex or is too unneeded. 351 00:34:10,300 --> 00:34:15,980 And other things that cause failure is actually the resource constraint. 352 00:34:16,240 --> 00:34:22,360 Because sometimes we have individual ender that exceeding 10,000 instruction. 353 00:34:22,880 --> 00:34:26,320 Deeply nested obfuscation with more than five layer obfuscation. 354 00:34:26,320 --> 00:34:34,120 In those cases it's really difficult to have the resource to handle this kind of computational capability. 355 00:34:34,120 --> 00:34:39,280 That's why we are moving over the GPU acceleration part. 356 00:34:40,780 --> 00:34:45,880 But also some novel techniques produce some failure. 357 00:34:46,580 --> 00:34:58,440 And including a generated or quantum resistant technology that can generate some failure in the analysis process. 358 00:35:01,020 --> 00:35:02,840 But what's the future? 359 00:35:05,060 --> 00:35:14,080 The first thing that I would like to develop from year to the end of the year and I hope that someone will join me. 360 00:35:14,480 --> 00:35:19,380 It's a machine learning advancement. 361 00:35:19,560 --> 00:35:31,200 That includes transformer based classification, anomaly detection for techniques using unsupervised learning. 362 00:35:31,580 --> 00:35:35,780 Probably the idea is with three sigma deviation threshold. 363 00:35:36,760 --> 00:35:49,560 Transfer learning for cross protectors that require this knowledge, this knowledge I hope is going to require 70 percent less training data. 364 00:35:50,480 --> 00:35:59,140 The other thing that I want to develop, it's an enhancement of the plugin to be more integrated with the platform. 365 00:36:00,200 --> 00:36:07,580 In which we have a real time ender notation that is not there now, you need to do it manually unfortunately. 366 00:36:08,700 --> 00:36:12,760 Automated function naming based on semantic analysis. 367 00:36:12,760 --> 00:36:15,260 And detailed commenting with confidence score. 368 00:36:15,260 --> 00:36:17,800 But even a cooler feature. 369 00:36:18,100 --> 00:36:20,880 The cooler feature is binary rewriting. 370 00:36:21,220 --> 00:36:26,020 So you took the binary and you rewrite it in clean code. 371 00:36:26,020 --> 00:36:27,320 That's the idea. 372 00:36:27,380 --> 00:36:28,960 I think it's doable. 373 00:36:29,900 --> 00:36:34,520 I didn't have a lot of success with it I have to be honest. 374 00:36:34,520 --> 00:36:37,800 But I think it's doable in an automated way. 375 00:36:38,280 --> 00:36:48,240 In which we provide a complete pipeline with full VM structure discovery and semantic analytics, control for reconstruction and clean code generation. 376 00:36:49,760 --> 00:37:03,100 So to conclude, to wrap up what we have seen today, the VM protection actually dominates the modern malware. 377 00:37:03,100 --> 00:37:08,480 We have a lot of modern malware that use that. 378 00:37:09,740 --> 00:37:12,540 Manual analysis cannot scale. 379 00:37:14,560 --> 00:37:16,940 That's why we need automation. 380 00:37:18,120 --> 00:37:21,000 And it's not just possible, it's needed. 381 00:37:21,220 --> 00:37:22,640 It's essential. 382 00:37:24,560 --> 00:37:29,580 Hybrid approach works if you choose the right tool to do the right thing. 383 00:37:29,700 --> 00:37:32,740 Not like LLM, you use LLM for everything. 384 00:37:34,060 --> 00:37:37,820 Open source I hope is going to accelerate the process. 385 00:37:37,820 --> 00:37:42,760 Having more research on board that can help develop this kind of technology. 386 00:37:43,640 --> 00:37:47,000 Because the defender advantage is achievable. 387 00:37:47,400 --> 00:37:54,220 If you have the right tool, if you have the right techniques and if you have the right community behind it. 388 00:37:56,560 --> 00:38:01,020 VM Dragon Slayer is going to be available on github after the talk. 389 00:38:01,020 --> 00:38:03,740 Just the time to go back to the hotel. 390 00:38:05,480 --> 00:38:07,260 Add this address. 391 00:38:08,420 --> 00:38:08,480 It's going to be available on github . 392 00:38:08,480 --> 00:38:15,620 This is open source because I firmly believe in democratizing these capabilities. 393 00:38:16,440 --> 00:38:23,260 And just remember, every dragon can be slayed with the right sword. 394 00:38:23,980 --> 00:38:26,820 And the right community welding it together. 395 00:38:27,100 --> 00:38:28,320 Thank you for your time. 396 00:38:28,320 --> 00:38:29,920 I hope you enjoyed the talk. 397 00:38:32,780 --> 00:38:37,140 I'm going to stick around if you want to ask some questions. 398 00:38:37,220 --> 00:38:38,620 So I'll be around. 399 00:38:38,620 --> 00:38:39,540 Thank you.