WEBVTT

00:00.000 --> 00:10.720
So this is called, your blacklist is dead, air-gapped everything, and is my diatribe on why I think that the future of command and control for malware is in the cloud.

00:11.080 --> 00:16.600
Just to give a little bit of background on you, my name, on you, on me, my name is Eric Lincoln.

00:16.600 --> 00:18.640
I'm a threat researcher at Netscope.

00:18.640 --> 00:21.480
I study applied mathematics at Johns Hopkins University.

00:21.820 --> 00:29.420
I wear some lib t-shirts because I'm not allowed to talk about politics in this presentation.

00:30.240 --> 00:31.760
So why am I here?

00:32.320 --> 00:34.860
Well, I'm here because I think a lot about malware.

00:35.080 --> 00:39.760
And I think a lot about what malware authors are going to do.

00:40.800 --> 00:43.120
And, right, so what motivates malware authors?

00:43.120 --> 00:44.940
They don't want to get caught, right?

00:44.940 --> 00:46.100
That's the number one thing.

00:46.100 --> 00:49.060
If you have malware on a system, you probably don't want to get caught.

00:49.060 --> 00:50.960
Of course, there are exceptions, you know.

00:51.220 --> 00:54.100
But for the most part, you want to be surreptitious.

00:54.280 --> 00:55.700
So how do you avoid detection?

00:55.700 --> 00:57.540
You blend in, right?

00:57.600 --> 01:10.500
And so if you're talking to this sketchy server in Ukraine or you're calling out to an OVH IP, which if any of you have ever seen malicious network traffic, you've probably seen, it's pretty obvious, right?

01:10.560 --> 01:22.560
But if I talk to a whitelisted domain, something that is very specifically authorized instead of a sketchy server in France or Ukraine, that's a much harder problem to solve, right?

01:23.120 --> 01:36.960
And if you've ever written IDS rules for unspecified IDSs that I'm not allowed to name, it's really, really hard to detect things that look like normal traffic but are bad, right?

01:36.960 --> 01:45.260
So you look at Angular exploit kit used a bunch of BBS patterns when it was trying to put out its landing pages.

01:45.260 --> 01:50.760
And that made it really, really hard for me at the time to write IDS rules to mitigate it.

01:51.940 --> 01:58.380
So before we really dive into the meat of it, why do people even use SaaS applications, right?

01:58.380 --> 02:00.120
We have software as a service.

02:00.120 --> 02:05.780
I'm willing to bet that everyone here has some authorized SaaS application in their enterprise.

02:05.780 --> 02:07.440
So what's it good for, right?

02:07.740 --> 02:11.640
I mean, you don't manage the physical infrastructure.

02:11.640 --> 02:12.960
It's patched for you.

02:12.960 --> 02:14.760
Users can use it from everywhere.

02:15.580 --> 02:16.860
It's easy.

02:16.860 --> 02:17.660
It's cheap.

02:17.660 --> 02:18.760
It's effective.

02:18.760 --> 02:21.240
And it's growing, right?

02:21.320 --> 02:22.960
Small companies are using it.

02:22.960 --> 02:24.580
Large companies are using it.

02:24.580 --> 02:27.740
G Suite, Slack, Dropbox, Box.

02:27.740 --> 02:30.240
You name it, someone is using it, right?

02:30.480 --> 02:34.340
And so it's everywhere and it's easy.

02:35.140 --> 02:41.780
A minor digression is I've had a lot of debate about is social media SaaS, right?

02:41.780 --> 02:43.580
Is social media software as a service?

02:44.820 --> 02:46.620
Salesforce thinks so.

02:46.620 --> 02:47.980
I think so.

02:47.980 --> 02:51.640
If you disagree, then you're wrong.

02:52.680 --> 02:53.840
I'm so sorry.

02:53.840 --> 02:55.060
You're wrong.

02:55.540 --> 02:57.700
So Reddit is SaaS and Facebook is SaaS.

02:57.700 --> 03:01.000
And again, that's not up for discussion.

03:01.380 --> 03:03.940
So is SaaS good for security?

03:03.940 --> 03:07.240
And the answer is a resounding maybe, right?

03:07.420 --> 03:10.580
In some sense, you want to offload your risks to a third party.

03:10.580 --> 03:21.540
You want Microsoft to be responsible for protecting your data and encrypting it because they're probably better at protecting encryption keys than you are.

03:22.000 --> 03:27.000
So it decreases the attack surface of your actual enterprise network.

03:27.260 --> 03:33.520
And also, right, capitalism, because we live in a society, incentivizes protecting your stuff.

03:33.520 --> 03:38.820
If somebody is really, really bad at protecting your data, you're not going to trust them with it, right?

03:38.820 --> 03:41.320
You're not going to pay them money to do it.

03:41.320 --> 03:43.760
That's kind of how the market works.

03:45.260 --> 03:49.300
So does having a bunch of whitelisted services decrease your visibility?

03:50.360 --> 03:51.500
Yeah, right?

03:51.500 --> 03:55.500
You have a bunch of network traffic outbound that you assume is good.

03:55.500 --> 03:57.640
You're not inspecting that traffic.

03:57.660 --> 03:59.620
Not in any meaningful way.

03:59.860 --> 04:01.140
So yeah.

04:01.140 --> 04:03.280
It's a land of contrasts.

04:04.280 --> 04:06.880
So we'll start with a blue team perspective, right?

04:07.900 --> 04:11.760
I do want to start with a caveat that other people are much better at this than I am.

04:11.760 --> 04:22.600
There are people here who have spoken today whose presentations you have seen who have thought about the blue team approach to protecting against malware and things.

04:22.720 --> 04:24.920
And they're better than I am.

04:24.920 --> 04:26.940
So if you saw those talks, good for you.

04:26.940 --> 04:28.400
Otherwise, they're recorded.

04:30.040 --> 04:31.940
So I've got a timeline here.

04:31.940 --> 04:35.260
And you can't read it because the text is super tiny.

04:35.260 --> 04:37.820
So I'm just displaying it so I can talk about it.

04:37.820 --> 04:42.260
But basically, we've got kind of different phases of the cyber kill chain.

04:42.260 --> 04:43.580
You've got your actions on objectives.

04:43.580 --> 04:46.680
You've got command and control, delivery and exploitation.

04:46.860 --> 05:01.060
And we have seen since about 2009, every single one of these three phases used in different ways with different services to do all kinds of different things, right?

05:01.060 --> 05:05.360
So you have Google App Engine being used for command and control.

05:05.820 --> 05:09.780
Using EC2 all the way back in 2009, right?

05:09.780 --> 05:25.020
Recently, Trend Micro, and we wrote about it too, but Trend Micro did it first, wrote about Slub, which uses a variety of SaaS services to do a couple of different steps of this process, right?

05:25.540 --> 05:39.400
You have Rock Group, which was using GitLab and Giddy, which is a Chinese Git clone or a GitHub clone, to download follow-on scripts and second-stage payloads, right?

05:39.400 --> 05:42.300
So these things are happening.

05:42.780 --> 05:49.560
We had a pretty good run there in 2014, where there's a decent cluster where you've got PlugX, Inception Framework, right?

05:49.560 --> 05:53.700
So it's being used by cyber criminals, APTs.

05:54.100 --> 05:57.060
It's being used by everybody.

05:57.060 --> 05:59.080
And it's only getting easier.

06:00.860 --> 06:06.760
And part of the reason for that is, if you think about domain generation algorithms, right?

06:06.760 --> 06:14.740
So our first domain generation algorithm that we've really observed and kind of the one that we call the first is Kraken, right?

06:14.740 --> 06:16.620
And that was back in 2008.

06:16.620 --> 06:25.200
So in the last 11 years, we've written over 22,500 academic papers.

06:25.200 --> 06:31.940
That's not blog posts and Medium posts and, like, shitty things you wrote and marked down but never published.

06:31.940 --> 06:35.300
These are academic papers that are on Google Scholar, right?

06:35.300 --> 06:38.260
This is a well-researched, well-trodden topic.

06:38.360 --> 06:45.100
And if you've spent any time in malware analysis or blue teaming, some of these names are familiar.

06:45.100 --> 06:47.000
You may have heard of Conficker.

06:47.000 --> 06:49.320
You may have heard of the Zeus botnet.

06:49.320 --> 06:51.520
Those are things you might have heard of.

06:51.700 --> 06:54.980
Or if you're new, you probably haven't, and that's fine.

06:55.200 --> 06:58.320
So we've spent a lot of time on domain generation algorithms, right?

06:58.360 --> 07:03.620
And we've spent a lot of resources researching how to detect domain generation algorithms.

07:04.800 --> 07:07.380
And what's the point of a domain generation algorithm?

07:07.440 --> 07:12.420
It's to make sure that you can't blacklist a domain and kill the CNC, right?

07:12.420 --> 07:16.260
It's to evade IDS detection that depends on the domain.

07:16.280 --> 07:18.360
It's to evade firewalls.

07:18.880 --> 07:28.820
Well, if you're just calling out to API.slack.com, you don't need to write a DGA, and when somebody figures out your DGA, you have to write a whole new DGA.

07:28.960 --> 07:31.500
You can just use API.slack.com, right?

07:31.820 --> 07:43.780
So it may not get rid of domain generation algorithms forever and always, but it is an alternative to domain generation algorithms that serves the same purpose.

07:44.680 --> 07:52.300
And I want to talk a little bit about Slub, which, again, Trend Micro wrote about, and then we wrote about as well.

07:52.580 --> 07:54.060
We being Netscope.

07:54.560 --> 08:06.980
So one of the things that Slub did was it got commands from GitHub gists, posted command responses in Slack, and then exfiltrated files when it would upload files, right?

08:06.980 --> 08:12.380
It would upload them to file.io, which doesn't require any authentication or API keys, right?

08:13.000 --> 08:18.020
And there are really good blog posts about this if you're interested in the technical details of Slub.

08:19.900 --> 08:33.320
And they've actually really the Slub authors have released a new version that kills GitHub, which I personally don't think is super great, but I understand it.

08:33.980 --> 08:35.680
And they use Slack a lot more.

08:35.680 --> 08:39.740
So they use Slack for passing commands and for returning responses.

08:40.120 --> 08:41.840
And it's a beautiful piece of malware.

08:41.840 --> 08:42.520
It really is.

08:42.520 --> 08:48.480
If you don't love malware, you're probably at the wrong conference, honestly.

08:49.440 --> 08:49.860
Right.

08:49.860 --> 08:52.860
So why was Slub so effective, okay?

08:53.400 --> 08:56.180
It used a bunch of different SaaS services, right?

08:56.180 --> 09:00.140
And file.io in particular is an anonymous upload.

09:00.140 --> 09:01.560
So it just uploads it.

09:01.560 --> 09:02.680
It doesn't ask you for a key .

09:02.680 --> 09:03.960
You don't log in.

09:03.960 --> 09:04.960
There's nothing.

09:04.960 --> 09:16.040
You just pass the binary bit or you pass not the binary, pass the hex bytes of the file to the upload path.

09:16.240 --> 09:17.080
And that's it.

09:17.080 --> 09:18.300
That's the API.

09:18.320 --> 09:20.400
File.io slash upload.

09:20.880 --> 09:21.700
That's all.

09:21.700 --> 09:22.720
Just a post.

09:23.360 --> 09:24.920
So that's really hard to detect, right?

09:24.920 --> 09:27.400
Unless you're looking at the content of the payload.

09:28.460 --> 09:35.840
And of course, looking at the content of the payload is difficult because all of these things have TLS, right?

09:35.860 --> 09:42.760
That's one of the other beauties of SaaS services as CNC is that they all provide TLS by default.

09:42.760 --> 09:48.940
You don't need to create your own cert, you don't need to get your let's encrypt cert every 30 days.

09:48.940 --> 09:53.520
It just uses Dropbox, file.io, whoever.

09:53.520 --> 09:55.780
It uses their TLS cert.

09:57.580 --> 09:59.060
And again, it's sneaky.

09:59.060 --> 10:00.480
It looks like API calls.

10:00.480 --> 10:05.080
API calls to legitimate websites don't look like CNC traffic.

10:05.080 --> 10:08.900
So you're not going to blacklist these domains, you're not going to blacklist these IPs.

10:09.300 --> 10:14.880
And if you write an IDS signature, you're probably not going to key off of that.

10:14.880 --> 10:17.960
You're going to have to key off of something in the content of the body, right?

10:18.440 --> 10:25.700
And that's assuming that you get through the TLS encryption, meaning that you're probably in line and you're stripping SSL.

10:25.980 --> 10:27.860
Which not everybody does.

10:29.120 --> 10:31.820
So how do you defend against SaaSy malware?

10:32.260 --> 10:34.880
Well, DLP solutions are pretty good.

10:34.920 --> 10:49.780
If you upload a sensitive file to Dropbox and you have a DLP solution in line that looks at your files as you upload them to Dropbox or as an attacker uploads them to Dropbox, it's going to say, hey, these are a bunch of social security numbers.

10:49.780 --> 10:51.040
It's probably not good.

10:51.040 --> 10:52.340
And you'll get an alert.

10:53.720 --> 10:59.020
Careful monitoring of traffic, which is really just a generic thing that doesn't mean anything.

10:59.020 --> 11:04.540
I'm just saying it so that I cover my ass when one of you asks me what about IDS.

11:05.680 --> 11:09.040
Aggressive user education, right?

11:09.040 --> 11:15.140
Not just, like, don't click links unless you trust them.

11:15.140 --> 11:19.280
But, like, ask yourself why you trust a link.

11:19.280 --> 11:27.520
If you're clicking a link that was messaged to you in Slack that goes to a Dropbox, maybe make sure.

11:28.560 --> 11:31.100
And then, of course, endpoint detection, right?

11:31.100 --> 11:35.500
Endpoint detection doesn't care what method you use for command and control.

11:35.500 --> 11:38.140
It just cares about whether or not it's detecting the malware.

11:38.280 --> 11:53.700
So, it can use domain generation algorithms or call out over port 666 or listen on port 777, which is sub 7 for the 11 of you who are old enough to remember that, right?

11:54.500 --> 11:56.320
So, that's a good way to do it.

11:57.040 --> 12:05.700
And one thing I want to do while I have a soapbox to stand on, one of my hobby's horse, is there's nothing new under the sun.

12:06.100 --> 12:18.920
All of these services, if you're a blue teamer, you need to think about Dropbox, you need to think about Slack, you need to think about all of these things the way that you think about ports on your server, right?

12:18.920 --> 12:27.720
If you're hardening a server and you've got FTP open, and you say, well, we don't run we don't need FTP open on this server.

12:27.780 --> 12:32.940
We've got FTPD running, but this isn't an FTP server.

12:33.180 --> 12:34.220
What do you do?

12:34.800 --> 12:37.080
You kill FTPD forever.

12:37.300 --> 12:41.380
You block port 24, 3, 4, shit, whatever.

12:41.380 --> 12:42.600
You know what I mean.

12:43.200 --> 12:44.540
It's been a long day.

12:44.540 --> 12:46.120
I yelled at most of you.

12:47.020 --> 12:50.100
But the point is, you block that port, you kill that service.

12:50.100 --> 12:54.700
If you don't run Dropbox in your enterprise, don't let people use Dropbox.

12:55.320 --> 12:56.520
Right?

12:56.660 --> 13:01.200
What personal Dropbox do they need to use for your corporate files?

13:01.200 --> 13:13.200
And I know that's such an awful thing to say at DEF CON, but seriously, if you're a blue teamer, really give thought to how you manage these services and be false positive tolerant on them.

13:13.700 --> 13:16.560
Because it will screw you.

13:17.700 --> 13:20.340
Now, for the more fun part, right?

13:20.340 --> 13:30.860
If you're a red teamer, or if you just like red team things, how do we use these sorts of services to do stuff?

13:31.920 --> 13:37.060
Well, as always, getting in is the hard part, right?

13:37.060 --> 13:43.480
And all of these slide titles are references to music, and you might not get any of them, and that's okay.

13:44.700 --> 13:47.940
This is Tom Petty on the Heartbreakers, yeah.

13:48.740 --> 13:51.280
But how do you get in in the first place?

13:51.280 --> 13:58.200
You abuse lax IAM permissions, you force logins, social engineering, old-fashioned exploitation, you know?

13:59.400 --> 14:01.420
Endpoints have vulnerabilities.

14:01.420 --> 14:02.820
People don't patch everything.

14:02.820 --> 14:09.120
People run, like, ancient versions of VLC, which is so weird.

14:09.120 --> 14:10.960
People run just the weirdest stuff.

14:10.960 --> 14:15.680
Somebody had FileZilla open, like, two months ago?

14:15.840 --> 14:17.200
Why?

14:17.760 --> 14:19.400
I don't know.

14:19.500 --> 14:26.920
And then you've got whatever blue you want, because people still haven't patched MS17010.

14:27.160 --> 14:33.860
Which, if you're in this room, and you have a box that you know of that hasn't applied that patch, leave.

14:34.700 --> 14:39.300
The whole conference, the state of Nevada, go home and patch it.

14:40.500 --> 14:42.440
It's been two years.

14:43.820 --> 14:44.860
Right?

14:44.920 --> 14:49.920
And so, then once you have the access, then you can get by IDS, right?

14:49.940 --> 14:53.320
And you can pull your tools from Dropbox.

14:53.320 --> 14:55.360
You can pull your tools from S3.

14:55.360 --> 14:57.480
You can pull scripts from Pastebin.

14:57.540 --> 14:58.220
Seriously.

14:58.220 --> 15:07.360
Just put the Python in Pastebin and make a curl request to the raw and then pipe it to Python.

15:07.360 --> 15:08.640
It's that easy.

15:08.780 --> 15:10.320
And it runs and it works.

15:10.320 --> 15:12.300
And I don't know.

15:12.620 --> 15:16.940
Some people aren't mitigating this in any way, shape, or form, and it's nuts.

15:17.840 --> 15:18.760
And GitHub.

15:18.760 --> 15:26.300
GitHub is such an underutilized way to abuse trust relationships that companies have.

15:26.480 --> 15:38.180
Most places, if you have a GitHub repo, and you make a pull from another GitHub repo or a clone from another GitHub repo, they just let you.

15:38.280 --> 15:40.680
Nobody's blocking GitHub traffic, right?

15:40.680 --> 15:43.000
Because what if it breaks your Jenkins pipeline?

15:44.700 --> 15:47.560
Yeah, that one guy found it funny.

15:47.560 --> 15:48.100
That was good.

15:48.100 --> 15:48.860
Thank you.

15:48.860 --> 15:50.040
You specifically.

15:50.620 --> 15:53.720
But seriously, you can just pull code.

15:53.720 --> 15:55.320
You can pull whatever from GitHub.

15:55.320 --> 15:57.080
And if you have file storage, forget about it.

15:57.080 --> 15:57.960
You can pull executables.

15:57.960 --> 15:59.940
You can do whatever you want, right?

16:02.380 --> 16:03.720
Nobody gets this one.

16:03.720 --> 16:04.540
That's okay.

16:05.160 --> 16:07.720
Carole King had a song called I Can't Hear You No More.

16:07.920 --> 16:08.780
It's fine.

16:09.380 --> 16:14.500
And then there's tried and true techniques for doing exfiltration over these sorts of services, right?

16:14.740 --> 16:21.140
You make a draft email in Gmail and attach something to it, but you don't send it.

16:21.140 --> 16:25.840
So, it never trips like an ESA, which is something I wasn't supposed to say.

16:26.800 --> 16:29.920
You know, Slack has an upload feature.

16:29.920 --> 16:31.600
Twitter, Dropbox, whatever.

16:31.600 --> 16:35.780
You can send data over these things, and they are usually trusted.

16:35.780 --> 16:44.520
You can create a private Reddit and just post whatever in there, and nobody will ever see it, and nobody will ever block it.

16:44.520 --> 16:51.080
It is a great way for you as a red teamer to exfiltrate data in a way that is super surreptitious.

16:52.120 --> 16:55.360
And one more thing I wanted to talk about.

16:55.740 --> 16:58.120
Before I talk about it, I do want to pay homage.

16:59.060 --> 17:00.600
This is not new.

17:00.900 --> 17:02.440
People have done this before.

17:02.480 --> 17:04.740
I am just demoing my version of it.

17:05.100 --> 17:11.880
So, Gcat, Twitter, Slackor, Slub, all did this really well, right?

17:12.440 --> 17:15.860
Slackor in particular is real nice.

17:16.180 --> 17:17.560
Coalfire put that out.

17:17.560 --> 17:19.580
So, huge props to them.

17:20.220 --> 17:29.040
And a little bit of a shout out to the Slub authors, because A, I jacked their program flow, and B, it is a sweet piece of malware.

17:29.340 --> 17:30.620
It is really good.

17:31.720 --> 17:33.440
It was fun to reverse.

17:33.440 --> 17:35.780
It was fun to reverse the second time.

17:36.980 --> 17:39.860
It was a real friend, you know?

17:40.420 --> 17:48.180
So, I want to demonstrate something that we have been calling sassy boy, which is I've got this shirt.

17:48.640 --> 17:51.520
That guy has a shirt, too, because he works with me.

17:53.540 --> 17:58.480
And I'm going to pause it like six times, and you probably can't see it.

17:58.500 --> 18:01.780
So, I'm really sorry, which is why I'm going to talk you through it.

18:02.200 --> 18:04.780
So, let's do that.

18:04.780 --> 18:05.400
Okay.

18:06.260 --> 18:06.840
Right.

18:06.840 --> 18:09.260
So, we run the oh, Jesus.

18:09.380 --> 18:09.640
Okay.

18:09.640 --> 18:10.440
There we go.

18:10.440 --> 18:11.900
So, we run the agent.

18:12.080 --> 18:12.640
Okay.

18:13.560 --> 18:16.100
And this is not full screened.

18:16.100 --> 18:17.420
Not well enough.

18:18.280 --> 18:19.400
That's fine.

18:19.820 --> 18:20.580
Right?

18:21.180 --> 18:27.360
And so, you can see on the right, we've got our Slack, and on the left, we have a terminal.

18:27.640 --> 18:33.660
And in real life, your malware is not going to be so cooperative and provide you with a terminal.

18:34.460 --> 18:37.880
But I have done it so that I can know when things start and end.

18:38.020 --> 18:40.700
Also, because I like recording my screen this way.

18:41.300 --> 18:42.980
So, play.

18:43.100 --> 18:44.020
There we go.

18:44.080 --> 18:44.400
Right?

18:44.400 --> 18:45.420
So, we run the agent.

18:45.420 --> 18:46.000
Okay?

18:46.300 --> 18:51.820
And the first thing that happens is it checks in here, and it tells you some basic information.

18:51.820 --> 18:56.380
So, down at the bottom, which you can't read, and I should have tried this on a big screen.

18:56.480 --> 18:58.780
It says current user is not admin.

18:58.800 --> 19:00.300
Username is Eagle Lincoln.

19:00.500 --> 19:02.520
Mac scope.local.

19:03.360 --> 19:07.060
So, what's it doing?

19:07.060 --> 19:14.720
It is checking who the current user is, what their UID is, what their OS is, and what the computer name is.

19:15.200 --> 19:18.820
And you see, we pop calc, because you have to.

19:20.240 --> 19:24.300
It did download the actual calc.app and run it.

19:24.940 --> 19:27.060
So, it is downloading and executing code.

19:28.760 --> 19:30.660
That's just a law of demos.

19:30.660 --> 19:34.220
If anybody gave you a demo today and didn't pop calc, they're fired.

19:36.220 --> 19:37.040
Right?

19:37.040 --> 19:38.520
And so, then what did it do?

19:38.980 --> 19:40.240
It listed this directory.

19:40.240 --> 19:43.320
It listed the current directory that it's running out of.

19:43.500 --> 19:47.440
Because I'm lazy and didn't want to move it around or compile it into an executable.

19:47.440 --> 19:48.960
But you can do that with pants.

19:49.420 --> 19:50.780
Or whatever you want.

19:51.760 --> 19:53.100
So, what do we have here?

19:53.100 --> 19:53.580
Right?

19:53.580 --> 19:55.140
We've got some stuff.

19:55.380 --> 19:56.380
And then we're gonna give it a command.

19:56.380 --> 19:57.960
We're gonna tell it to list dir.

19:58.060 --> 20:00.180
We're gonna have it list our home directory.

20:00.180 --> 20:01.540
Users, Eagle Lincoln.

20:01.780 --> 20:04.240
And it takes a couple seconds to think about it.

20:05.680 --> 20:06.860
And then it comes back.

20:06.860 --> 20:07.500
Right?

20:07.580 --> 20:12.240
And we've got a bunch of files and directories there, because I don't keep my home dir clean.

20:12.520 --> 20:15.180
But we have one in particular that's pretty neat.

20:15.400 --> 20:17.280
And that's .ssh.

20:18.180 --> 20:22.060
I'm assuming that everyone here knows what lives in .ssh.

20:22.700 --> 20:31.040
So, we're gonna go ahead and upload our SSH private key to Dropbox.

20:31.380 --> 20:33.940
All we pass it... right?

20:34.000 --> 20:37.680
So, this... all of this functionality is not hardcoded.

20:37.680 --> 20:45.020
We're passing it a path for a file and we're passing it an OAuth key for Dropbox.

20:45.020 --> 20:47.480
The Dropbox is not hardcoded.

20:47.960 --> 20:55.640
The only thing that lives in the malware is the upload API call for Dropbox.

20:56.760 --> 21:01.280
And then it creates a folder called max scope, which is the name of the computer.

21:01.860 --> 21:04.700
And hey, there's my RSA private key.

21:04.700 --> 21:05.280
Right?

21:05.660 --> 21:06.880
And we love it.

21:07.040 --> 21:08.420
And yeah.

21:08.420 --> 21:10.400
I'm not gonna show you my RSA private key.

21:10.400 --> 21:11.420
I thought about it.

21:11.420 --> 21:15.600
And then I remembered that that's my actual production laptop for work.

21:16.320 --> 21:19.820
That would be a mistake to display at DEF CON.

21:21.320 --> 21:23.460
Yeah, there would be like 45 people taking pictures.

21:23.620 --> 21:23.820
Right?

21:23.820 --> 21:25.600
And then we tell it destroy.

21:25.940 --> 21:28.900
And then when it destroys, it kills the whole thing.

21:29.080 --> 21:29.960
So, it just dies.

21:29.960 --> 21:30.380
That's it.

21:30.380 --> 21:31.320
That's the whole demo.

21:33.480 --> 21:34.480
Thank you.

21:35.560 --> 21:36.580
Thank you.

21:38.580 --> 21:39.300
Right?

21:39.300 --> 21:40.840
So, code is available.

21:40.900 --> 21:42.700
That's not the correct address anymore.

21:42.700 --> 21:45.340
It's at net scope OSS.

21:45.440 --> 21:46.680
I can modify it.

21:46.680 --> 21:47.640
I'll make it available.

21:47.640 --> 21:50.160
We have a blog post that links to the code, too.

21:50.160 --> 21:53.660
Net scope OSS slash sassy underscore boy.

21:53.780 --> 21:55.620
S-A-A-S-Y.

21:58.360 --> 22:00.860
But I've open sourced the whole thing.

22:00.860 --> 22:03.000
You can see my crappy Python.

22:04.060 --> 22:09.620
And you can run it and you can test your own security stuff against it and see what your logs say.

22:10.160 --> 22:12.300
Which is why I'm opening it.

22:12.440 --> 22:21.850
My caveat is it ran on my Mac, it ran on my Windows VM, and it ran on my Linux installation.

22:22.380 --> 22:25.820
I am not promising it will work on yours.

22:25.820 --> 22:32.500
Whatever your environment looks like, I hope it works.

22:32.500 --> 22:33.140
Or not.

22:33.140 --> 22:35.280
I hope it doesn't work if you don't want this running.

22:35.280 --> 22:36.060
Right?

22:36.060 --> 22:39.020
Anyway, what have we learned?

22:39.020 --> 22:39.280
Right?

22:39.280 --> 22:43.340
You guys sat here and listened to me talk for however long it's been.

22:43.760 --> 22:45.220
So, what have we learned?

22:45.220 --> 22:45.580
Right?

22:45.580 --> 22:47.780
What are the lessons you should take away?

22:48.520 --> 22:51.960
SaaS applications can increase your attack surface.

22:52.040 --> 23:01.780
Even though you are not running an NFS that is exposed to the internet and you're running Dropbox instead, now you are trusting Dropbox.

23:02.000 --> 23:10.800
Which means if you are not making sure that it is your Dropbox that is being used, you're increasing your exposure.

23:11.520 --> 23:14.640
SaaS applications move data very surreptitiously.

23:15.240 --> 23:25.200
One thing I thought about demoing, but didn't know what fun commands to run, is that Sassy Boy is basically a reverse shell over Slack, right?

23:25.200 --> 23:28.020
And it uses Twitter, too, that's another thing it does.

23:28.020 --> 23:29.600
It's got fallback methods.

23:31.560 --> 23:32.740
I gotcha.

23:34.500 --> 23:35.780
But it opens a reverse shell.

23:35.780 --> 23:37.120
You can run whatever command you want.

23:37.120 --> 23:41.260
If you want to RMRF slash, go for it.

23:41.440 --> 23:42.820
I'm not doing it.

23:42.960 --> 23:50.780
I was going to do a live demo and let you guys give me commands, but then I realized that somebody would want to run that and then it would be over.

23:51.880 --> 23:59.600
And APIs make it really easy to use one or two or eight services to do bad stuff.

23:59.600 --> 24:11.860
And to do bad stuff in a way that has built in TLS, built in IDS evasion, and is just genuinely hard to detect with traditional things.

24:12.180 --> 24:15.820
As is customary, I also want to do props and slops.

24:15.820 --> 24:18.880
Props to Slack for having a super easy to use REST API.

24:19.320 --> 24:21.800
And props to Facebook.

24:21.800 --> 24:25.000
Because I tried to use Facebook instead of Slack.

24:25.620 --> 24:30.140
And they made it really, really difficult to build a chat bot that abuses their TLS.

24:30.840 --> 24:34.080
It's an absolute nightmare to use.

24:34.080 --> 24:36.340
And it requires you to jump through way too many hoops.

24:36.340 --> 24:37.740
So, I just didn't do it.

24:38.200 --> 24:41.200
You probably could, if anybody here is determined.

24:41.200 --> 24:43.560
You can definitely... it's possible.

24:43.560 --> 24:44.720
It just sucks.

24:44.720 --> 24:46.660
And, like, they'll kill it.

24:48.100 --> 24:51.220
Props to Polsack, Coalfire, Trend Micro.

24:51.500 --> 24:55.180
And anybody who sat through this whole presentation is like, yeah, obviously, idiot.

24:55.180 --> 24:57.180
You can use Slack for C&C.

24:57.900 --> 25:03.620
And props to Jenko, who took a seat from somebody in the hallway because he doesn't love or care about you.

25:03.620 --> 25:05.580
Who made the timeline for this graphic.

25:05.580 --> 25:11.500
And a paper that we're releasing about a related topic made it far nicer.

25:11.500 --> 25:13.780
Because my original one was hideous.

25:14.620 --> 25:19.020
Also, slops to Slack for having a really easy to abuse REST API.

25:21.520 --> 25:33.300
Somebody, maybe not in this room, because now you are the enlightened few, is going to have a really nasty piece of malware, which is probably going to be Emotet, because it's always freaking Emotet.

25:33.300 --> 25:34.640
They're so good.

25:34.640 --> 25:37.680
If any of you know the Emotet authors, please introduce me.

25:37.680 --> 25:39.580
I want to meet them so bad.

25:41.280 --> 25:41.800
Right?

25:41.880 --> 25:52.620
Somebody's going to get popped with malware and it's going to use Slack and it's going to go undetected for like 230 days and a CISO is going to get fired and they're going to be like, oh, my God, it ruined our TDR.

25:53.140 --> 25:53.840
Whatever.

25:54.960 --> 25:56.400
You've all been warned.

25:57.440 --> 26:01.820
Slops to Facebook for making it really hard for me to have a chatbot that abuses their TOS.

26:01.860 --> 26:04.580
I really wanted to use Facebook Messenger.

26:04.580 --> 26:09.360
There were allegedly people coming here who are from Facebook.

26:09.840 --> 26:13.840
Maybe none of you made it because you heard that I wasn't doing it anymore.

26:13.840 --> 26:14.860
I don't know.

26:15.560 --> 26:17.620
But, yeah, that really sucked and was really frustrating.

26:17.620 --> 26:26.740
And slops to my cat, Dasha, who spilled coffee on my keyboard when I was trying to write the malware and cost me like an hour drying out my laptop.

26:26.780 --> 26:28.240
That really sucked.

26:28.780 --> 26:31.000
So, thank you all for listening to my talk.

26:31.000 --> 26:33.200
That's my Twitter and my personal blog.

26:33.200 --> 26:35.140
We also have a blog at Netsco.

26:36.560 --> 26:37.140
That's it.

26:37.140 --> 26:37.520
That's all.

26:37.520 --> 26:38.360
You can applaud now.

26:38.360 --> 26:38.960
Thank you.

