WEBVTT

00:00.000 --> 00:04.180
Hi everyone.

00:05.880 --> 00:12.980
So today we are going to talk about research that we've done on a chrome extension.

00:14.400 --> 00:27.320
We researched the threat landscape and the chrome extension anatomy and we created models to detect malicious chrome extensions.

00:28.260 --> 00:42.560
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.

00:42.720 --> 00:45.360
Actually we are threat researchers.

00:45.360 --> 00:52.920
We've used, we consulted with a data scientist, Jonathan, which is sitting here.

00:53.300 --> 00:55.420
So thanks for Jonathan.

00:58.220 --> 01:00.580
So, um, I'm Tal.

01:00.580 --> 01:05.540
I'm working at Deep Instinct for the past two and a half years.

01:05.540 --> 01:09.880
Prior to Deep Instinct, I've been serving in the IDF for seven years.

01:11.080 --> 01:12.820
Hi guys, I'm Rui.

01:12.820 --> 01:21.520
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.

01:25.290 --> 01:28.110
So, um, the agenda for today.

01:28.110 --> 01:39.650
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.

01:39.650 --> 01:48.970
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.

01:49.310 --> 02:06.050
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.

02:06.070 --> 02:18.510
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.

02:21.150 --> 02:24.290
Alright, so let's quickly talk about browser extensions.

02:24.750 --> 02:27.510
Uh, first of all, what are browser extensions?

02:27.510 --> 02:34.930
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.

02:34.930 --> 02:43.170
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.

02:43.170 --> 02:59.330
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.

02:59.410 --> 03:05.710
Uh, which obviously makes it an attractive, uh, threat, uh, attack surface for hackers and attackers.

03:07.190 --> 03:09.550
So, uh, why specifically Chrome?

03:09.550 --> 03:13.010
Well, basically Chrome's the most common, uh, browser of them all.

03:13.570 --> 03:23.830
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.

03:24.090 --> 03:27.670
Uh, which are all, um, based on the Chromium project.

03:27.790 --> 03:40.670
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.

03:40.750 --> 03:46.670
Uh, mostly due to the fact that they are, um, undetected for long periods of times.

03:47.670 --> 03:55.370
Uh, this is just, uh, a small graph to describe the, uh, Chrome versus, uh, additional browsers as you can see from rules.

03:56.810 --> 03:57.810
Alright.

03:59.490 --> 04:07.910
So, um, there are some, uh, features, like built in features in Chrome that makes it, uh, attractive, uh, for, uh, attackers.

04:07.970 --> 04:12.810
Uh, so first it, uh, the extension can be installed, uh, through developer mode.

04:12.810 --> 04:30.850
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,

04:30.850 --> 04:38.670
with, uh, the, uh, flag which is called the minus minus load extension that can be passed to chrome.exe.

04:38.670 --> 04:44.350
Uh, another, uh, feature is, uh, ignorance of, uh, HTTPS.

04:44.350 --> 05:04.910
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.

05:05.550 --> 05:25.670
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.

05:26.170 --> 05:27.850
Um, that's it.

05:28.810 --> 05:34.930
So, um, now we will talk a bit about, uh, the anatomy of the Chrome extension.

05:34.930 --> 05:39.430
Uh, so first Chrome extension, uh, has, uh, the file type dot CRX.

05:39.430 --> 05:43.470
So from now on we'll, uh, mention, uh, CRX as Chrome extension.

05:43.470 --> 05:49.850
Uh, so the CRX is actually a zip file, an archive file, uh, which is built as follows.

05:49.850 --> 06:08.150
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.

06:08.150 --> 06:10.910
Uh, background script.

06:10.910 --> 06:17.610
Uh, background script is, uh, like the main script, uh, which is JavaScript of the extension.

06:17.610 --> 06:23.250
Uh, this script, uh, holding the state of the extension and every event that occur.

06:23.250 --> 06:29.050
Uh, so the background script is notified and decides what to do.

06:29.050 --> 06:33.070
Uh, for example, it can triggers, uh, another content script.

06:33.150 --> 06:36.870
Uh, so now I'll talk about the content scripts.

06:36.870 --> 06:43.010
Content scripts are scripts that, uh, are made, uh, for particular web pages.

06:43.010 --> 06:51.510
Uh, it has full access to the full JavaScript API in contrast to the, uh, background script that does not have full access.

06:51.810 --> 06:58.010
Um, and it's used, uh, to manipulate, uh, as I said, uh, particular, uh, web pages.

06:58.010 --> 07:11.150
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.

07:11.530 --> 07:13.830
Um, okay.

07:14.690 --> 07:19.270
Alright, so, uh, let's talk a bit about the threat landscape of Chrome extension malware.

07:19.910 --> 07:27.570
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.

07:27.570 --> 07:34.630
Uh, a year later we're talking hundreds of millions of, uh, downloads and according to Google 200 million, uh, active users.

07:34.990 --> 07:46.010
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.

07:46.070 --> 08:03.310
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,

08:03.310 --> 08:04.150
uh, developer mode.

08:04.150 --> 08:20.090
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.

08:20.090 --> 08:21.550
In 2015 they stopped it.

08:21.550 --> 08:23.090
2014 they stopped it.

08:23.790 --> 08:33.170
Um, a couple of years ago, obviously these measures have, uh, caused a drop in, uh, malware, uh, Chrome malware distribution.

08:33.290 --> 08:40.290
However, uh, this couple, last couple of years, specifically, uh, 2019 was the most, uh, uh, the biggest one.

08:40.290 --> 08:48.270
We saw, uh, uh, big growth in the, uh, propagation of, uh, malware, uh, malware, uh, from CRX files.

08:49.050 --> 08:51.430
And this is a graph from, uh, VirusTotal.

08:51.430 --> 09:01.770
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.

09:02.050 --> 09:16.970
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.

09:16.970 --> 09:24.190
Most, um, most extensions in VirusTotal are, um, with zero detections.

09:25.090 --> 09:30.950
Um, but, uh, so let's talk a bit about the attack surface.

09:30.950 --> 09:42.430
Um, so first, um, all the JavaScript code runs in, uh, isolated, uh, environment, uh, sandbox, uh, of, uh, Chrome.

09:42.430 --> 09:52.250
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.

09:52.250 --> 10:00.670
Um, what it can actually still do is everything that, uh, is related to the browser itself.

10:00.670 --> 10:14.010
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.

10:14.010 --> 10:20.410
Um, um, um, monetizing, like using advertisement and stuff like that.

10:20.550 --> 10:27.530
Uh, now we'll see an example of, uh, an attack, uh, that was presented in Defcon and Black Hat 2 years ago.

10:27.590 --> 10:29.730
Uh, it was called, uh, Game of Chromes.

10:29.730 --> 10:36.930
So basically what, uh, the attack was about is to create, uh, a botnet , uh, based on a Chrome extension.

10:37.010 --> 10:40.470
Um, so, uh, it was like that.

10:40.470 --> 11:00.250
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.

11:00.250 --> 11:04.490
Wix is a free platform to create a website, uh, very fast.

11:04.490 --> 11:11.970
So using, uh, the Wix website, uh, the Wix website was published to all the friends of the, of the user.

11:11.970 --> 11:24.170
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.

11:24.170 --> 11:25.630
The extension was spreaded.

11:25.790 --> 11:34.390
Uh, and, uh, lastly the extension rated itself in, uh, Chrome web store with five stars which, uh, just, uh, genius.

11:34.630 --> 11:38.290
Um, so that's one attack.

11:38.290 --> 11:41.390
Uh, another attack from the last month is Data Spy.

11:41.390 --> 11:46.750
Data Spy was spreaded with, uh, eight extensions for Firefox and Chrome as well.

11:46.850 --> 12:09.050
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.

12:09.050 --> 12:15.990
Uh, you can, uh, you can see the research paper, uh, and see the particular website where it's sold now.

12:16.110 --> 12:27.650
Um, why it's, uh, interesting, for example, uh, in, uh, URL, you, uh, in HTTP, uh, uh, protocol.

12:27.650 --> 12:38.170
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.

12:38.970 --> 12:40.010
Okay.

12:41.030 --> 12:45.850
All right, so we're going to talk a bit about the data collection and the labeling process.

12:46.190 --> 12:56.270
So basically when, uh, sourcing, uh, for data sets such as the CRX, uh, we had several challenges such as, uh, finding reliable sources.

12:56.270 --> 13:01.270
This was, uh, highly uncommon and small and rather new threat landscape.

13:01.410 --> 13:06.390
Uh, other than that, we wanted to make sure that all files were actually, uh, in the correct format.

13:06.390 --> 13:07.690
They're actually CRX files.

13:07.710 --> 13:13.070
And of course, uh, knowing how to distinguish between the malicious and the non-malicious ones.

13:13.250 --> 13:16.010
Uh, for that we used three sources.

13:16.030 --> 13:21.510
Uh, one was the threat intelligence feed, for example, VirusTotal, threat, um, reversing labs.

13:21.530 --> 13:23.590
The other was the official Chrome web store.

13:23.590 --> 13:31.630
And last was unofficial Chrome stores, which are basically stores that, uh, crawled the official store and offered the same, uh, extensions.

13:31.630 --> 13:33.610
So we're going to talk a bit about each one.

13:33.610 --> 13:39.410
So, uh, threat intelligence feeds had the lowest amount of, uh, CRX files.

13:39.730 --> 13:44.910
Um, but they had, uh, much more, uh, quality metadata.

13:45.110 --> 13:47.990
For example, we had the AD vendors detections.

13:47.990 --> 13:52.670
We had the number of submissions, uh, when it was first uploaded, et cetera.

13:52.710 --> 13:56.390
Uh, but also had some, uh, more challenging metadata.

13:56.390 --> 13:59.150
Uh, we had, we faced a lot of, uh, missing details.

13:59.150 --> 14:07.250
We couldn't find, uh, uh, the, uh, ways to, uh, cross reference between the Chrome web store and VirusTotal, for example.

14:07.490 --> 14:12.870
Uh, also a lot of files were actually incorrectly tagged as CRX files.

14:12.870 --> 14:19.870
And in fact, uh, something like 30 percent were, were invalid even though they were tagged as CRX files.

14:20.890 --> 14:26.130
However, in the Chrome web store, obviously it's the most reliable resource, uh, to valid files.

14:26.650 --> 14:30.470
Um, but, um, they also remove malicious files.

14:30.610 --> 14:33.270
Uh, at least the one they, they are aware of.

14:33.430 --> 14:40.190
And only, they only store the most recent, uh, version of each, uh, of each extension.

14:40.890 --> 14:45.490
Um, so we, obviously we decided to refer to most files there as benign.

14:45.770 --> 14:49.830
And we, we did have, find some metadata that was useful.

14:49.830 --> 14:52.370
But as I said, it's hard to cross reference between them.

14:53.910 --> 15:03.950
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.

15:04.170 --> 15:08.550
And, uh, basically everything that was ever uploaded to, uh, to the official store.

15:09.070 --> 15:12.970
Uh, but in some cases we didn't have, um, metadata to use.

15:12.970 --> 15:16.010
Only an ID or not even that in some cases.

15:16.230 --> 15:22.190
And obviously we didn't, we do not know, uh, what happened to the CRX between the store and the crawl.

15:22.190 --> 15:28.510
So, uh, we're not sure what's the trust factor for, uh, for these, uh, extensions, for these files.

15:29.170 --> 15:39.490
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.

15:39.950 --> 15:58.410
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,

15:58.410 --> 15:59.390
for our grant.

16:00.130 --> 16:10.970
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.

16:10.970 --> 16:16.250
As I said at the beginning, um, we see that not a lot of vendors even scan these files.

16:16.250 --> 16:21.970
So five is not a lot of vendors but was enough for us at least for this, uh, research, uh, model.

16:22.810 --> 16:36.830
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.

16:40.050 --> 16:45.170
Uh, all right, so now we'll dive into the, uh, three models that we created.

16:45.210 --> 16:52.290
Uh, something important to say is that, uh, this, this, this three models are, uh, research model.

16:52.290 --> 17:02.990
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.

17:03.190 --> 17:12.610
Um, so this is slide, uh, about the overall, uh, process, uh, uh, of the creation of the model.

17:12.610 --> 17:15.350
So first is the preprocessing step.

17:15.350 --> 17:20.170
Uh, we validated the, the file that, uh, were introduced into the data set.

17:20.170 --> 17:26.950
After that, uh, we extracted from the relevant files the relevant, uh, like the features.

17:27.290 --> 17:33.990
Um, um, we ended up with a, a, a big dimensional, uh, size.

17:33.990 --> 17:39.150
So we had to, to reduce the dimensionality to the dimensional.

17:39.150 --> 17:49.450
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.

17:49.450 --> 17:53.690
First chi-square and then, um, gradient boosting.

17:53.690 --> 18:00.750
Uh, we represented the, the features into numerical value with using TFIDF in order to train a model.

18:00.830 --> 18:07.550
Uh, and, uh, the models that we trained were, uh, one logistic regression model and two DNNs.

18:07.550 --> 18:19.090
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.

18:20.250 --> 18:21.290
Sorry.

18:21.370 --> 18:22.250
All right.

18:22.410 --> 18:25.930
Um, so, uh, the pre-processing.

18:25.930 --> 18:28.870
So first we validated, uh, the files as I said.

18:28.870 --> 18:32.630
Uh, every deployed file should be CRX or ZIP.

18:32.630 --> 18:38.450
Uh, you can, uh, check it, uh, or test it by looking at the magic of the file for example.

18:38.490 --> 18:49.510
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.

18:50.390 --> 18:58.870
Uh, we ended up with, uh, a bigger data set but we used, uh, 20, uh, 20,000, uh, files.

18:58.970 --> 19:12.210
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.

19:12.890 --> 19:13.610
All right.

19:13.610 --> 19:21.750
So, uh, the feature extraction method, uh, we extracted features from the JavaScript files and from the manifest.

19:21.750 --> 19:40.710
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.

19:40.810 --> 19:42.950
Uh, now we'll see an example.

19:42.950 --> 19:49.710
So let's say that, uh, we're trying to, uh, extract features, uh, using this method, uh, from this function.

19:49.770 --> 19:56.070
So these are the features that, uh, will be extracted, uh, using the features.

19:56.190 --> 19:58.230
Uh, I hope it's clear.

20:00.290 --> 20:01.390
All right.

20:01.470 --> 20:03.430
Uh, dimensionality reduction.

20:03.430 --> 20:13.230
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.

20:13.290 --> 20:16.730
Uh, of course that we had to reduce the amount.

20:16.730 --> 20:24.350
So, uh, as I said, uh, we tried chi-square to reduce to, actually we tried to, uh, different, uh, numbers.

20:24.350 --> 20:30.870
Uh, we, we tried to, uh, we decided to take for this model the, uh, 10K, uh, features.

20:30.910 --> 20:38.630
And, uh, in second step, uh, we used the gradient boosting to reduce from 10K to, uh, um, to 1K.

20:38.690 --> 20:45.610
Uh, and then we presented, uh, the features into numerical value using, uh, TF-IDF as I said earlier.

20:47.410 --> 20:51.770
So, uh, here are the results, uh, of the three models.

20:51.770 --> 20:56.290
So, first, uh, the DNN model, uh, using chi-square only.

20:56.490 --> 21:01.630
Um, the results were best, were the best results, uh, out of the three models.

21:01.630 --> 21:11.230
Uh, as you can see, the recalls was, uh, uh, 99 percent and, uh, false positive rate was about, uh, 2 or 3 percent.

21:11.490 --> 21:20.790
Uh, the second DNN model using, uh, another step of, um, of XGBoost, uh, was, uh, was worse.

21:20.790 --> 21:27.170
Uh, the recall, uh, was pretty similar, but, uh, the false positive rate was much higher.

21:27.170 --> 21:37.470
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.

21:37.630 --> 21:47.410
Uh, the false positive rate was around, uh, 30 percent, which makes it, uh, it's not a sustainable model.

21:47.550 --> 22:11.310
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,

22:11.310 --> 22:26.150
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.

22:26.930 --> 22:44.660
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.

22:46.300 --> 23:11.940
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,

23:11.940 --> 23:13.540
um, the features.

23:13.540 --> 23:21.620
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.

23:21.820 --> 23:35.140
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.

23:35.960 --> 23:38.200
Uh, and that's pretty much it.

23:38.200 --> 23:39.700
Uh, thank you very much.

23:39.700 --> 23:45.940
Um, actually we are out of time, so we'll stay, uh, all right.

23:45.940 --> 23:47.420
One question, okay?

23:48.560 --> 23:49.980
Is there any question?

23:51.300 --> 23:52.040
All right.

23:52.040 --> 23:53.020
Thank you very much.

