My name is Brian Wallace. Some of you might know me as botnethunter from Twitter. And today what we're going to be talking about is machine learning and malware classification and its uses and so on. I'm now going to pass the mic along for everyone to introduce themselves from the panel. Hi there. My name is Andrew Davis. I'm a staff data scientist at Silence. My main day-to-day job is training our PE model. So I know a little bit about feature extraction and different methods like that for training PE models, disassembly, static feature extraction, starting to work a bit with dynamic feature extraction. And yeah, PE is kind of my bread and butter. I'm Rich Herring. I'm a principal data scientist at Sophos. I also work a lot on PE but also on other formats including document and HTML, particularly malicious JavaScript. My name is Hiram Anderson. I'm the technical director of data science at InGame. And I'm a technical director of data science at InGame. And I'm a technical director of data science at InGame. And I'm a technical director of data science at InGame. And I work with a great team. We have also primarily PE was our first machine learning model. But also we do macros and Mako. Hey, everyone. I'm Matt Maisel. I'm the manager of security data science at Silence. I work closely with both Andrew and Brian. And yeah, I guess my kind of interests are more in, like, again, the nearest neighbor search, if you attended the last talk, clustering, weak supervision, active learning, and basically applying those different methods to help, you know, basically perform malware classification or help with the pipeline to do malware classification at scale. And if I may, I would like to just briefly introduce Amanda Rosso, who will be joining us momentarily. She's fleeing the paparazzi and will be here when she arrives. She is, unlike everybody else on this panel, not a data scientist, but a malware reverse engineer. So I'll provide an interesting perspective there. Thank you. So we're going to start out with kind of a, you know, an easy question for all of our panelists. What do you guys believe is the current state of the art for machine learning and malware classification? Who wants to? Go ahead. You open controversy. Oh, boy. I guess I think the current state of the art for malware classification is basically applying deep neural networks, basically getting a crap ton of benign, you know, and malicious samples and basically using that to train a very large scale model. And then obviously once you have a great model, you actually have to put it in production somewhere. So whether it's on an agent or in the cloud, you know, a lot of the challenges usually come after you make the model. So, yeah, I would say deep neural networks, again, my kind of expertise isn't necessarily in the classification algorithms. So I'll probably get overturned here. But, yeah, let's kind of start off with that. Just to note, we're not talking about the static detection. We're also talking about dynamic and any sort of automated machine learning-based malware detection method. Yeah. So at Endgame, we primarily deal with static detection. There are, I think, at least two other types. There's dynamic. There's also contextual machine learning. So things, when you see a large spike in traffic, right, that to a vendor with a lot of hosts, that could indicate a new attack where you haven't actually analyzed the file. You only see, you know, data. Yeah. The number of hashes flying by, right? So in terms of static machine learning, I will respectfully disagree with my panelists. But I think that there, the way you define state-of-the-art is a Pareto curve. And there's an optimum along that curve, depending on what you want to achieve. And that depends on things like, you know, obviously, false positive, false negative trade-off. But also, think about model size. Does the model size need to live on an endpoint or does it need to live in the cloud? Or think about time required for detection. So in cases where milliseconds matter, like detecting ransomware in a dynamic case, it's often really advantageous to have a speedy, lightweight model that within a few, you know, in sub-millisecond time can determine if that's ransomware. So my belief right now for static, the determination I'd like to make a clear-cut that in my research still, there's a difference between ends-to-ends deep learning performance and parse a file first and apply model performance. That is actually highly related to the next question. And I will move along then. Yeah. So what are the different approaches for feature extraction and how do we represent malware to a model? That is, I imagine, something that's new to much of the audience. I guess I've got the mic. Yeah. So I think a lot of the stuff, as far as I'm aware, that's actually in production tends to be static artifacts. And so you can sort of, you have two different ways that you can represent it. You can either use some sort of parsing approach where you do things like you pull out section names or, sorry, you do things like you pull out section names or the entropy of individual sections. But it relies on you being able to sort of like dig in and analyze the file as a PE file. And then you also have features that don't require any parsing. So you can just get like the entropy of every consecutive 256 bytes of the file or something like that and treat that as a sequence. And you can also, there's research that's been done in convolutional and recurrent neural networks where you just feed the file in a byte at a time or you feed in chunks of the file at a time. And it just operates directly on the raw bytes of that. And so I think all of them have their pluses and minuses. There's tradeoffs in terms of how much domain knowledge you need to put into it and whether your parser will actually choke on some files and not others. And how flexible the representation is. But that's probably the key challenge in getting an effective malware model out is figuring out what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very domain specific expert knowledge required parsing features and what the right balance between these sort of very File types, dynamic, contextual. No. I mean, you're going to have different problems like Hiram said, right? You're going to have different places where you want to deploy it. You'll have different requirements for latency, for speed, for size of the model. And every one of those decisions is going to lead you to a different kind of model. Yeah, so I would definitely agree. There's probably not a single all encompassing model that would work well across all different types of malware. One of the things that I wanted to mention about the previous question about feature extraction and feature engineering is that feature extraction and feature engineering is vitally important to make sure that your model isn't abusable. If you're extracting features that don't really make sense, your model might queue in on things that it shouldn't be queuing in on. And that's not going to be a very good model. It's not going to be a robust model and adversary could find those weak points and exploit them, which kind of brings me around to why there probably isn't an all-encompassing model that would work well on all different kinds of malware because the things that you would use to do malicious things with PE are going to be different from the things that you would do to do malicious stuff with Elf or Mako or any other file format or JavaScript even. So having a single model that just queues in on, you know, yeah, TLDR, no single model. I will just note that there are corporations who do use a sort of single model model, which is a single model for all file types and have claims about that. So I would, you know, it's something that wouldn't be great. I sure hope they're using transfer learning. I sure hope they are. Yeah, it wouldn't be great. I would say the only thing I would add would be, like, you know, obviously each model would be specific to the modality, but considering, like, multimodal models where we're looking at feature spaces from static and dynamic and identity, you know, again, depending on how you source, how you're sourcing that data, how you're doing the feature extraction, I think, could change things. But each model could be trained independently. And then, again, you know, we can ensemble or build, you know, like a majority vote. You know, again, simple ways of basically combining the outputs of different models that are, you know, built for a specific task, I guess, would be what my two cents add to that. So on to the next kind of set of questions. What do you guys feel are the biggest challenges in, like, the field of detecting malware with machine learning? Yeah. So, you know, I think, you know, I think, you know, I think you're glad to have us here. You know, I would love to think about Okay. Good, good. Well, I'll start. I think, again, you can break this down into the different types, but in static detection, I think an awful lot of engines still have trouble with packed samples, right? Because packers change, it's hard to track them. The entropy and sections can vary, depending on the packing technique used. And, at the end of the day, not, you They actually use instead of sort of, you know, instead of looking inside the sample and trying to determine a string or a signature that that would indicate maliciousness. Instead, they look at artifacts that, you know, that is the smoking gun. You know, something in here is probably malicious because of the imports and all those things that can't be packed. So but that still represents, I think, a weak point for for some type of static approaches. Do you want to introduce yourself, please? Yeah. Yeah, I was actually hanging out at Maurer Tech trying to get food. But yeah, my name is Amanda Rousseau. People also know me as Maurer Unicorn. Can you see me back there? OK. I work at Endgame doing our research. I help a lot of the data scientists kind of tune the model machine learning models that we use at Endgame. And we try to look at different types of malware. And kind of see, you know, where do we need to focus our feature set on, as well as, you know, determining manual verification if something is malicious or benign. So I think we're still on the challenges, right? Yes. Challenges. Please continue the challenges. Yeah, I think the so packing and encryption is a major headache. I think the other challenge that's that's really kind of a big one is just getting a good. Labeled set for doing supervised learning. So, you know, you've got a lot of repos of stuff that's, you know, allegedly malware or mostly malware. You've got, you know, various threat intelligence feeds you can subscribe to. But a lot of the stuff in there is kind of the labels are kind of garbage, right? And you've got a lot of disagreement between vendors about whether some samples are malware or not. And so being able to get a good set of ground truth labels that you trust that you can use to then train these models in a fully supervised fashion is is kind of a constant headache. And so finding ways to refine those labels and make them more trustworthy is something that we actually spend a lot of time on. So that actually leads well. Oh, sorry. And to elaborate on that a bit, I think one of the main challenges that I see is that if you're dealing with certain kinds of file formats where you don't have a lot of labeled data, like let's take Mako, for example, you might scan. V.T. For labels or something like that, and you might come back with something like a thousand or a couple of tens of thousands of malicious Mako executables. And when it comes to training models that will generalize, well, how do you learn anything from 10,000 samples? Right. When you compare Mako to PE, for example, you might be able to get a labeled data set of several hundred million malicious PE executables. But when it comes to file formats where sort of like the way to abuse them hasn't been fully exercised like it has for PE. You know, people. People have been writing malware for PE for decades now. It's a really difficult problem to deal with. So like he said, file format is a major issue because you don't have just file format. You have Mako, Elf, whatever. You also have compiler type. So there's a lot of bootstrapping code in the beginning of a binary that can change your feature set. Say you're focused on the beginning of the binary and you're trying to design features around the malicious part of the code. But you're looking at the bootstrapping code of the compiler. So when you start to cluster PE executables based on just the PE alone, you also need to cluster them based on compiler language that they were written in. Because all of the calling conventions, even in the malware binary itself, are all different depending on the compiler and what processor it's meant to be. Same with 32-bit versus 64-bit. You're going to have different training sets for those. So you have to make sure that you have those samples in your training set that are labeled properly. I'll just add one last thing to this question. Not necessarily from the perspective of modeling itself, but from building really engineering sustainable model pipelines to support rapid experiments. Again, deploying models, getting feedback quickly, being able to make use of feedback that doesn't come through normal channels as well, too. That's a really hard problem, I think, especially when we're considering some of the data set sizes. Maybe not necessarily in the class of the imbalanced data sets, but for PE, moving that all around. That can be challenging. And again, quickly building new models, experimenting with different instances of them, and evaluating them. And then getting evaluation and getting feedback from the field can be a hard engineering problem. So we can move on to the next question now, which I think is going to be kind of interesting. Well, more interesting. So what should we do as an industry of security folk about things that are only malware? What should we do? What should we do with the malicious hands like PSExec and so forth? If anyone wants to jump in on that. Yeah, I'll bite. So I think I'm a proponent that machine learning is not a panacea. It's not a cure-all. A model should be designed with a specific focus and a question. And it can do that well. And if you kind of try to fuzzy your objective, then you'll get kind of fuzzy results. So with that in mind, I think the sort of the tools packages sometimes can be addressed better without machine learning. So looking at common rules of parent-child relationships, that should not happen. You can't discover and exploit much more easily than maybe a machine learning package could infer, for example. So I think there's a lot of room for traditional security concepts to sort of wrap what machine learning provides in a more laser-focused setting. I think just not the binary itself, but it also depends on the context. So one of the things that we focus on is adding another, I guess, feature to the set there is determining how the malware is delivered. Because if you're using a tool and it was delivered as part of a package with other malware packaged inside of a zip file, for instance, in that context, you know, it's going to be probably used maliciously. Then rather than admin using the same tool in the wrong way. So there's more outside factors to just the binary itself to determine if something is malicious or bad. Okay. So great answers, everyone. So like a lot of machine learning engines applying to malware classification generally tell whether a sample is malicious or benign. How do we feel as an industry or how could we approach naming malware through machine learning? Or is it really a problem we need to address? Well, you could build a classifier around, you know, all the VT detection labels, you know, and basically just produce labels from that or generate labels, I should say. But I think there's a lot more interesting kind of, you know, machine learning tasks here beyond just binary classification. So multi-label classification, you know, or multi-class classification could be applied here. I guess this kind of maybe goes in the realm. So just to clarify, binary classification, he means one or zero, not like... Benign or malicious. Yeah, benign or malicious, not like raw bytes. Yeah, thank you for that clarification. I think other areas too, especially because, again, I grew up in a SOC working as an incident responder. So I loved having tools that enabled me to do my hunting better or do my analysis better. So applying things like nearest neighbor search or clustering, you know, for customers and even internally, you know, I think it really helped us out. So, yeah, I guess I think there's more beyond just, again, beyond binary classification on, you know, things being malicious or benign. That could definitely help out. And maybe this gets into model explanations as well too. But I don't know if that's a question later. But I think that's also a very interesting area too, model interpretability. Yeah. On that front, that's one of the reasons why. I suppose we're so deep in on deep neural networks as opposed to some other more structured classifiers, simply because you can put a lot more flexibility into them. And so you can do things like give me something that will not just say is this malicious or benign, but is this malicious? And if it's malicious, is it malicious because it's PUA or malicious because it's a virus or malicious because it's ransomware? And you can even put things like family labels into it. So you can build a whole lot more flexibility in how you want to slice up your space of your malicious and your benign samples. And sort of enrich your output in that sense. And then also, cheap plug, black hat talk. We have found that using sort of the internal representations from these deep learning models actually is a really useful analytic tool to take a look at sort of how these different samples group together in space. And maybe suggest other clusterings that might relate more to functionality rather than to authorship similarity and things like that. So I think there's definitely, and I think we're just sort of seeing the beginning of this. There's definitely a large role for these machine learning models, not just as tools of classification, but also useful analytic tools that can be sort of handed over to people that do more conventional malware analysis to sort of assist them in this sort of virtuous cycle. And so I think as far as auto classification, taking a machine learning model. Yeah. And having it, you know, take a binary and try and predict what kind of malware family it belongs to is a pretty good idea. And a lot of people do it really well. However, I think we will always need malware analysts in the loop. We're always going to need humans to validate these results. We can't just be, you know, automatically classifying things and be asleep at the wheel. So I'm not super sure if it would be a great idea to have machine learning models that do things like automatically come up with new family names and things like that. For one thing, it may come up with something that's, you know, not entirely meaningful. And the name. Because, you know, malware family names, there's often like some, you know, joke or... Any signatures being like all over the place? Never. Yeah. But yeah, just having a human in the loop to, you know, give a specific malware family name a meaningful name is, you know, something that's always going to be important. From the malware analyst perspective, it's the data science job to help us bubble up the important things for us to resolve, right? So, you know, a lot of... Traditionally, the malware samples were identified by someone giving it a cool name and saying a children, something, you know, want to cry or something like that. But really, we, you know, if we kind of went back to the whole biology part of it, where we classify that it actually does this certain behavior or has a certain property, rather than just giving it a random name and calling it a certain class, that would help us a lot better because we would need to figure out how to get rid of the malware itself. But the only way is if we knew what type of behavior it did so we can remove it. And I think that's one of the major problems that, you know, data science tries to resolve is like there are heuristics based on behavior or properties that could be more helpful than just a generic family name that someone threw a dart on the wall and decided to name it. I'm just going to lead into the next part because we're a little bit over because we started late. What do you guys feel is the future of malware classification without burning intellectual property? Does no one want to touch that? So I think from the sort of machine learning perspective, the amount of data that's coming in like day over day is growing, you know, really fast. So there's a lot of challenges for us to overcome, just unlike the engineering and the pipeline end of things. But also being able to sort of put analysts more tightly into the loop and sort of engage that feedback loop and maybe bubble up stuff that's suspicious but hasn't been assigned like a family name or something and hand that over and get a final verdict about, yeah, is it malicious or is it benign? So being able to get more and sort of focus more on an active learning type problem where you're putting humans into the loop and you're learning how to sort of spend analyst hours most effectively to supplement and improve your machine learning I think is a really promising direction for the future. I'll just add that I think of everybody I think represented on the panel, we rely maybe to an embarrassing extent on traditional analytics. We rely on AIV to supplement our labels. Agreed. Yeah. It's a really unfortunate thing, but they also rely on each other. Yeah, yeah, yeah. Right. But these labels don't come for free. We put in human effort, but there's also automated effort in there. So one thing to think about in the future is, you know, if everybody moves to machine learning, then from whence the free labels, right? So there's a conundrum here that reliance on the human is going to become more important. And furthermore, I think that sort of, really hot research area is not in supervised learning of machine learning models, but in unsupervised and semi-supervised machine learning models where the reliance on labels diminishes. Yeah. I'm strongly in the opinion of using active learning. I'm a big fan of it. I guess just kind of go on top of that. I would say there's a really interesting project called Snorkel. It's a framework for doing weak supervision. So specifically in the case where there's labels for these different, you know, types of malware and, you know, maybe we're getting like heuristics or signatures from analysts. You know, weak supervision, the task is basically to try to combine all of those labels in a way that overall improves another model later down the road. And this project, Snorkel, I think it's Hazy Research Group. I can't remember the author's name right now, but they have a great tool. It's kind of more built around like weak supervision of images. So combining all these different labels from different kind of mechanical turks specifically for image classification, but, you know, that could be potentially extended to help with some of the problems of, you know, taking really noisy labels and also taking account of like, you know, external databases of signatures or heuristics, you know, that might be useful for influencing the model. So I'm sorry we have to stop now. We're over time. But thank you for all the panelists. Great answers to all the questions. Super happy to have you all. And thank you everyone for coming. Thank you.