Hi everyone. So today we are going to talk about research that we've done on a chrome extension. We researched the threat landscape and the chrome extension anatomy and we created models to detect malicious chrome extensions. So we are going to talk about the whole process that we've done from looking at the threat landscape and to train a model that can detect malicious extensions. Actually we are threat researchers. We've used, we consulted with a data scientist, Jonathan, which is sitting here. So thanks for Jonathan. So, um, I'm Tal. I'm working at Deep Instinct for the past two and a half years. Prior to Deep Instinct, I've been serving in the IDF for seven years. Hi guys, I'm Rui. Um, I've been working with Tal for the last two years and previously I worked in additional security companies and also in the IDF intelligence as well. So, um, the agenda for today. Um, so first we're going to talk about, uh, some background, uh, about, uh, browser extensions and why we decided to, uh, to work on chrome extensions specifically. Uh, after that we'll talk about the threat landscape and we will show some example of attacks that have been done using, uh, chrome extension. Um, and then we will, uh, talk about the collection of the data and, uh, creation of the data sets, uh, the sourcing of the data and, uh, ground tools that, uh, we were able to set in order to, um, to validate the data. And, uh, after that we will talk about the model, uh, that we created and, uh, we will show some, uh, three models that, uh, we tried and, uh, we'll show the results and the process that we've done. Alright, so let's quickly talk about browser extensions. Uh, first of all, what are browser extensions? I mean, uh, if we look at, you know, the Wikipedia, uh, definition we'll see it's a small software module, uh, customizing a web browser. Basically, uh, whatever we need to do to, uh, add functionalities to our browsers, uh, add, uh, advanced, uh, features we would like to have. And, um, um, other than that we see a trend today of, uh, much more services and companies, um, turning to, uh, web based products and we see that our, uh, today the browser extensions are exposed to much more standard data than before. Uh, which obviously makes it an attractive, uh, threat, uh, attack surface for hackers and attackers. So, uh, why specifically Chrome? Well, basically Chrome's the most common, uh, browser of them all. Uh, with, uh, controlling over 65% of the market as well as other browsers who also support Chrome extensions such as, uh, Edge, the new Edge browser and Oprah. Uh, which are all, um, based on the Chromium project. Other than that we can see, uh, a Cisco report from 2016 which, uh, mentioned that, um, Chrome extensions are one of the most prevalent, um, sources for data leakage in enterprises. Uh, mostly due to the fact that they are, um, undetected for long periods of times. Uh, this is just, uh, a small graph to describe the, uh, Chrome versus, uh, additional browsers as you can see from rules. Alright. So, um, there are some, uh, features, like built in features in Chrome that makes it, uh, attractive, uh, for, uh, attackers. Uh, so first it, uh, the extension can be installed, uh, through developer mode. Uh, so after, um, uh, applying the, uh, switching to developer mode browser, uh, it's, uh, it's possible to install, uh, extensions not, uh, through the Chrome web store only but also, uh, manually for example by, uh, social engineering the user or, uh, with, uh, the, uh, flag which is called the minus minus load extension that can be passed to chrome.exe. Uh, another, uh, feature is, uh, ignorance of, uh, HTTPS. So, uh, in case, uh, this flag is turned on, um, if a user surfing to, uh, website that has invalid certificate, um, the, um, like the default, uh, message of, uh, un-invalid certificate is not shown to the user. Um, uh, last, uh, feature is, uh, like, uh, it's not a feature but, uh, it's by design like, uh, an extension, um, can, uh, look at fields, uh, some sensitive fields like password fields or credit card fields without, uh, the need of special permission to be declared. Um, that's it. So, um, now we will talk a bit about, uh, the anatomy of the Chrome extension. Uh, so first Chrome extension, uh, has, uh, the file type dot CRX. So from now on we'll, uh, mention, uh, CRX as Chrome extension. Uh, so the CRX is actually a zip file, an archive file, uh, which is built as follows. Uh, so first there is the manifest file, uh, which is a JSON file that, uh, describes, uh, the most important things about the file such as, uh, the permission, uh, that the extension requires, uh, resources it uses, uh, metadata such as name, ID and stuff like that. Uh, background script. Uh, background script is, uh, like the main script, uh, which is JavaScript of the extension. Uh, this script, uh, holding the state of the extension and every event that occur. Uh, so the background script is notified and decides what to do. Uh, for example, it can triggers, uh, another content script. Uh, so now I'll talk about the content scripts. Content scripts are scripts that, uh, are made, uh, for particular web pages. Uh, it has full access to the full JavaScript API in contrast to the, uh, background script that does not have full access. Um, and it's used, uh, to manipulate, uh, as I said, uh, particular, uh, web pages. Uh, last, uh, component is just, uh, general resources that are in use, uh, in every extension such as, uh, HTML or CSS files, image, images, uh, and et cetera. Um, okay. Alright, so, uh, let's talk a bit about the threat landscape of Chrome extension malware. So, uh, 2010 if we'll go, uh, all the way back we'll see that the Chrome web store, uh, was live for the first time. Uh, a year later we're talking hundreds of millions of, uh, downloads and according to Google 200 million, uh, active users. Uh, in the couple years following, uh, there was, uh, substantial, uh, measures taken in order to, uh, prevent attackers from accessing, uh, users data. Uh, for example, we can, we, uh, we have seen several measures taken by Google for, uh, either if it's, uh, scanning, uh, each and every extension for uploading to the web store or, uh, stopping all options to, uh, natively, uh, or, uh, or secretly install extensions without using, uh, developer mode. Also, uh, they cancelled the style install and, uh, also they discontinued, for example, the, uh, Netscape plugin API which was, uh, basically allowed users to, uh, allow the attackers to access the file system and it was, uh, deprecated. In 2015 they stopped it. 2014 they stopped it. Um, a couple of years ago, obviously these measures have, uh, caused a drop in, uh, malware, uh, Chrome malware distribution. However, uh, this couple, last couple of years, specifically, uh, 2019 was the most, uh, uh, the biggest one. We saw, uh, uh, big growth in the, uh, propagation of, uh, malware, uh, malware, uh, from CRX files. And this is a graph from, uh, VirusTotal. You can see that, uh, only the first half of 2019 relative past the, uh, 2016 which was the, uh, biggest year for, uh, for Chrome malware. Also, uh, another interesting thing we've seen from VirusTotal is the, uh, um, lack of, uh, treatment into, uh, false, uh, to, um, to malware, to Chrome malware in, uh, traditional AV vendors in VirusTotal. Most, um, most extensions in VirusTotal are, um, with zero detections. Um, but, uh, so let's talk a bit about the attack surface. Um, so first, um, all the JavaScript code runs in, uh, isolated, uh, environment, uh, sandbox, uh, of, uh, Chrome. Uh, so for example, it cannot touch, uh, or get, uh, the memory of the machine or the file system, uh, without, like, uh, having an exploit. Um, what it can actually still do is everything that, uh, is related to the browser itself. For example, uh, stealing information or, uh, credentials, um, um, forming, uh, a botnet by, uh, installing extensions on, uh, different, uh, a lot of machines. Um, um, um, monetizing, like using advertisement and stuff like that. Uh, now we'll see an example of, uh, an attack, uh, that was presented in Defcon and Black Hat 2 years ago. Uh, it was called, uh, Game of Chromes. So basically what, uh, the attack was about is to create, uh, a botnet, uh, based on a Chrome extension. Um, so, uh, it was like that. Uh, the extension, uh, was injected, uh, an iframe to the Facebook, uh, page of the user, like invisible, uh, iframe and inside the iframe, uh, it, uh, it enters to, uh, it signed up to Wix and created, uh, a website in Wix. Wix is a free platform to create a website, uh, very fast. So using, uh, the Wix website, uh, the Wix website was published to all the friends of the, of the user. So all the friends of the user, uh, and, uh, by you entering to the link of the Wix webpage, other users, uh, were installing, uh, by clicking and installing, uh, the extension. The extension was spreaded. Uh, and, uh, lastly the extension rated itself in, uh, Chrome web store with five stars which, uh, just, uh, genius. Um, so that's one attack. Uh, another attack from the last month is Data Spy. Data Spy was spreaded with, uh, eight extensions for Firefox and Chrome as well. Um, and the extensions collected, uh, uh, URLs and hyperlinks and webpages, uh, titles, uh, and, uh, from, uh, all this data was, uh, sent to, uh, CNC server and, uh, the data was, uh, actually is still, uh, sold in, uh, third party websites. Uh, you can, uh, you can see the research paper, uh, and see the particular website where it's sold now. Um, why it's, uh, interesting, for example, uh, in, uh, URL, you, uh, in HTTP, uh, uh, protocol. So there are, uh, uh, past, uh, a lot of data, uh, tokens for file sharing is past the URL, uh, and, uh, the zoom meeting uses tokens and stuff like that. Okay. All right, so we're going to talk a bit about the data collection and the labeling process. So basically when, uh, sourcing, uh, for data sets such as the CRX, uh, we had several challenges such as, uh, finding reliable sources. This was, uh, highly uncommon and small and rather new threat landscape. Uh, other than that, we wanted to make sure that all files were actually, uh, in the correct format. They're actually CRX files. And of course, uh, knowing how to distinguish between the malicious and the non-malicious ones. Uh, for that we used three sources. Uh, one was the threat intelligence feed, for example, VirusTotal, threat, um, reversing labs. The other was the official Chrome web store. And last was unofficial Chrome stores, which are basically stores that, uh, crawled the official store and offered the same, uh, extensions. So we're going to talk a bit about each one. So, uh, threat intelligence feeds had the lowest amount of, uh, CRX files. Um, but they had, uh, much more, uh, quality metadata. For example, we had the AD vendors detections. We had the number of submissions, uh, when it was first uploaded, et cetera. Uh, but also had some, uh, more challenging metadata. Uh, we had, we faced a lot of, uh, missing details. We couldn't find, uh, uh, the, uh, ways to, uh, cross reference between the Chrome web store and VirusTotal, for example. Uh, also a lot of files were actually incorrectly tagged as CRX files. And in fact, uh, something like 30 percent were, were invalid even though they were tagged as CRX files. However, in the Chrome web store, obviously it's the most reliable resource, uh, to valid files. Um, but, um, they also remove malicious files. Uh, at least the one they, they are aware of. And only, they only store the most recent, uh, version of each, uh, of each extension. Um, so we, obviously we decided to refer to most files there as benign. And we, we did have, find some metadata that was useful. But as I said, it's hard to cross reference between them. Um, if we talk about the unofficial stores, so obviously this is the largest, uh, source for CRX files because it stores all previous versions, all deleted, uh, all deleted, uh, extensions. And, uh, basically everything that was ever uploaded to, uh, to the official store. Uh, but in some cases we didn't have, um, metadata to use. Only an ID or not even that in some cases. And obviously we didn't, we do not know, uh, what happened to the CRX between the store and the crawl. So, uh, we're not sure what's the trust factor for, uh, for these, uh, extensions, for these files. So just to sum it up real quick, um, so as we said, the threat intelligence feeds, uh, were actually almost the best in, in everything except quantity. Uh, so what we did was use most the official Chrome web store and the unofficial stores, um, together with the, uh, with the feeds, uh, and basically uploaded these files to, uh, to get the results we wanted and the metadata that we thought would be necessary for, for our grant. So basically, um, we decided to, to, to use, uh, five positives by AV vendors in order to, uh, decide if the file was malicious. As I said at the beginning, um, we see that not a lot of vendors even scan these files. So five is not a lot of vendors but was enough for us at least for this, uh, research, uh, model. And B9 we decided that, uh, whether, uh, files are in the official store and have zero positives after that we, we scanned in Virustool or uploaded from the unofficial stores and also received zero positives. Uh, all right, so now we'll dive into the, uh, three models that we created. Uh, something important to say is that, uh, this, this, this three models are, uh, research model. We just want to, uh, prove a point that, uh, we can, uh, it, it's possible to create a model to detect, uh, malicious, uh, Chrome extension with a good detection rate. Um, so this is slide, uh, about the overall, uh, process, uh, uh, of the creation of the model. So first is the preprocessing step. Uh, we validated the, the file that, uh, were introduced into the data set. After that, uh, we extracted from the relevant files the relevant, uh, like the features. Um, um, we ended up with a, a, a big dimensional, uh, size. So we had to, to reduce the dimensionality to the dimensional. So we first used chi-square and after that we tried another model with, uh, applying, uh, two different, uh, method, uh, like, uh, with the two steps. First chi-square and then, um, gradient boosting. Uh, we represented the, the features into numerical value with using TFIDF in order to train a model. Uh, and, uh, the models that we trained were, uh, one logistic regression model and two DNNs. Um, last thing to say about that is that, uh, we, um, we didn't try to optimize the hyperparameters since, since it's just a research model as, as I said. Sorry. All right. Um, so, uh, the pre-processing. So first we validated, uh, the files as I said. Uh, every deployed file should be CRX or ZIP. Uh, you can, uh, check it, uh, or test it by looking at the magic of the file for example. Uh, another thing, uh, to test is that, uh, each archive, uh, has a manifest, uh, dot JSON file which is a must, uh, for, uh, uh, any extension. Uh, we ended up with, uh, a bigger data set but we used, uh, 20, uh, 20,000, uh, files. 75 percents of the file, uh, of the data sets, of the data sets are, uh, uh, went for, uh, training and, uh, 25 percents, uh, for, uh, test. All right. So, uh, the feature extraction method, uh, we extracted features from the JavaScript files and from the manifest. Uh, the feature extraction method that we used, uh, was, uh, uh, looking for sequences of 4 characters or, uh, or more, um, of alphanumeric values or, uh, relevant, uh, uh, characters to JavaScript such as underscore or dollar. Uh, now we'll see an example. So let's say that, uh, we're trying to, uh, extract features, uh, using this method, uh, from this function. So these are the features that, uh, will be extracted, uh, using the features. Uh, I hope it's clear. All right. Uh, dimensionality reduction. So, uh, using the extraction method that, uh, we saw earlier, uh, we ended up with 1.1 million, uh, features which is, uh, a big amount. Uh, of course that we had to reduce the amount. So, uh, as I said, uh, we tried chi-square to reduce to, actually we tried to, uh, different, uh, numbers. Uh, we, we tried to, uh, we decided to take for this model the, uh, 10K, uh, features. And, uh, in second step, uh, we used the gradient boosting to reduce from 10K to, uh, um, to 1K. Uh, and then we presented, uh, the features into numerical value using, uh, TF-IDF as I said earlier. So, uh, here are the results, uh, of the three models. So, first, uh, the DNN model, uh, using chi-square only. Um, the results were best, were the best results, uh, out of the three models. Uh, as you can see, the recalls was, uh, uh, 99 percent and, uh, false positive rate was about, uh, 2 or 3 percent. Uh, the second DNN model using, uh, another step of, um, of XGBoost, uh, was, uh, was worse. Uh, the recall, uh, was pretty similar, but, uh, the false positive rate was much higher. Uh, the last, uh, logistic regression model using, uh, chi-square and XGBoost, uh, had, uh, the worst, uh, worst results, uh, out of these three. Uh, the false positive rate was around, uh, 30 percent, which makes it, uh, it's not a sustainable model. Uh, one thing, uh, another thing, uh, to, to note is that, uh, in general, the recall is, uh, more important, uh, for Chrome extension that, uh, the false positive rate since, uh, an average user is around 5 or 10 extensions and, uh, you wouldn't want to, like to miss the one malicious extension, uh, rather than a false positive on one of the, out of the 10, uh, which is, um, not good as well, but, uh, not, uh, not bad as, uh, missing the one malicious one. Um, um, okay, and, uh, last thing to say about this model that, uh, all of these three models were, uh, were able to detect, uh, the data spy campaign and, uh, the other one, the game of Chromes. Future, uh, research, um, so, uh, we would like to try, uh, to deobfuscate the JavaScript files before, uh, extracting the features, uh, so the extension, uh, straight landscape suffer from, uh, a lot of, uh, obfuscations, uh, on the JavaScript code, so we'd like to do some normalization and deobfuscation before we extract, um, the features. Uh, another thing to try is, uh, combine the data set to train a model with a combined data set of Chrome and Firefox extensions. Um, these, these, uh, formats and, uh, files, uh, should be similar, uh, but we didn't try to train, combine the model, uh, or tested, uh, the results on Firefox, uh, data set. Uh, and that's pretty much it. Uh, thank you very much. Um, actually we are out of time, so we'll stay, uh, all right. One question, okay? Is there any question? All right. Thank you very much.