[00:00.000 --> 00:11.660] Hi everyone. So today we are going to talk about research that we've done on a chrome [00:11.660 --> 00:22.480] extension. We researched the threat landscape and the chrome extension anatomy and we [00:22.480 --> 00:29.980] created models to detect malicious chrome extensions. So we are going to talk about [00:30.300 --> 00:38.280] the whole process that we've done from looking at the threat landscape and to train a model [00:38.280 --> 00:46.860] that can detect malicious extensions. Actually we are threat researchers. We've used, we [00:46.860 --> 00:55.420] consulted with a data scientist, Jonathan, which is sitting here. So thanks for Jonathan. [00:58.220 --> 01:06.180] So, um, I'm Tal. I'm working at Deep Instinct for the past two and a half years. Prior to [01:06.180 --> 01:13.520] Deep Instinct, I've been serving in the IDF for seven years. Hi guys, I'm Rui. Um, I've [01:13.520 --> 01:18.160] been working with Tal for the last two years and previously I worked in additional security [01:18.160 --> 01:28.110] companies and also in the IDF intelligence as well. So, um, the agenda for today. Um, [01:28.770 --> 01:34.890] so first we're going to talk about, uh, some background, uh, about, uh, browser extensions [01:34.890 --> 01:40.810] and why we decided to, uh, to work on chrome extensions specifically. Uh, after that we'll [01:40.810 --> 01:46.250] talk about the threat landscape and we will show some example of attacks that have been done [01:46.250 --> 01:53.470] using, uh, chrome extension. Um, and then we will, uh, talk about the collection of the data [01:53.470 --> 01:59.850] and, uh, creation of the data sets, uh, the sourcing of the data and, uh, ground tools that, [01:59.850 --> 02:07.830] uh, we were able to set in order to, um, to validate the data. And, uh, after that we will talk [02:07.830 --> 02:14.170] about the model, uh, that we created and, uh, we will show some, uh, three models that, uh, we [02:14.170 --> 02:22.130] tried and, uh, we'll show the results and the process that we've done. Alright, so let's [02:22.130 --> 02:27.990] quickly talk about browser extensions. Uh, first of all, what are browser extensions? I mean, [02:27.990 --> 02:32.190] uh, if we look at, you know, the Wikipedia, uh, definition we'll see it's a small software [02:32.190 --> 02:38.010] module, uh, customizing a web browser. Basically, uh, whatever we need to do to, uh, add [02:38.010 --> 02:43.170] functionalities to our browsers, uh, add, uh, advanced, uh, features we would like to have. [02:43.170 --> 02:51.070] And, um, um, other than that we see a trend today of, uh, much more services and companies, um, [02:51.070 --> 02:56.610] turning to, uh, web based products and we see that our, uh, today the browser extensions are [02:56.610 --> 03:02.690] exposed to much more standard data than before. Uh, which obviously makes it an attractive, uh, [03:02.690 --> 03:10.050] threat, uh, attack surface for hackers and attackers. So, uh, why specifically Chrome? Well, [03:10.050 --> 03:16.030] basically Chrome's the most common, uh, browser of them all. Uh, with, uh, controlling over 65% [03:16.030 --> 03:21.970] of the market as well as other browsers who also support Chrome extensions such as, uh, Edge, [03:21.970 --> 03:28.170] the new Edge browser and Oprah. Uh, which are all, um, based on the Chromium project. Other than [03:28.170 --> 03:34.710] that we can see, uh, a Cisco report from 2016 which, uh, mentioned that, um, Chrome extensions [03:34.710 --> 03:42.410] are one of the most prevalent, um, sources for data leakage in enterprises. Uh, mostly due to [03:42.410 --> 03:49.630] the fact that they are, um, undetected for long periods of times. Uh, this is just, uh, a small [03:49.630 --> 03:54.590] graph to describe the, uh, Chrome versus, uh, additional browsers as you can see from [03:54.590 --> 04:04.430] rules. Alright. So, um, there are some, uh, features, like built in features in Chrome that [04:04.430 --> 04:10.590] makes it, uh, attractive, uh, for, uh, attackers. Uh, so first it, uh, the extension can be [04:10.590 --> 04:17.030] installed, uh, through developer mode. Uh, so after, um, uh, applying the, uh, switching to [04:17.030 --> 04:22.810] developer mode browser, uh, it's, uh, it's possible to install, uh, extensions not, uh, [04:22.810 --> 04:28.630] through the Chrome web store only but also, uh, manually for example by, uh, social [04:28.630 --> 04:35.170] engineering the user or, uh, with, uh, the, uh, flag which is called the minus minus load [04:35.170 --> 04:42.930] extension that can be passed to chrome.exe. Uh, another, uh, feature is, uh, ignorance of, uh, [04:42.930 --> 04:53.410] HTTPS. So, uh, in case, uh, this flag is turned on, um, if a user surfing to, uh, website that has [04:53.410 --> 05:03.010] invalid certificate, um, the, um, like the default, uh, message of, uh, un-invalid certificate is [05:03.010 --> 05:10.770] not shown to the user. Um, uh, last, uh, feature is, uh, like, uh, it's not a feature but, uh, it's [05:10.770 --> 05:19.130] by design like, uh, an extension, um, can, uh, look at fields, uh, some sensitive fields like [05:19.130 --> 05:25.090] password fields or credit card fields without, uh, the need of special permission to be [05:25.090 --> 05:32.990] declared. Um, that's it. So, um, now we will talk a bit about, uh, the anatomy of the [05:33.010 --> 05:40.210] Chrome extension. Uh, so first Chrome extension, uh, has, uh, the file type dot CRX. So from now [05:40.210 --> 05:46.170] on we'll, uh, mention, uh, CRX as Chrome extension. Uh, so the CRX is actually a zip file, an [05:46.170 --> 05:52.490] archive file, uh, which is built as follows. Uh, so first there is the manifest file, uh, which [05:52.490 --> 05:58.730] is a JSON file that, uh, describes, uh, the most important things about the file such as, uh, [05:58.730 --> 06:06.370] the permission, uh, that the extension requires, uh, resources it uses, uh, metadata such as [06:06.370 --> 06:13.510] name, ID and stuff like that. Uh, background script. Uh, background script is, uh, like the [06:13.510 --> 06:19.850] main script, uh, which is JavaScript of the extension. Uh, this script, uh, holding the state [06:19.850 --> 06:27.310] of the extension and every event that occur. Uh, so the background script is notified and [06:27.310 --> 06:35.010] decides what to do. Uh, for example, it can triggers, uh, another content script. Uh, so now [06:35.010 --> 06:40.890] I'll talk about the content scripts. Content scripts are scripts that, uh, are made, uh, for [06:40.890 --> 06:48.870] particular web pages. Uh, it has full access to the full JavaScript API in contrast to the, uh, [06:48.870 --> 06:54.990] background script that does not have full access. Um, and it's used, uh, to manipulate, uh, as [06:54.990 --> 07:01.730] I said, uh, particular, uh, web pages. Uh, last, uh, component is just, uh, general resources [07:01.730 --> 07:10.310] that are in use, uh, in every extension such as, uh, HTML or CSS files, image, images, uh, and [07:10.310 --> 07:18.090] et cetera. Um, okay. Alright, so, uh, let's talk a bit about the threat landscape of Chrome [07:18.090 --> 07:24.610] extension malware. So, uh, 2010 if we'll go, uh, all the way back we'll see that the Chrome [07:24.610 --> 07:29.670] web store, uh, was live for the first time. Uh, a year later we're talking hundreds of millions [07:29.670 --> 07:36.150] of, uh, downloads and according to Google 200 million, uh, active users. Uh, in the couple [07:36.150 --> 07:42.570] years following, uh, there was, uh, substantial, uh, measures taken in order to, uh, prevent [07:42.570 --> 07:48.650] attackers from accessing, uh, users data. Uh, for example, we can, we, uh, we have seen [07:48.650 --> 07:53.450] several measures taken by Google for, uh, either if it's, uh, scanning, uh, each and every [07:53.450 --> 08:00.650] extension for uploading to the web store or, uh, stopping all options to, uh, natively, uh, or, [08:00.650 --> 08:04.950] uh, or secretly install extensions without using, uh, developer mode. Also, uh, they [08:04.950 --> 08:10.770] cancelled the style install and, uh, also they discontinued, for example, the, uh, Netscape [08:10.770 --> 08:17.550] plugin API which was, uh, basically allowed users to, uh, allow the attackers to access the [08:17.550 --> 08:23.090] file system and it was, uh, deprecated. In 2015 they stopped it. 2014 they stopped it. [08:23.790 --> 08:30.970] Um, a couple of years ago, obviously these measures have, uh, caused a drop in, uh, malware, [08:31.350 --> 08:36.690] uh, Chrome malware distribution. However, uh, this couple, last couple of years, specifically, [08:36.690 --> 08:43.950] uh, 2019 was the most, uh, uh, the biggest one. We saw, uh, uh, big growth in the, uh, [08:43.950 --> 08:50.810] propagation of, uh, malware, uh, malware, uh, from CRX files. And this is a graph from, uh, [08:50.810 --> 08:57.470] VirusTotal. You can see that, uh, only the first half of 2019 relative past the, uh, 2016 [08:57.470 --> 09:04.470] which was the, uh, biggest year for, uh, for Chrome malware. Also, uh, another interesting [09:04.470 --> 09:10.750] thing we've seen from VirusTotal is the, uh, um, lack of, uh, treatment into, uh, false, [09:10.750 --> 09:16.970] uh, to, um, to malware, to Chrome malware in, uh, traditional AV vendors in VirusTotal. [09:16.970 --> 09:29.070] Most, um, most extensions in VirusTotal are, um, with zero detections. Um, but, uh, so let's [09:29.070 --> 09:36.810] talk a bit about the attack surface. Um, so first, um, all the JavaScript code runs in, uh, [09:36.810 --> 09:44.370] isolated, uh, environment, uh, sandbox, uh, of, uh, Chrome. Uh, so for example, it cannot [09:44.370 --> 09:50.270] touch, uh, or get, uh, the memory of the machine or the file system, uh, without, like, uh, [09:50.270 --> 09:59.570] having an exploit. Um, what it can actually still do is everything that, uh, is related to the [09:59.570 --> 10:08.310] browser itself. For example, uh, stealing information or, uh, credentials, um, um, forming, [10:08.310 --> 10:14.350] uh, a botnet by, uh, installing extensions on, uh, different, uh, a lot of machines. Um, [10:14.370 --> 10:22.350] um, um, monetizing, like using advertisement and stuff like that. Uh, now we'll see an example [10:22.350 --> 10:28.250] of, uh, an attack, uh, that was presented in Defcon and Black Hat 2 years ago. Uh, it was [10:28.250 --> 10:34.530] called, uh, Game of Chromes. So basically what, uh, the attack was about is to create, uh, a [10:34.530 --> 10:41.990] botnet, uh, based on a Chrome extension. Um, so, uh, it was like that. Uh, the extension, uh, [10:41.990 --> 10:49.370] was injected, uh, an iframe to the Facebook, uh, page of the user, like invisible, uh, iframe [10:49.370 --> 10:59.730] and inside the iframe, uh, it, uh, it enters to, uh, it signed up to Wix and created, uh, a [10:59.730 --> 11:06.290] website in Wix. Wix is a free platform to create a website, uh, very fast. So using, uh, the [11:06.290 --> 11:11.970] Wix website, uh, the Wix website was published to all the friends of the, of the user. So [11:11.990 --> 11:17.970] all the friends of the user, uh, and, uh, by you entering to the link of the Wix webpage, other [11:17.970 --> 11:24.610] users, uh, were installing, uh, by clicking and installing, uh, the extension. The extension [11:24.610 --> 11:31.170] was spreaded. Uh, and, uh, lastly the extension rated itself in, uh, Chrome web store with [11:31.170 --> 11:39.830] five stars which, uh, just, uh, genius. Um, so that's one attack. Uh, another attack from the [11:39.830 --> 11:45.790] last month is Data Spy. Data Spy was spreaded with, uh, eight extensions for Firefox and [11:45.790 --> 11:55.550] Chrome as well. Um, and the extensions collected, uh, uh, URLs and hyperlinks and webpages, uh, [11:55.550 --> 12:03.490] titles, uh, and, uh, from, uh, all this data was, uh, sent to, uh, CNC server and, uh, the [12:03.490 --> 12:09.810] data was, uh, actually is still, uh, sold in, uh, third party websites. Uh, you can, uh, [12:09.830 --> 12:18.130] you can see the research paper, uh, and see the particular website where it's sold now. Um, [12:18.130 --> 12:27.650] why it's, uh, interesting, for example, uh, in, uh, URL, you, uh, in HTTP, uh, uh, protocol. [12:27.650 --> 12:35.350] So there are, uh, uh, past, uh, a lot of data, uh, tokens for file sharing is past the URL, uh, [12:35.350 --> 12:42.310] and, uh, the zoom meeting uses tokens and stuff like that. Okay. All right, so we're going to [12:42.310 --> 12:47.770] talk a bit about the data collection and the labeling process. So basically when, uh, [12:47.770 --> 12:54.870] sourcing, uh, for data sets such as the CRX, uh, we had several challenges such as, uh, [12:54.870 --> 13:00.390] finding reliable sources. This was, uh, highly uncommon and small and rather new threat [13:00.390 --> 13:05.750] landscape. Uh, other than that, we wanted to make sure that all files were actually, uh, in the [13:05.750 --> 13:10.850] correct format. They're actually CRX files. And of course, uh, knowing how to distinguish [13:10.850 --> 13:16.790] between the malicious and the non-malicious ones. Uh, for that we used three sources. Uh, one [13:16.790 --> 13:21.870] was the threat intelligence feed, for example, VirusTotal, threat, um, reversing labs. The [13:21.870 --> 13:26.570] other was the official Chrome web store. And last was unofficial Chrome stores, which are [13:26.570 --> 13:32.030] basically stores that, uh, crawled the official store and offered the same, uh, extensions. So [13:32.030 --> 13:37.090] we're going to talk a bit about each one. So, uh, threat intelligence feeds had the lowest [13:37.090 --> 13:45.270] amount of, uh, CRX files. Um, but they had, uh, much more, uh, quality metadata. For [13:45.270 --> 13:50.410] example, we had the AD vendors detections. We had the number of submissions, uh, when it was [13:50.410 --> 13:57.410] first uploaded, et cetera. Uh, but also had some, uh, more challenging metadata. Uh, we had, we [13:57.410 --> 14:03.410] faced a lot of, uh, missing details. We couldn't find, uh, uh, the, uh, ways to, uh, cross [14:03.410 --> 14:09.430] reference between the Chrome web store and VirusTotal, for example. Uh, also a lot of files [14:09.430 --> 14:15.870] were actually incorrectly tagged as CRX files. And in fact, uh, something like 30 percent [14:15.870 --> 14:22.250] were, were invalid even though they were tagged as CRX files. However, in the Chrome web [14:22.250 --> 14:29.170] store, obviously it's the most reliable resource, uh, to valid files. Um, but, um, they also [14:29.170 --> 14:36.030] remove malicious files. Uh, at least the one they, they are aware of. And only, they only store [14:36.030 --> 14:42.930] the most recent, uh, version of each, uh, of each extension. Um, so we, obviously we decided [14:42.930 --> 14:49.090] to refer to most files there as benign. And we, we did have, find some metadata that was [14:49.090 --> 14:55.510] useful. But as I said, it's hard to cross reference between them. Um, if we talk about the [14:55.510 --> 14:59.570] unofficial stores, so obviously this is the largest, uh, source for CRX files because it [14:59.570 --> 15:05.290] stores all previous versions, all deleted, uh, all deleted, uh, extensions. And, uh, basically [15:05.290 --> 15:10.830] everything that was ever uploaded to, uh, to the official store. Uh, but in some cases we [15:10.830 --> 15:17.870] didn't have, um, metadata to use. Only an ID or not even that in some cases. And obviously we [15:17.870 --> 15:23.070] didn't, we do not know, uh, what happened to the CRX between the store and the crawl. So, uh, [15:23.070 --> 15:29.670] we're not sure what's the trust factor for, uh, for these, uh, extensions, for these files. So [15:29.670 --> 15:35.770] just to sum it up real quick, um, so as we said, the threat intelligence feeds, uh, were [15:35.770 --> 15:42.470] actually almost the best in, in everything except quantity. Uh, so what we did was use most [15:42.470 --> 15:48.570] the official Chrome web store and the unofficial stores, um, together with the, uh, with the [15:48.570 --> 15:55.330] feeds, uh, and basically uploaded these files to, uh, to get the results we wanted and the [15:55.330 --> 16:03.070] metadata that we thought would be necessary for, for our grant. So basically, um, we decided [16:03.070 --> 16:10.470] to, to, to use, uh, five positives by AV vendors in order to, uh, decide if the file was [16:10.470 --> 16:15.870] malicious. As I said at the beginning, um, we see that not a lot of vendors even scan these [16:15.870 --> 16:21.190] files. So five is not a lot of vendors but was enough for us at least for this, uh, research, uh, [16:21.190 --> 16:28.670] model. And B9 we decided that, uh, whether, uh, files are in the official store and have zero [16:28.670 --> 16:34.050] positives after that we, we scanned in Virustool or uploaded from the unofficial stores and [16:34.050 --> 16:43.970] also received zero positives. Uh, all right, so now we'll dive into the, uh, three models that [16:43.970 --> 16:51.410] we created. Uh, something important to say is that, uh, this, this, this three models are, uh, [16:51.410 --> 16:57.290] research model. We just want to, uh, prove a point that, uh, we can, uh, it, it's possible to [16:57.290 --> 17:04.470] create a model to detect, uh, malicious, uh, Chrome extension with a good detection rate. Um, [17:04.470 --> 17:12.910] so this is slide, uh, about the overall, uh, process, uh, uh, of the creation of the model. So [17:12.910 --> 17:19.230] first is the preprocessing step. Uh, we validated the, the file that, uh, were introduced into [17:19.230 --> 17:25.870] the data set. After that, uh, we extracted from the relevant files the relevant, uh, like the [17:25.870 --> 17:36.670] features. Um, um, we ended up with a, a, a big dimensional, uh, size. So we had to, to reduce the [17:36.670 --> 17:43.450] dimensionality to the dimensional. So we first used chi-square and after that we tried another [17:43.450 --> 17:49.830] model with, uh, applying, uh, two different, uh, method, uh, like, uh, with the two steps. First [17:50.230 --> 17:56.750] chi-square and then, um, gradient boosting. Uh, we represented the, the features into numerical [17:56.750 --> 18:04.490] value with using TFIDF in order to train a model. Uh, and, uh, the models that we trained were, uh, [18:04.490 --> 18:12.870] one logistic regression model and two DNNs. Um, last thing to say about that is that, uh, we, um, [18:12.870 --> 18:18.390] we didn't try to optimize the hyperparameters since, since it's just a research model as, as I [18:18.390 --> 18:27.650] said. Sorry. All right. Um, so, uh, the pre-processing. So first we validated, uh, the [18:27.650 --> 18:34.990] files as I said. Uh, every deployed file should be CRX or ZIP. Uh, you can, uh, check it, uh, or [18:34.990 --> 18:41.590] test it by looking at the magic of the file for example. Uh, another thing, uh, to test is that, [18:41.590 --> 18:48.350] uh, each archive, uh, has a manifest, uh, dot JSON file which is a must, uh, for, uh, uh, [18:48.390 --> 18:57.990] any extension. Uh, we ended up with, uh, a bigger data set but we used, uh, 20, uh, 20,000, uh, [18:57.990 --> 19:07.530] files. 75 percents of the file, uh, of the data sets, of the data sets are, uh, uh, went for, uh, [19:07.530 --> 19:15.130] training and, uh, 25 percents, uh, for, uh, test. All right. So, uh, the feature extraction [19:15.130 --> 19:22.050] method, uh, we extracted features from the JavaScript files and from the manifest. Uh, the [19:22.050 --> 19:29.010] feature extraction method that we used, uh, was, uh, uh, looking for sequences of 4 characters [19:29.010 --> 19:38.010] or, uh, or more, um, of alphanumeric values or, uh, relevant, uh, uh, characters to [19:38.010 --> 19:44.270] JavaScript such as underscore or dollar. Uh, now we'll see an example. So let's say that, uh, [19:44.270 --> 19:51.190] we're trying to, uh, extract features, uh, using this method, uh, from this function. So these are [19:51.190 --> 20:00.850] the features that, uh, will be extracted, uh, using the features. Uh, I hope it's clear. All [20:00.850 --> 20:06.870] right. Uh, dimensionality reduction. So, uh, using the extraction method that, uh, we saw [20:06.870 --> 20:14.170] earlier, uh, we ended up with 1.1 million, uh, features which is, uh, a big amount. Uh, of [20:14.170 --> 20:19.510] course that we had to reduce the amount. So, uh, as I said, uh, we tried chi-square to [20:19.510 --> 20:26.870] reduce to, actually we tried to, uh, different, uh, numbers. Uh, we, we tried to, uh, we [20:26.870 --> 20:33.230] decided to take for this model the, uh, 10K, uh, features. And, uh, in second step, uh, we [20:33.230 --> 20:40.750] used the gradient boosting to reduce from 10K to, uh, um, to 1K. Uh, and then we presented, uh, [20:40.750 --> 20:48.990] the features into numerical value using, uh, TF-IDF as I said earlier. So, uh, here are the [20:48.990 --> 20:57.130] results, uh, of the three models. So, first, uh, the DNN model, uh, using chi-square only. Um, [20:57.130 --> 21:02.770] the results were best, were the best results, uh, out of the three models. Uh, as you can see, [21:02.770 --> 21:10.350] the recalls was, uh, uh, 99 percent and, uh, false positive rate was about, uh, 2 or 3 [21:10.350 --> 21:19.690] percent. Uh, the second DNN model using, uh, another step of, um, of XGBoost, uh, was, uh, [21:19.690 --> 21:26.470] was worse. Uh, the recall, uh, was pretty similar, but, uh, the false positive rate was much [21:26.470 --> 21:32.270] higher. Uh, the last, uh, logistic regression model using, uh, chi-square and XGBoost, uh, had, [21:32.270 --> 21:40.330] uh, the worst, uh, worst results, uh, out of these three. Uh, the false positive rate was [21:41.190 --> 21:52.730] around, uh, 30 percent, which makes it, uh, it's not a sustainable model. Uh, one thing, uh, [21:52.730 --> 22:00.370] another thing, uh, to, to note is that, uh, in general, the recall is, uh, more important, uh, [22:00.370 --> 22:06.150] for Chrome extension that, uh, the false positive rate since, uh, an average user is around 5 or [22:06.950 --> 22:14.730] 10 extensions and, uh, you wouldn't want to, like to miss the one malicious extension, uh, rather [22:14.730 --> 22:22.030] than a false positive on one of the, out of the 10, uh, which is, um, not good as well, but, uh, [22:22.030 --> 22:34.180] not, uh, not bad as, uh, missing the one malicious one. Um, um, okay, and, uh, last thing to [22:34.180 --> 22:40.340] say about this model that, uh, all of these three models were, uh, were able to detect, uh, the [22:40.340 --> 22:50.660] data spy campaign and, uh, the other one, the game of Chromes. Future, uh, research, um, so, uh, [22:50.660 --> 22:56.800] we would like to try, uh, to deobfuscate the JavaScript files before, uh, extracting the [22:56.800 --> 23:04.160] features, uh, so the extension, uh, straight landscape suffer from, uh, a lot of, uh, [23:04.180 --> 23:09.600] obfuscations, uh, on the JavaScript code, so we'd like to do some normalization and [23:09.600 --> 23:16.700] deobfuscation before we extract, um, the features. Uh, another thing to try is, uh, combine the [23:16.700 --> 23:23.200] data set to train a model with a combined data set of Chrome and Firefox extensions. Um, these, [23:23.200 --> 23:29.680] these, uh, formats and, uh, files, uh, should be similar, uh, but we didn't try to train, combine [23:29.680 --> 23:37.660] the model, uh, or tested, uh, the results on Firefox, uh, data set. Uh, and that's pretty much [23:37.660 --> 23:46.220] it. Uh, thank you very much. Um, actually we are out of time, so we'll stay, uh, all right. One [23:46.220 --> 23:53.020] question, okay? Is there any question? All right. Thank you very much.