1 00:00:00,000 --> 00:00:00,880 Awesome. 2 00:00:00,880 --> 00:00:02,320 Thank you, everybody. 3 00:00:02,320 --> 00:00:10,700 Next up, for our last talk, actually, at the AI Village, we have Shimon and Tal on noisy distributed distorted data sets. 4 00:00:10,900 --> 00:00:14,440 And let's all give them a round of applause. 5 00:00:22,160 --> 00:00:25,160 Well, good morning, everyone. 6 00:00:25,160 --> 00:00:29,660 And thank you all for being here on this Sunday talk. 7 00:00:30,780 --> 00:00:33,540 Actually, it's quite a nice attendance for a Sunday morning. 8 00:00:34,300 --> 00:00:37,100 We're, as presented before, Shimon and Tal. 9 00:00:37,100 --> 00:00:50,840 And we'll be talking about how we take noisy and distorted or initially noisy and distorted data sets and data sources and bring them into being excellent prediction models. 10 00:00:51,360 --> 00:00:52,940 Just a bit about ourselves. 11 00:00:52,940 --> 00:00:57,840 So as I said before, I'm Shimon, I'm the VP of research and deep learning at Deep Instinct. 12 00:00:57,840 --> 00:01:02,420 I've been working with Deep Instinct for the past three years since mid 2016. 13 00:01:02,420 --> 00:01:17,480 But overall, I have roughly 16 years of experience in cyberspace, both in offensive and defensive positions, both deep into research, but also, in recent years, more in management positions. 14 00:01:18,940 --> 00:01:21,200 So good morning, everybody. 15 00:01:21,200 --> 00:01:22,360 I'm Tal. 16 00:01:22,360 --> 00:01:29,580 Maybe some of you remember me from the talk about malicious Chrome extensions two days ago. 17 00:01:30,440 --> 00:01:34,280 So it's a big pleasure to be here again. 18 00:01:34,620 --> 00:01:38,940 I'm working at Deep Instinct as well for the past two years and a half. 19 00:01:38,980 --> 00:01:43,160 PR to Deep Instinct, I've been serving at the IDF for seven years. 20 00:01:44,940 --> 00:01:50,760 Okay, so after you know us a bit better, let's talk a bit about this talk's agenda. 21 00:01:51,140 --> 00:01:57,660 We'll start by introducing the problem that we're about to talk about in the next 40 minutes or so. 22 00:01:58,620 --> 00:02:04,320 I guess a lot of the people sitting here know that putting together excellent datasets is hard. 23 00:02:05,720 --> 00:02:11,860 It's not an easy task, and it involves a lot of knowledge, a lot of experience, a lot of trial and error. 24 00:02:12,020 --> 00:02:21,120 We'll be talking about some main problems and common issues when it comes to building those datasets. 25 00:02:21,180 --> 00:02:25,860 We'll be talking about source quality, accuracy, and diversity, and how do we evaluate those. 26 00:02:25,860 --> 00:02:35,320 We'll be talking about issues related to specific file formats and how file formats in general might affect the way that we build and engineer datasets. 27 00:02:35,320 --> 00:02:42,360 And then we'll talk about some noise and distributions and distortions error issues in threat intelligence sources. 28 00:02:42,360 --> 00:03:00,520 We'll conclude and wrap up by talking about how everything that we will be talking about drills down to the way that we conduct research into false positives and false negatives of the different models that we create. 29 00:03:00,520 --> 00:03:06,840 And we'll talk about some tips and recommendations about how to build the best datasets possible. 30 00:03:06,840 --> 00:03:07,820 Let's get started. 31 00:03:10,770 --> 00:03:11,730 All right. 32 00:03:11,730 --> 00:03:17,330 So the problem that we are trying to... we are talking about in this presentation. 33 00:03:17,650 --> 00:03:25,370 So basically the very first step at every creation of a model is building a dataset. 34 00:03:26,650 --> 00:03:38,210 The data that is used for the datasets is of course an important step in the creation of the model. 35 00:03:38,750 --> 00:03:52,810 As was stated two years ago in a presentation by Hillary Sanders, they were talking about how the data affects the results of the model that you create. 36 00:03:53,090 --> 00:04:04,670 So in this talk we would like to dive into some specific use cases and issues that we have experienced in our work, in the everyday work. 37 00:04:06,370 --> 00:04:13,750 And how these issues affect the datasets that you might build. 38 00:04:16,720 --> 00:04:22,620 So we will be talking about some sources. 39 00:04:23,480 --> 00:04:27,960 The commercial feeds such as VirusStore and Reversing Labs. 40 00:04:28,820 --> 00:04:32,400 Malware repositories like free repositories. 41 00:04:32,560 --> 00:04:37,240 And software repositories such as NSRL. 42 00:04:40,640 --> 00:04:41,360 OK. 43 00:04:41,360 --> 00:04:46,180 So I briefly mentioned before some of the main three topics. 44 00:04:46,180 --> 00:04:49,980 What we'll be showcasing in each one is as follows. 45 00:04:49,980 --> 00:04:54,820 When it comes to source quality and accuracy we'll talk about free and open malware repositories. 46 00:04:55,060 --> 00:04:58,740 They're a good thing but we also need to be careful about using them. 47 00:04:58,740 --> 00:05:01,140 We'll show why and how. 48 00:05:01,140 --> 00:05:09,720 We'll talk about sample duplications and the way that those duplications manifest in the most common threat intel feeds. 49 00:05:09,720 --> 00:05:21,780 As far as file format issues, we'll showcase how the threat landscape in two specific file formats, XLS office files or Excel office, you know what it is. 50 00:05:21,780 --> 00:05:37,640 And RTF, how the threat landscape in those two file types manifests into a very specific distribution of the files we see in the threat landscape and how that might affect the data sets and ultimately the models we'll build. 51 00:05:37,640 --> 00:05:54,200 And then moving on to noise and distortion, threat intelligence we'll show even sometimes how time distribution can be very weird and that in itself is not a desirable situation that might have pretty adverse outcomes. 52 00:05:54,200 --> 00:05:58,140 And we'll talk about two specific threat landscapes. 53 00:05:58,140 --> 00:06:04,320 One being the 64 bit PE threat landscape and the second one being the, yes even Android going into the stock. 54 00:06:04,360 --> 00:06:22,100 How these two threat landscapes have very very dense and specific distributions that also, that ultimately we might also, we might even call them a distortion of a kind and how that might affect how we, how we should build the data sets around those kind of threat landscapes. 55 00:06:22,100 --> 00:06:22,900 Let's get going. 56 00:06:25,400 --> 00:06:31,620 All right, so uh, the first category is uh, is the, is the sources. 57 00:06:31,620 --> 00:06:35,540 Uh, so uh, there are like two different kind of sources. 58 00:06:35,540 --> 00:06:38,700 Uh, the first one is the free repositories. 59 00:06:38,700 --> 00:06:40,580 Uh, and the second one is the commercial. 60 00:06:40,640 --> 00:06:44,440 Uh, we'll use uh, two use cases, different use cases. 61 00:06:44,440 --> 00:06:49,260 One from uh, free repositories and the second one is from a commercial one. 62 00:06:49,760 --> 00:06:54,000 Um, so in general, uh, start with the free repository. 63 00:06:54,000 --> 00:06:56,200 Um, every repository is welcome. 64 00:06:56,200 --> 00:07:00,240 I mean, when you, if you can get like more data, so actually it's good. 65 00:07:00,240 --> 00:07:05,400 So every time when there is like a new repository out there, uh, we are happy. 66 00:07:05,400 --> 00:07:19,080 Uh, we would like to, to take this data and to use it and to like uh, put it uh, into our uh, databases and uh, to connect it to our uh, data pipelines. 67 00:07:19,600 --> 00:07:23,180 Um, so it should be a good thing in general. 68 00:07:23,180 --> 00:07:33,520 Uh, but uh, sometimes when you, when we start looking at the data, uh, it's not as good uh, as we might expect it uh, to be. 69 00:07:34,260 --> 00:07:46,600 Uh, since a lot of uh, repositories are biased and uh, are indeed noisy, uh, which uh, create imbalances in your datasets if you take it as is. 70 00:07:48,500 --> 00:07:49,540 Alright. 71 00:07:49,560 --> 00:07:57,220 So the first use case uh, that we will be talking about is the free uh, open uh, repositories. 72 00:07:57,340 --> 00:08:00,460 Uh, there are a lot of uh, repositories out there. 73 00:08:00,460 --> 00:08:02,860 Uh, some examples are shown in the presentation. 74 00:08:02,860 --> 00:08:16,760 Uh, we took one uh, repository uh, that we are facing, we've been facing like uh, a lot of times uh, uh, we found it very used uh, by customers and by uh, researchers. 75 00:08:16,920 --> 00:08:21,480 And uh, we'd like to see what uh, what lays inside uh, these repositories. 76 00:08:21,480 --> 00:08:23,840 Uh, this specific uh, repository. 77 00:08:24,040 --> 00:08:35,400 Uh, since uh, it was really used a lot and uh, we saw that uh, in general the results that we had on this repository was not as good as uh, we are used to have. 78 00:08:35,480 --> 00:08:43,320 Um, so we took a dataset of one hundred and thirty thousand uh, samples from uh, this repository. 79 00:08:43,420 --> 00:08:49,740 Uh, uh, this repository uh, claims to be uh, containing malware only. 80 00:08:49,740 --> 00:08:53,220 Uh, so we tried to uh, answer uh, two questions. 81 00:08:53,220 --> 00:08:56,360 Uh, the first is what is the relevance of this repository? 82 00:08:56,360 --> 00:08:59,800 Like what uh, can you do with this repository? 83 00:08:59,800 --> 00:09:03,360 And the second, how uh, good the data that lays inside is? 84 00:09:03,360 --> 00:09:13,140 Or um, uh, or actually uh, is it really containing uh, only uh, malicious files as it claims? 85 00:09:13,460 --> 00:09:17,840 Uh, we have also uh, published a blog post about it so you can read about it later. 86 00:09:18,060 --> 00:09:23,720 Um, so uh, about the data that lays inside this uh, repository. 87 00:09:23,720 --> 00:09:36,000 So as you can see uh, only around uh, sixty percent are uh, were P files and uh, there was uh, like a very huge amount of files that were just actual files. 88 00:09:36,000 --> 00:09:45,020 Uh, which of course cannot harm a computer and uh, it's a bit problematic to like classify them as uh, malicious files. 89 00:09:45,080 --> 00:09:56,960 Um, and uh, of course that the data from uh, this uh, this repository cannot be- cannot be taken as is for uh, testing uh, models for example. 90 00:09:58,360 --> 00:10:16,940 Uh, but uh, we saw that the- the distribution types uh, and uh, of course that not everything is P in this repository but uh, at least uh, we hope to see that everything uh, is indeed malicious files as it claims to contain. 91 00:10:17,200 --> 00:10:33,220 Uh, so uh, we took uh, the data set and- that we created before uh, as I mentioned and uh, we tried to figure out how many uh, malicious files are indeed lays uh, lay in this uh, repository. 92 00:10:33,220 --> 00:10:44,760 Uh, we found out- we found out that there are only 56 percent uh, malware files uh, in the PE uh, section of the data set. 93 00:10:44,760 --> 00:11:05,140 Uh, we were truly amazed to see that uh, about 40 percent are PUA and around 4 uh, or 5 or uh, 3 or 4 percent were just benign files and we say benign we mean uh, pure benign files like not something that can be uh, PUA or stuff like that. 94 00:11:05,300 --> 00:11:17,740 Uh, so of course that as you can see uh, data from uh, this repository cannot uh, be taken as is for uh, testing models or uh, or training sets. 95 00:11:17,740 --> 00:11:28,160 Uh, of course that uh, one can use uh, the data from this repository uh, it's open, it's free uh, you- you should be trying to use it. 96 00:11:28,160 --> 00:11:33,260 Uh, not everybody has like uh, you know, API keys and uh, to commercial feeds. 97 00:11:33,280 --> 00:11:40,960 Uh, but uh, you cannot take it as is and you need to do some uh, engineering on the data before you take it. 98 00:11:40,960 --> 00:11:43,040 So that's the- the bottom line. 99 00:11:45,720 --> 00:11:47,780 Um, alright. 100 00:11:47,820 --> 00:11:56,500 Uh, another uh, use case that uh, we might uh, we will talk about it is uh, is from commercial feeds. 101 00:11:56,780 --> 00:12:01,160 Um, this uh, use case is the sample duplication. 102 00:12:01,160 --> 00:12:23,160 Uh, a lot of times uh, there is uh, like a specific sample that uh, is changed uh, with a few bytes inside the file and is uploaded again and uh, of course that the change uh, the change uh, makes the file has uh, a new hash and uh, and then you find uh, 103 00:12:23,160 --> 00:12:35,460 like thousands or even tens of thousands of times uh, similar files, almost the same file with a few uh, bytes that are changed uh, inside the commercial uh, repository. 104 00:12:35,480 --> 00:12:40,880 Uh, so let's talk about uh, a few examples for uh, this case. 105 00:12:40,880 --> 00:12:43,500 So the first is like polymorphic malware. 106 00:12:43,520 --> 00:12:50,960 Uh, in order to uh, like evade IOC based detection uh, that is used by a lot of vendors. 107 00:12:51,000 --> 00:13:11,320 Um, sometimes malware uh, change like something inside the file like uh, uh, uh, uh, first to, to change its hash and second to change uh, some IOCs such as file name or IP address or uh, or things that uh, vendor can uh, can sign on. 108 00:13:11,460 --> 00:13:15,820 Uh, the second use case is uh, virus uh, infected files. 109 00:13:15,820 --> 00:13:22,200 So uh, viruses in general uh, what they do is like uh, infecting a file. 110 00:13:22,200 --> 00:13:36,920 We'll see uh, in the next uh, next in the presentation we'll talk about a, a use case that uh, a virus like change something in the file, in the Microsoft file and uh, how it affects the, the data. 111 00:13:36,920 --> 00:13:41,660 Uh, and the last but not least uh, use case is the mass submissions. 112 00:13:41,660 --> 00:13:53,780 Uh, so a lot of times there are like researchers or even threat uh, actors that try to see if uh, their new, brand new malware is caught by uh, vendors. 113 00:13:53,780 --> 00:14:10,300 So they can like change a few bytes or change something in the behavior of, of their malware and upload it again to, to virus total for example and, and then we end up, we can end up with a lot of uh, duplicated samples again with different hash but very, 114 00:14:10,300 --> 00:14:12,740 very similar uh, files. 115 00:14:15,800 --> 00:14:19,940 Now let, let's back up for, for one second. 116 00:14:19,940 --> 00:14:21,200 Uh, mass submissions. 117 00:14:21,200 --> 00:14:24,400 Are we actually talking about a poisoning attack? 118 00:14:24,700 --> 00:14:32,420 Uh, we're here in the AI village and I think that poisoning attacks or attacking AI in general is one of the most discussed topics. 119 00:14:32,520 --> 00:14:44,240 So one could say uh, and, and this for the people sitting in this room this might be quite appealing or attractive even to say that wow, we're actually seeing AI poisoning attacks. 120 00:14:44,620 --> 00:14:50,160 Uh, so we actually think that this, this mass submissions use case is not exactly that. 121 00:14:50,160 --> 00:15:09,100 First of all because as we said in, in many cases uh, we see that these mass submissions are coming from users with API keys and those tend to be usually consumer, usually consumers on the defense side of these uh, um, of, of these uh, feeds and sources. 122 00:15:09,280 --> 00:15:25,320 Uh, not to say that when it comes from threat actors this is not uh, maybe also used not only for testing their own malware but also to try maybe and confuse or, or, or send you know, send researchers and send the security industry into different places. 123 00:15:25,320 --> 00:15:38,420 They want to want the, the, the, the attackers maybe don't want them to look at so they'll upload mass amounts of files and to cause you know, someone to think that you know, this is the hot stuff right now but actually they're doing something else. 124 00:15:38,420 --> 00:15:53,940 So, but still there's a difference between uh, you know, say poisoning attack and uh, just you know, doing something massive in order to, to, to, to confuse your, your enemy or your adversary. 125 00:15:53,940 --> 00:15:57,040 So we think it's more the second case than the first. 126 00:15:57,060 --> 00:16:01,620 So we're not still seeing actually targeted poisoning attacks. 127 00:16:01,620 --> 00:16:20,160 Not to say that it not, that it might not happen uh, uh, in the very, very near future but we don't think that's exactly the case as it but still taking those mass duplications in might inadvertently actually cause those mass submissions to be uh, a kind of poisoning attack. 128 00:16:20,160 --> 00:16:22,480 So that's why we chose to bring it forward here. 129 00:16:24,200 --> 00:16:32,560 Alright so uh, let's talk about a specific example of uh, uh, a malware . 130 00:16:32,560 --> 00:16:43,620 A polymorphic one uh, that uh, has been uploaded like tens of thousands of uh, uh, uh, times with uh, different hashes. 131 00:16:43,620 --> 00:16:45,860 So uh, we're talking about the Ramnit. 132 00:16:45,860 --> 00:16:51,440 Uh, Ramnit is a worm that is active for uh, more or less 7 or 8 years already. 133 00:16:51,440 --> 00:16:58,300 Uh, and as you can see in this results uh, it's uh, it has been uploaded a lot of times. 134 00:16:58,300 --> 00:17:17,580 Uh, we used uh, it's SSDIP uh, and uh, after taking this SSDIP uh, we looked at some of the samples that lays, that lay inside uh, this cluster in order to figure out if they are actually the same uh, file or not. 135 00:17:17,800 --> 00:17:28,260 So uh, as you can see we found out that uh, all these files were uh, in the size of uh, 3.5k uh, kilobytes. 136 00:17:28,480 --> 00:17:31,560 Uh, and uh, they were all DLL files. 137 00:17:31,620 --> 00:17:38,160 Um, the sections was uh, was the same uh, sections uh, by hash. 138 00:17:38,160 --> 00:17:40,780 Uh, at least 3 out of 4. 139 00:17:40,780 --> 00:17:49,700 Uh, about the, the fourth one uh, it was the data section uh, and the section uh, hash was different. 140 00:17:49,700 --> 00:17:59,700 So uh, we were interested uh, in like taking this example uh, to showcase uh, why uh, the sample duplication actually happened. 141 00:17:59,700 --> 00:18:06,960 Uh, so we looked uh, further uh, into this uh, data section in order to see what is the difference about. 142 00:18:06,960 --> 00:18:15,180 Uh, so as you can see the difference where, where was in only a few bytes, the red bytes uh, in the, in these uh, screenshots. 143 00:18:15,360 --> 00:18:27,960 Um, inside the, the data section um, uh, this few bytes uh, were uh, looking very interesting uh, because it's uh, it's actually a string . 144 00:18:27,960 --> 00:18:37,740 So we decided to, to took uh, uh, these uh, samples and to figure out like what, what these strings uh, actually used for . 145 00:18:37,740 --> 00:18:57,520 Uh, so by looking uh, uh, with IDA on these samples we were able to find out that this cluster of SSD uh, contains like a lot of uh, samples that are used to be the loader of the actual malicious uh, file. 146 00:18:57,520 --> 00:18:59,680 The actual malware ramnet. 147 00:18:59,680 --> 00:19:16,120 Uh, so as you can see the string was uh, some string dot exit uh, and this is the loader and uh, the actual file is being uh, loaded after that uh, by using the create process uh, API call. 148 00:19:20,480 --> 00:19:30,280 Okay uh, let's move on to talk a bit about issues that are very related to the format uh, of the files themselves. 149 00:19:30,280 --> 00:19:38,300 So um, before we get into it let's, let's think for a second what actually makes a file format a format. 150 00:19:38,540 --> 00:19:44,600 Um, and and what do different, how do different formats uh, ve- are different from one another. 151 00:19:44,600 --> 00:19:48,060 So formats define you know, the file's structure. 152 00:19:48,060 --> 00:19:49,320 It's header. 153 00:19:49,320 --> 00:19:55,380 The, the syntax meaning the actual binary sequence that separates between different parts of the file. 154 00:19:55,980 --> 00:20:03,400 Um, the type of data that we can find in the file whether it's a textual format or some kind of binary format. 155 00:20:03,400 --> 00:20:13,500 What kind of other data might be found uh, within the file whether it's compressed data, photos, pictures, uh, compressed data, encrypted data, etc. 156 00:20:13,500 --> 00:20:19,100 And of course different file formats uh, have different functionalities. 157 00:20:19,100 --> 00:20:19,820 Okay? 158 00:20:19,820 --> 00:20:27,580 Um, for instance you know, a PDF has it's own functionality. 159 00:20:27,580 --> 00:20:29,980 Uh, office files have their own functionalities. 160 00:20:29,980 --> 00:20:32,360 Uh, uh, PEs have their own functionality. 161 00:20:32,360 --> 00:20:34,840 They're meant to allow code to run. 162 00:20:34,840 --> 00:20:48,240 Um, the way that this uh, relates to what we're talking about here is that the threat landscape of each file format is based on that functionality and on the context in which it's being used. 163 00:20:48,260 --> 00:20:59,820 And in many cases, actually usually in most cases, attackers abuse the innate attributes and functionalities that lay in the different formats that we all use on a day to day basis. 164 00:21:00,080 --> 00:21:05,640 Uh, and use those in order to achieve their uh, their malicious intent. 165 00:21:05,660 --> 00:21:16,280 And when we say that, we mean that in many cases uh, a lot of the file formats can be uh, abused without actually you know, leveraging vulnerabilities or exploits. 166 00:21:16,280 --> 00:21:20,140 And let me give a few examples in that regard. 167 00:21:20,140 --> 00:21:27,460 When uh, someone embeds a malicious Javascript uh, regardless of what the Javascript does into a PDF file. 168 00:21:27,660 --> 00:21:32,020 Uh, so you know, having Javascript in a PDF file is not a vulnerability. 169 00:21:32,020 --> 00:21:33,040 It's a feature. 170 00:21:33,040 --> 00:21:33,860 Okay? 171 00:21:33,860 --> 00:21:42,540 Uh, even if that Javascript you know, triggers some kind of exploit, the fact that again, Javascript is supported in PDFs. 172 00:21:42,540 --> 00:21:45,820 The same goes for macros in office files, right? 173 00:21:45,820 --> 00:21:51,420 I mean having a macro is not, again it's not a vulnerability, it's a feature. 174 00:21:51,640 --> 00:22:06,020 Uh, so and if you look at every file type that can be abused and of course even looking at PEs, you know, if the PE is running, okay it might not, it might have you know, shouldn't have been there in the first place. 175 00:22:06,240 --> 00:22:09,140 But the fact that it's running, you know, that's what it does. 176 00:22:09,140 --> 00:22:09,500 It's running. 177 00:22:09,500 --> 00:22:10,900 It's running code on the machine. 178 00:22:11,000 --> 00:22:21,120 So again, all those things when you come, when you think about it, um, in many cases there isn't really any vulnerability or exploit necessary. 179 00:22:21,120 --> 00:22:24,520 Just abusing what the file format allows us to do. 180 00:22:24,740 --> 00:22:43,240 Uh, the fact that this is how the majority actually of the threat landscape behaves makes us think, uh, that we need to be very, very careful in examining how malicious files look like and how the benign files look like because we don't want these, uh, 181 00:22:43,240 --> 00:22:56,180 again, seemingly malicious but not necessarily malicious, um, you know, differences between, you know, the way malicious files look like and benign files look like to affect, uh, to affect our models. 182 00:22:56,260 --> 00:23:02,140 Uh, and let's give, uh, a few examples here to, uh, to demonstrate what we're talking about. 183 00:23:02,140 --> 00:23:17,880 The next few slides will all relate to just, uh, random, uh, recent data sets, uh, of 100K, uh, known benign files from each file type that we'll show and 100K malicious files from each file type that we'll show. 184 00:23:17,880 --> 00:23:34,920 We'll, we'll use the very, very, uh, naive, um, ground truth, uh, uh, approach here with, uh, as far as the malicious label is concerned with just anything with more than 20 engines, uh, 20 detections in either VirusTotal or other threat feeds that we have. 185 00:23:35,820 --> 00:23:38,920 So let's talk about, uh, Excel files. 186 00:23:38,920 --> 00:23:53,680 You know, uh, we don't need any kind of AI machine learning or deep learning or what have you in order to, uh, um, to have a pretty good, uh, detection mechanism for malicious Excel, uh, Excel files. 187 00:23:53,860 --> 00:24:12,620 We just can, we, we can use just one if, if condition, uh, and get, you know, 95% recall and only, again, with one if statement, it's not bad, uh, only 10% false positive if we just say, you know, if this is an Excel file and it has macro, let's deem it malicious. 188 00:24:12,700 --> 00:24:35,300 Because if you look at, you know, uh, at macro content, uh, so only, yeah, only about 10% of the benign files, uh, of benign Excel files have macros in them where, uh, you know, like on the other hand, a whopping 95% of the malicious Excel files have macros. 189 00:24:35,680 --> 00:24:42,060 Um, so, but again, do we want a model that makes, makes that distinction? 190 00:24:42,220 --> 00:24:43,100 I think not. 191 00:24:43,100 --> 00:24:52,480 Uh, especially not with a 10% false positive rate, which is, uh, again, for such a naive, uh, model, so to speak, is not bad, but obviously this is not something that we want to have. 192 00:24:52,600 --> 00:25:00,920 Um, the same goes if we look at the number of streams, uh, uh, 80% of benign Excel files have less than 10 streams. 193 00:25:00,920 --> 00:25:13,840 You know, XLS files, they're OLEs, OLEs are built, built out of streams, so 80% of the benign ones have less than 10 streams, whereas 80% of the malicious ones have anywhere between 11 to 20. 194 00:25:13,840 --> 00:25:27,480 Now, again, someone might think, wow, this is an amazing feature, because statistically, it really differentiates between the two, uh, uh, between the two, uh, between the two files, uh, or between the two, uh, you know, categories of files. 195 00:25:27,480 --> 00:25:40,780 But again, this is not something that in and of itself we want to, uh, uh, necessarily affect the decision, because then it would create a model that's very, very easily, uh, uh, evaded and by, or bypassed. 196 00:25:41,000 --> 00:26:04,460 Um, similar example looking at RTF, uh, you know, finding a benign RTF file that has, uh, an OLE object embedded in it is a, is, is, is quite a task, uh, because less than 0.5% of, uh, benign RTF files, uh, I mean, today I would think, generally speaking, 197 00:26:04,460 --> 00:26:20,620 that, you know, no RTF is benign, because who uses RTF anymore, but still, uh, uh, if you look at, uh, uh, the benign RTFs that are out there, barely any, any one of them, uh, has any kind of OLE object, but if we look at malicious RTF files, so we're talking about 70%, 198 00:26:20,620 --> 00:26:40,000 uh, more or less, uh, again, this is not something that we want to translate immediately into the models that we create and we need to engineer the data and think about, okay, so how are we actually going to generate a decent data set here, considering the fact that these are the statistics. 199 00:26:42,600 --> 00:27:00,280 Okay, now we're going to talk about some other distortions, uh, uh, and noise, um, phenomenons in threat intelligence that are not necessarily related to a specific file format, but more to a specific landscape or just to, you know, what we're seeing in threat landscape, 200 00:27:00,280 --> 00:27:01,820 in, in, in threat intel sources. 201 00:27:01,820 --> 00:27:17,100 A lot of what we'll see here lies in the fact that, you know, uh, the threat sources that we look at doesn't matter if it's the biggest threat sources, the most, you know, the most expensive one with the biggest number of files and the best coverage of the threat landscape. 202 00:27:17,100 --> 00:27:21,180 They don't reflect the reality. 203 00:27:21,280 --> 00:27:24,580 They are, they are a function of the reality. 204 00:27:24,580 --> 00:27:25,340 Okay? 205 00:27:25,420 --> 00:27:31,280 Uh, they're probably a much closer and better function, uh, of the malicious threat landscape. 206 00:27:31,600 --> 00:27:48,680 As far as the benign files that exist in the world, they obviously, uh, um, contain a fraction of what's, what's, what's really out there because, I mean, most benign files don't find their way into these, uh, uh, sources and feeds. 207 00:27:48,720 --> 00:27:55,740 Um, and, and that again, that in itself causes some kind of weird phenomenons that we'll, we'll now look at. 208 00:27:55,900 --> 00:27:58,500 The first is, uh, uh, time distribution. 209 00:27:58,540 --> 00:28:10,780 And this is, uh, uh, something that we did looking, uh, pretty much at all of the, uh, uh, PDF files found in VirusTotal, uh, from a period of six years. 210 00:28:10,780 --> 00:28:11,280 Okay? 211 00:28:11,280 --> 00:28:14,320 Between 2012 and 2017. 212 00:28:14,740 --> 00:28:24,200 Now, if you look at the distribution of these, uh, uh, of, of, of the files per month, you see, like, quite a weird phenomenon. 213 00:28:24,200 --> 00:28:40,580 You see that if we look at the beginning of the, of this time period, uh, it, it seemed like almost everything, well, not almost everything, but, uh, I mean, roughly, I don't know, two thirds, maybe even three quarters of the total PDF files you could find, 214 00:28:40,580 --> 00:28:43,080 you could find in VirusTotal were actually malicious. 215 00:28:43,500 --> 00:28:50,620 Whereas, if you look later into that time period, that tends, uh, uh, tendency seems to change. 216 00:28:50,620 --> 00:28:54,560 And, okay, now, one would say, you know, VirusTotal became so much more popular. 217 00:28:54,560 --> 00:28:57,240 I mean, you can't compare between 2012 and 2017. 218 00:28:57,760 --> 00:29:06,320 Uh, but then again, it makes you think, is this something that we want to somehow leak into our data set? 219 00:29:06,320 --> 00:29:25,720 Because if, even if we say, okay, let's just take 50 percent of the, uh, uh, benign files of all times, 50 percent of the malicious files of all times, what we'll get in, uh, in our data set is, uh, is, I mean, much more of the benign files that we would have are from the second half of that time period. 220 00:29:25,720 --> 00:29:33,620 And that, again, depending on the kind of model that you use, the kind of features that you use, um, that's something that might leak into your model. 221 00:29:33,780 --> 00:29:44,200 Uh, which is, uh, I think you'd all agree with me that, uh, creation, timestamp, and PDFs is not something that's very relevant for their classification. 222 00:29:44,440 --> 00:29:50,560 Uh, and this is something that's found in, just in, in, in clear text in pretty much every PDF out there. 223 00:29:50,760 --> 00:30:05,300 Um, this is the, the, looking again at the distribution, but just looking at absolute, uh, I mean, looking at each of the landscape and, and, and, and seeing how that specific, either the benign or the malicious landscape, uh, distribute in time. 224 00:30:05,300 --> 00:30:23,980 What we also see, and again, this comes, uh, comes back to those mass duplications we talked about before, is we're also seeing some, like, very weird and, uh, obviously out of the ordinary, uh, uh, months, uh, where suddenly, uh, there's a huge surge in the amount of, 225 00:30:23,980 --> 00:30:30,420 of malicious samples and sometimes even in the benign samples, um, that are, that you can find. 226 00:30:30,420 --> 00:30:48,120 So again, both this, uh, uh, this phenomenon, so to speak, but also this, this one with these distorted months, again, this is something that needs to be looked at because, uh, again, it, it might, if, if we just look at things randomly, it might really affect the data that we, 227 00:30:48,120 --> 00:30:52,100 uh, uh, that we put into our, uh, to our data sets. 228 00:30:55,240 --> 00:31:05,880 So, uh, uh, these, uh, statistics are, uh, talking about, uh, a data set of, uh , 64 bits PE. 229 00:31:06,240 --> 00:31:18,000 Um, so as you can see, uh, with the random data sets of 64 bits PE, there is, uh, around 90 percent of the files, uh, just, uh, dotnet assemblies files. 230 00:31:18,340 --> 00:31:32,780 Um, so again, it's, uh, it's a huge bias to dotnet assemblies and, uh, probably that this is not what you're trying to generalize the model on when you take, like , 64 bits, uh, data set. 231 00:31:32,780 --> 00:31:38,840 Uh, 45 percent of the data was just, uh, Microsoft, uh, infected files. 232 00:31:39,060 --> 00:31:46,740 Um, um, so again, there is a strong bias, uh, to a lot of Microsoft files in the malicious data set. 233 00:31:46,740 --> 00:31:49,580 Uh, probably it's not the case in the benign data set. 234 00:31:49,580 --> 00:32:02,560 So, uh, you'll find out, you, you, you end up with, uh, a benign and malicious data sets when you have more, uh, files that, uh, look like, uh, Microsoft files in your malicious, uh, data sets. 235 00:32:02,940 --> 00:32:05,500 Uh, and it might be a problem. 236 00:32:05,500 --> 00:32:19,440 So, uh, let's see, uh, an example, uh, for, uh, why, uh, there are so many, uh, malicious infected, uh, files. 237 00:32:19,440 --> 00:32:32,500 So, we, there is a specific, uh, DLL, DNS API, uh, which, uh, has been, uh, like tens of thousands of times in, in a random, uh, data set that, uh, we created. 238 00:32:32,500 --> 00:32:41,000 Uh, and, um, and we try, we try to find out, like, why there are so many DNS, uh, API infected files. 239 00:32:41,000 --> 00:32:47,040 So, uh, one concrete example is, uh, was discovered by, uh, Malwarebytes in this, uh, in this link. 240 00:32:47,380 --> 00:32:54,040 Uh, and, uh, what actually was there is, uh, like a virus that, uh , changed the host files. 241 00:32:54,040 --> 00:33:00,580 Like, uh, it, it was just patching the, the host files in order to hijack, uh, the host files. 242 00:33:00,580 --> 00:33:10,020 Uh, the host file is a file that, uh, like, uh, there is, uh, there can be configured like, uh, uh, like DNS entries. 243 00:33:10,020 --> 00:33:24,100 Uh, so every time your machine needs to, uh, like, do, uh, like, uh, it, when it needs to do, like, a DNS query, uh, so prior to the DNS query, uh, the machine checks inside the host local file. 244 00:33:24,200 --> 00:33:35,240 Uh, so by hijacking, uh, the host file, uh, the malware can control, uh, the DNS, uh, that, uh, that are served, uh, to the machine. 245 00:33:35,780 --> 00:33:48,800 And of course that, uh, as I said, uh, 45, uh, percent of, uh, Microsoft files or, uh, like Microsoft files in the malicious data set might lead easily to false positive on Microsoft files. 246 00:33:53,300 --> 00:33:59,280 Uh, another use case, uh, lays in the Android landscape. 247 00:33:59,320 --> 00:34:11,340 Uh, so APK, uh, of course, uh, I guess that you know, uh, is an Android package, uh, like, uh, an archive, uh, that contains, uh, the resources and the stuff for an application. 248 00:34:11,340 --> 00:34:18,560 Uh, so there are a lot of, uh, malicious files in the threat landscape of, uh, Android. 249 00:34:18,560 --> 00:34:38,540 Uh, there are ransomware for, uh, Android, uh, spyware, uh, a lot of differences of, uh, PUA, uh, but also there is, uh, a specific type of, uh, of malware, uh, premium SMS, like, uh, an application that, uh, what it does is just like, uh, sending SMS, 250 00:34:38,540 --> 00:34:49,500 uh, messages from, uh, from users in order to monetize it, uh, and to, like, pay money from, by the user to the, to the attacker. 251 00:34:50,420 --> 00:35:02,300 Uh, so we created, uh, again, a random, uh, data set, uh, and we were looking at, uh, the families, uh, of the malware, uh, that lays, uh, that lay inside the data set. 252 00:35:02,300 --> 00:35:08,060 So, as you can see, we looked at, uh, the, the 3 top, uh, families. 253 00:35:08,060 --> 00:35:19,700 All the 3 top families, uh, are, uh, composed, uh, are, uh, like, uh, taking, uh, around, uh, 37 percent of the data set, and all of them were, uh, premium SMS. 254 00:35:19,700 --> 00:35:31,820 So, again, uh, here is another use case of, uh, strong bias to something that we probably didn't want, like, the model, like, the, the APK data set to be, uh, biased to. 255 00:35:31,820 --> 00:35:45,180 Like, we probably wanted it to be, um, more, uh, like, uh, presenting the, the real, uh, types of, like, malicious APK data, data router. 256 00:35:48,870 --> 00:35:49,670 All right. 257 00:35:49,670 --> 00:36:00,310 So, uh, now we'll, uh, conclude and, uh, we will, uh, like, uh, show you, like, uh, also we'll say, we'll talk about some takeaways from this presentation. 258 00:36:00,310 --> 00:36:16,590 But, uh, first I'll start with, uh, like, uh, a process that, uh, we are doing post-training and, uh, can be taken and, uh, applied, uh, like, it's an, uh, process or an attitude that you can take and apply after that, uh, post-training, uh, for your models. 259 00:36:16,610 --> 00:36:21,430 Uh, so, uh, first you need to identify, like, a pattern, a specific pattern. 260 00:36:21,430 --> 00:36:26,390 For example, uh, as I said earlier, uh, let's take, uh, for example, a P model. 261 00:36:26,390 --> 00:36:35,810 So you, if the data set was biased as, uh, we've seen earlier, so maybe you might have false positive on Microsoft files. 262 00:36:36,110 --> 00:36:41,930 Uh, then, uh, what you need to do is, like, going back to your data set. 263 00:36:41,930 --> 00:36:49,430 Uh, the reason is to, to look at the training set that the model was generalize, generalize, generalize done, sorry. 264 00:36:49,810 --> 00:36:51,250 Generated from, yeah. 265 00:36:52,650 --> 00:37:07,630 Uh, uh, in order to, like, uh, examine the, the pattern appearance, uh, to see, uh, how it, uh, how it's distributed inside a benign data set, uh, and a malicious data set in the training set. 266 00:37:08,010 --> 00:37:28,070 Uh, sometimes you can go even further and, uh, look at, uh, the feature level and, uh, like, trying to create, uh, like, what is the combination of features that, uh, makes your, uh, makes this file or this, uh, uh, collection of files, uh, look like, 267 00:37:28,070 --> 00:37:33,930 uh, a malicious file for, uh, for the model, uh, leads to false positive, of course. 268 00:37:34,550 --> 00:37:37,490 Uh, and by that, uh, you need to understand the meaning. 269 00:37:37,490 --> 00:37:46,170 So, for example, in the collection earlier that I described, you, uh, might, uh, call it, like, Microsoft files or a DNS API DLL file. 270 00:37:46,490 --> 00:37:56,350 Uh, the last step is, like, uh, adjusting and engineering, uh, the feature distribution or the pattern distribution inside the training set. 271 00:38:00,110 --> 00:38:17,970 Uh, so Tal just talked about, uh, you know, uh, how, uh, how, uh, uh, how, uh, we might use all the, all the data that we've shown here in the false positive or for the false negative research, uh, um, phase that, again, usually occurs post-training, whether it's when you still, 272 00:38:17,970 --> 00:38:36,790 whether it's when you're still, you know, testing and evaluating your, uh, newly created model or even if it's, you know, and for the folks here that are coming from, you know, AI-based, uh, from AI vendors or from next-gen vendors or whatever or the legacy ones that are now using machine learning as well. 273 00:38:36,990 --> 00:38:41,970 Uh, uh, you can do it on, of course, on your production data. 274 00:38:41,970 --> 00:38:46,050 Okay, so false, false positives and false negatives that occur in production. 275 00:38:46,050 --> 00:39:01,190 But, uh, a lot of what we talked about, uh, comes back to, you know, what we do pre-training and, again, how we build and engineer the best data sets possible that will ultimately, uh, enable us to create the best models possible. 276 00:39:01,190 --> 00:39:11,930 And those are some of the, uh, uh, the, you know, the do's, so to speak, uh, or, or the recommendations that we have, uh, uh, based on what we've seen. 277 00:39:11,930 --> 00:39:23,190 Uh, the first is, you know, we need to really understand the threat landscape and whatever is the problem that you're trying to solve and think about how it might affect the data. 278 00:39:23,710 --> 00:39:25,770 Uh, because it might affect the data. 279 00:39:25,770 --> 00:39:36,210 You need to really differentiate between, uh, uh, again, those innate features or, uh, uh, features in the general term of features, not in model features. 280 00:39:36,530 --> 00:39:43,410 Uh, uh, but, but the features in the file format or, or the functionality of the file format, how that's abused in the threat landscape. 281 00:39:43,790 --> 00:39:53,070 And, of course, what's, you know, not really an abuse of the format, but something that's, you know, uh, again, a vulnerability or an exploit that, that, that could be leveraged. 282 00:39:53,070 --> 00:40:00,430 Those things will manifest differently in, uh, the, the, in, in your benign data sets and your, and your malicious data sets. 283 00:40:00,430 --> 00:40:06,670 And you need to think about caref- you need to think about that carefully and understand that before you go about building your data sets. 284 00:40:07,170 --> 00:40:19,050 Uh, another, uh, another thing that, that, that we, that we want to mention is, again, different file formats, uh, behave and distribute very, very, very differently from one another. 285 00:40:19,190 --> 00:40:29,890 Sometimes, uh, it's, uh, you could see that in, um, even in, uh, in, in formats that are very, very closely related. 286 00:40:29,890 --> 00:40:35,810 Let's say, PEs, 32-bit and 64-bit don't look the same, don't behave the same. 287 00:40:35,810 --> 00:40:57,830 Uh, at least as far as their, their distribution threat landscape, uh, is concerned, um, and, and, and again, this goes also to different types of document files or even if we look at even more specific packages, uh, or formats like OLEs, so again, doc files and Excel files and PowerPoint files don't distribute, 288 00:40:57,830 --> 00:41:01,410 uh, uh, the same although their format is the same one. 289 00:41:01,470 --> 00:41:17,270 Uh, one of the most important takeaways, uh, we believe is that, uh, we all need to very carefully examine the raw data that, uh, uh, that we take and, uh, examine its, its, its distribution. 290 00:41:17,370 --> 00:41:31,570 Meaning, okay, uh, of course, I, I believe we all, you know, normally try to, you know, build the biggest data sets possible, uh, with respect to, you know, whatever we can find or how big the, the, the available data is. 291 00:41:31,570 --> 00:41:36,190 And if, and sometimes it's a question of, of the resources and, and, and computation that we have at hand. 292 00:41:36,390 --> 00:41:48,490 But, uh, uh, of course, you know, uh, yes, a good approach is starting from as big as possible, but then, uh, really examining the distribution and making sure that it seems reasonable. 293 00:41:49,090 --> 00:42:06,790 Um, noise and distortion can be found somewhere in the most, can be sometimes found in the most unexpected of places, like time distribution, uh, with really just, you know, weird, uh, uh, weird phenomenons of like months where, you know, PDF was the king of the malware or whatever, 294 00:42:06,790 --> 00:42:08,830 but, uh, it's not actually the case. 295 00:42:08,830 --> 00:42:14,570 And usually it is some kind of distortion that you better if, if, if you clean it out. 296 00:42:14,790 --> 00:42:19,750 Now, in a lot of what we've mentioned here, there's no, you know, there are no textbook recipes. 297 00:42:19,750 --> 00:42:20,150 Okay. 298 00:42:20,150 --> 00:42:31,690 Uh, but as we all know, well thought of trial and error is our best friend, uh, in many cases and, and, and, and applying AI and to, into the field we're in. 299 00:42:31,850 --> 00:42:36,410 So, and this is the part where, you know, data science is a bit of an art as well. 300 00:42:36,470 --> 00:42:57,870 Uh, uh, yes, of course there will be more files with, uh, uh, macros in a malicious, uh, Excel, um, data set, but whether we want to have that exact distribution the way it is, if we look at the raw data, uh, our recommendation is no, uh, uh, engineer that, 301 00:42:57,870 --> 00:43:07,610 uh, that somehow differently in what way, whether you do it with over sampling or with, you know, uh, compromising for a smaller data set with a different distribution. 302 00:43:07,610 --> 00:43:23,930 Again, that lies, that depends on, on everybody sitting here and your peers and colleagues, but, um, we recommend that you again, look at the things and, uh, you know, do your trial and error and see, uh, uh, and see what's best different models, different, 303 00:43:23,930 --> 00:43:27,990 you know, feature spaces, different file formats, different threat landscape. 304 00:43:28,150 --> 00:43:31,930 The solution for them is, is quite different. 305 00:43:32,650 --> 00:43:35,070 This pretty much concludes, uh, our talk. 306 00:43:35,070 --> 00:43:38,370 Thank you all very much for listening and we'll be happy to take any questions if there are. 307 00:44:05,390 --> 00:44:10,790 In a way, but the question is, what is your bias? 308 00:44:11,310 --> 00:44:15,970 And how, uh, and again, what's the problem you're trying to solve? 309 00:44:16,070 --> 00:44:29,650 Sometimes that problem might be, if you are at the very, very early stage, how do I build the best model that generalizes on the right things and not on distribution of, of, of the threat landscape as it is? 310 00:44:29,650 --> 00:44:32,770 Because that might lead to adverse results. 311 00:44:32,770 --> 00:44:47,110 And sometimes in order to fix something that you already find to be problematic, a specific pattern that consistently is causing false positives or false negatives, and then our recommendation is go back to your data. 312 00:44:47,110 --> 00:44:51,430 Sometimes the problem is not in, sometimes the problem is not algorithmic. 313 00:44:51,430 --> 00:44:53,070 It's not in your feature space. 314 00:44:53,070 --> 00:44:57,750 It's not in your, you know, model architecture or the specific algorithm you chose. 315 00:44:57,770 --> 00:45:00,450 Sometimes the problem simply lies. 316 00:45:00,450 --> 00:45:05,450 It might not be as simple to solve it, but the problem lies in the data itself. 317 00:45:06,710 --> 00:45:07,550 Yeah, sure. 318 00:45:08,070 --> 00:45:10,290 Just want to add something. 319 00:45:10,690 --> 00:45:18,010 Uh, the issue is that, uh, it's, it's when you create a dataset, it's not possible to find out like all the, these biases. 320 00:45:18,330 --> 00:45:31,670 So in many cases you just, you know, after seeing some production environment or like after tackling and using the model for a, for a period, uh, you, you find out these patterns and these biases. 321 00:45:31,730 --> 00:45:36,650 So that's the point that it's not always, um, so easy to find them out. 322 00:45:37,270 --> 00:45:38,310 Yeah. 323 00:45:51,480 --> 00:45:53,800 This, this is a great question. 324 00:45:53,800 --> 00:45:57,580 Uh, the answer is yes, but it's, uh, I'll repeat the question. 325 00:45:57,580 --> 00:46:03,140 Did we try to, uh, come up with some kind of metric to build datasets or to balance them? 326 00:46:03,140 --> 00:46:06,300 Uh, the, the, the, the short answer is yes. 327 00:46:06,300 --> 00:46:20,100 The longer answer is yes, but it's way out of scope for this talk and for 45 minutes because it's just, it's so, um, um, it's just, it's so different between different file types and different formats and different threat landscape. 328 00:46:20,100 --> 00:46:22,120 So again, there's no textbook recipe. 329 00:46:22,120 --> 00:46:31,020 And it also, I mean, what we've done is, you know, is good for our approach, for our models, for the way that we work, for our infrastructure and framework. 330 00:46:31,020 --> 00:46:42,000 It might be very, very different for other researchers, for other companies that use intrinsically different approaches, algorithms, models, data sources, et cetera. 331 00:46:42,000 --> 00:46:45,480 So, and, and in that sense, what we said, there's no textbook recipe. 332 00:46:45,480 --> 00:46:47,440 If there was one, we, we'd share it. 333 00:46:52,100 --> 00:46:53,280 Thank you all.