1 00:00:00,000 --> 00: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. 2 00:00:11,080 --> 00:00:16,600 Just to give a little bit of background on you, my name, on you, on me, my name is Eric Lincoln. 3 00:00:16,600 --> 00:00:18,640 I'm a threat researcher at Netscope. 4 00:00:18,640 --> 00:00:21,480 I study applied mathematics at Johns Hopkins University. 5 00:00:21,820 --> 00:00:29,420 I wear some lib t-shirts because I'm not allowed to talk about politics in this presentation. 6 00:00:30,240 --> 00:00:31,760 So why am I here? 7 00:00:32,320 --> 00:00:34,860 Well, I'm here because I think a lot about malware. 8 00:00:35,080 --> 00:00:39,760 And I think a lot about what malware authors are going to do. 9 00:00:40,800 --> 00:00:43,120 And, right, so what motivates malware authors? 10 00:00:43,120 --> 00:00:44,940 They don't want to get caught, right? 11 00:00:44,940 --> 00:00:46,100 That's the number one thing. 12 00:00:46,100 --> 00:00:49,060 If you have malware on a system, you probably don't want to get caught. 13 00:00:49,060 --> 00:00:50,960 Of course, there are exceptions, you know. 14 00:00:51,220 --> 00:00:54,100 But for the most part, you want to be surreptitious. 15 00:00:54,280 --> 00:00:55,700 So how do you avoid detection? 16 00:00:55,700 --> 00:00:57,540 You blend in, right? 17 00:00:57,600 --> 00: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? 18 00:01:10,560 --> 00: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? 19 00:01:23,120 --> 00: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? 20 00:01:36,960 --> 00: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. 21 00:01:45,260 --> 00:01:50,760 And that made it really, really hard for me at the time to write IDS rules to mitigate it. 22 00:01:51,940 --> 00:01:58,380 So before we really dive into the meat of it, why do people even use SaaS applications, right? 23 00:01:58,380 --> 00:02:00,120 We have software as a service. 24 00:02:00,120 --> 00:02:05,780 I'm willing to bet that everyone here has some authorized SaaS application in their enterprise. 25 00:02:05,780 --> 00:02:07,440 So what's it good for, right? 26 00:02:07,740 --> 00:02:11,640 I mean, you don't manage the physical infrastructure. 27 00:02:11,640 --> 00:02:12,960 It's patched for you. 28 00:02:12,960 --> 00:02:14,760 Users can use it from everywhere. 29 00:02:15,580 --> 00:02:16,860 It's easy. 30 00:02:16,860 --> 00:02:17,660 It's cheap. 31 00:02:17,660 --> 00:02:18,760 It's effective. 32 00:02:18,760 --> 00:02:21,240 And it's growing, right? 33 00:02:21,320 --> 00:02:22,960 Small companies are using it. 34 00:02:22,960 --> 00:02:24,580 Large companies are using it. 35 00:02:24,580 --> 00:02:27,740 G Suite, Slack, Dropbox, Box. 36 00:02:27,740 --> 00:02:30,240 You name it, someone is using it, right? 37 00:02:30,480 --> 00:02:34,340 And so it's everywhere and it's easy. 38 00:02:35,140 --> 00:02:41,780 A minor digression is I've had a lot of debate about is social media SaaS, right? 39 00:02:41,780 --> 00:02:43,580 Is social media software as a service? 40 00:02:44,820 --> 00:02:46,620 Salesforce thinks so. 41 00:02:46,620 --> 00:02:47,980 I think so. 42 00:02:47,980 --> 00:02:51,640 If you disagree, then you're wrong. 43 00:02:52,680 --> 00:02:53,840 I'm so sorry. 44 00:02:53,840 --> 00:02:55,060 You're wrong. 45 00:02:55,540 --> 00:02:57,700 So Reddit is SaaS and Facebook is SaaS. 46 00:02:57,700 --> 00:03:01,000 And again, that's not up for discussion. 47 00:03:01,380 --> 00:03:03,940 So is SaaS good for security? 48 00:03:03,940 --> 00:03:07,240 And the answer is a resounding maybe, right? 49 00:03:07,420 --> 00:03:10,580 In some sense, you want to offload your risks to a third party. 50 00:03:10,580 --> 00: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. 51 00:03:22,000 --> 00:03:27,000 So it decreases the attack surface of your actual enterprise network. 52 00:03:27,260 --> 00:03:33,520 And also, right, capitalism, because we live in a society, incentivizes protecting your stuff. 53 00:03:33,520 --> 00:03:38,820 If somebody is really, really bad at protecting your data, you're not going to trust them with it, right? 54 00:03:38,820 --> 00:03:41,320 You're not going to pay them money to do it. 55 00:03:41,320 --> 00:03:43,760 That's kind of how the market works. 56 00:03:45,260 --> 00:03:49,300 So does having a bunch of whitelisted services decrease your visibility? 57 00:03:50,360 --> 00:03:51,500 Yeah, right? 58 00:03:51,500 --> 00:03:55,500 You have a bunch of network traffic outbound that you assume is good. 59 00:03:55,500 --> 00:03:57,640 You're not inspecting that traffic. 60 00:03:57,660 --> 00:03:59,620 Not in any meaningful way. 61 00:03:59,860 --> 00:04:01,140 So yeah. 62 00:04:01,140 --> 00:04:03,280 It's a land of contrasts. 63 00:04:04,280 --> 00:04:06,880 So we'll start with a blue team perspective, right? 64 00:04:07,900 --> 00:04:11,760 I do want to start with a caveat that other people are much better at this than I am. 65 00:04:11,760 --> 00: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. 66 00:04:22,720 --> 00:04:24,920 And they're better than I am. 67 00:04:24,920 --> 00:04:26,940 So if you saw those talks, good for you. 68 00:04:26,940 --> 00:04:28,400 Otherwise, they're recorded. 69 00:04:30,040 --> 00:04:31,940 So I've got a timeline here. 70 00:04:31,940 --> 00:04:35,260 And you can't read it because the text is super tiny. 71 00:04:35,260 --> 00:04:37,820 So I'm just displaying it so I can talk about it. 72 00:04:37,820 --> 00:04:42,260 But basically, we've got kind of different phases of the cyber kill chain. 73 00:04:42,260 --> 00:04:43,580 You've got your actions on objectives. 74 00:04:43,580 --> 00:04:46,680 You've got command and control, delivery and exploitation. 75 00:04:46,860 --> 00: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? 76 00:05:01,060 --> 00:05:05,360 So you have Google App Engine being used for command and control. 77 00:05:05,820 --> 00:05:09,780 Using EC2 all the way back in 2009, right? 78 00:05:09,780 --> 00: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? 79 00:05:25,540 --> 00: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? 80 00:05:39,400 --> 00:05:42,300 So these things are happening. 81 00:05:42,780 --> 00: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? 82 00:05:49,560 --> 00:05:53,700 So it's being used by cyber criminals, APTs. 83 00:05:54,100 --> 00:05:57,060 It's being used by everybody. 84 00:05:57,060 --> 00:05:59,080 And it's only getting easier. 85 00:06:00,860 --> 00:06:06,760 And part of the reason for that is, if you think about domain generation algorithms, right? 86 00:06:06,760 --> 00: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? 87 00:06:14,740 --> 00:06:16,620 And that was back in 2008. 88 00:06:16,620 --> 00:06:25,200 So in the last 11 years, we've written over 22,500 academic papers. 89 00:06:25,200 --> 00:06:31,940 That's not blog posts and Medium posts and, like, shitty things you wrote and marked down but never published. 90 00:06:31,940 --> 00:06:35,300 These are academic papers that are on Google Scholar, right? 91 00:06:35,300 --> 00:06:38,260 This is a well-researched, well-trodden topic. 92 00:06:38,360 --> 00:06:45,100 And if you've spent any time in malware analysis or blue teaming, some of these names are familiar. 93 00:06:45,100 --> 00:06:47,000 You may have heard of Conficker. 94 00:06:47,000 --> 00:06:49,320 You may have heard of the Zeus botnet. 95 00:06:49,320 --> 00:06:51,520 Those are things you might have heard of. 96 00:06:51,700 --> 00:06:54,980 Or if you're new, you probably haven't, and that's fine. 97 00:06:55,200 --> 00:06:58,320 So we've spent a lot of time on domain generation algorithms, right? 98 00:06:58,360 --> 00:07:03,620 And we've spent a lot of resources researching how to detect domain generation algorithms. 99 00:07:04,800 --> 00:07:07,380 And what's the point of a domain generation algorithm? 100 00:07:07,440 --> 00:07:12,420 It's to make sure that you can't blacklist a domain and kill the CNC, right? 101 00:07:12,420 --> 00:07:16,260 It's to evade IDS detection that depends on the domain. 102 00:07:16,280 --> 00:07:18,360 It's to evade firewalls. 103 00:07:18,880 --> 00: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. 104 00:07:28,960 --> 00:07:31,500 You can just use API.slack.com, right? 105 00:07:31,820 --> 00: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. 106 00:07:44,680 --> 00: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. 107 00:07:52,580 --> 00:07:54,060 We being Netscope. 108 00:07:54,560 --> 00: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? 109 00:08:06,980 --> 00:08:12,380 It would upload them to file.io, which doesn't require any authentication or API keys, right? 110 00:08:13,000 --> 00:08:18,020 And there are really good blog posts about this if you're interested in the technical details of Slub. 111 00:08:19,900 --> 00: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. 112 00:08:33,980 --> 00:08:35,680 And they use Slack a lot more. 113 00:08:35,680 --> 00:08:39,740 So they use Slack for passing commands and for returning responses. 114 00:08:40,120 --> 00:08:41,840 And it's a beautiful piece of malware. 115 00:08:41,840 --> 00:08:42,520 It really is. 116 00:08:42,520 --> 00:08:48,480 If you don't love malware, you're probably at the wrong conference, honestly. 117 00:08:49,440 --> 00:08:49,860 Right. 118 00:08:49,860 --> 00:08:52,860 So why was Slub so effective, okay? 119 00:08:53,400 --> 00:08:56,180 It used a bunch of different SaaS services, right? 120 00:08:56,180 --> 00:09:00,140 And file.io in particular is an anonymous upload. 121 00:09:00,140 --> 00:09:01,560 So it just uploads it. 122 00:09:01,560 --> 00:09:02,680 It doesn't ask you for a key . 123 00:09:02,680 --> 00:09:03,960 You don't log in. 124 00:09:03,960 --> 00:09:04,960 There's nothing. 125 00:09:04,960 --> 00: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. 126 00:09:16,240 --> 00:09:17,080 And that's it. 127 00:09:17,080 --> 00:09:18,300 That's the API. 128 00:09:18,320 --> 00:09:20,400 File.io slash upload. 129 00:09:20,880 --> 00:09:21,700 That's all. 130 00:09:21,700 --> 00:09:22,720 Just a post. 131 00:09:23,360 --> 00:09:24,920 So that's really hard to detect, right? 132 00:09:24,920 --> 00:09:27,400 Unless you're looking at the content of the payload. 133 00:09:28,460 --> 00:09:35,840 And of course, looking at the content of the payload is difficult because all of these things have TLS, right? 134 00:09:35,860 --> 00:09:42,760 That's one of the other beauties of SaaS services as CNC is that they all provide TLS by default. 135 00:09:42,760 --> 00: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. 136 00:09:48,940 --> 00:09:53,520 It just uses Dropbox, file.io, whoever. 137 00:09:53,520 --> 00:09:55,780 It uses their TLS cert. 138 00:09:57,580 --> 00:09:59,060 And again, it's sneaky. 139 00:09:59,060 --> 00:10:00,480 It looks like API calls. 140 00:10:00,480 --> 00:10:05,080 API calls to legitimate websites don't look like CNC traffic. 141 00:10:05,080 --> 00:10:08,900 So you're not going to blacklist these domains, you're not going to blacklist these IPs. 142 00:10:09,300 --> 00:10:14,880 And if you write an IDS signature, you're probably not going to key off of that. 143 00:10:14,880 --> 00:10:17,960 You're going to have to key off of something in the content of the body, right? 144 00:10:18,440 --> 00: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. 145 00:10:25,980 --> 00:10:27,860 Which not everybody does. 146 00:10:29,120 --> 00:10:31,820 So how do you defend against SaaSy malware? 147 00:10:32,260 --> 00:10:34,880 Well, DLP solutions are pretty good. 148 00:10:34,920 --> 00: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. 149 00:10:49,780 --> 00:10:51,040 It's probably not good. 150 00:10:51,040 --> 00:10:52,340 And you'll get an alert. 151 00:10:53,720 --> 00:10:59,020 Careful monitoring of traffic, which is really just a generic thing that doesn't mean anything. 152 00:10:59,020 --> 00:11:04,540 I'm just saying it so that I cover my ass when one of you asks me what about IDS. 153 00:11:05,680 --> 00:11:09,040 Aggressive user education, right? 154 00:11:09,040 --> 00:11:15,140 Not just, like, don't click links unless you trust them. 155 00:11:15,140 --> 00:11:19,280 But, like, ask yourself why you trust a link. 156 00:11:19,280 --> 00:11:27,520 If you're clicking a link that was messaged to you in Slack that goes to a Dropbox, maybe make sure. 157 00:11:28,560 --> 00:11:31,100 And then, of course, endpoint detection, right? 158 00:11:31,100 --> 00:11:35,500 Endpoint detection doesn't care what method you use for command and control. 159 00:11:35,500 --> 00:11:38,140 It just cares about whether or not it's detecting the malware. 160 00:11:38,280 --> 00: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? 161 00:11:54,500 --> 00:11:56,320 So, that's a good way to do it. 162 00:11:57,040 --> 00: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. 163 00:12:06,100 --> 00: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? 164 00:12:18,920 --> 00: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. 165 00:12:27,780 --> 00:12:32,940 We've got FTPD running, but this isn't an FTP server. 166 00:12:33,180 --> 00:12:34,220 What do you do? 167 00:12:34,800 --> 00:12:37,080 You kill FTPD forever. 168 00:12:37,300 --> 00:12:41,380 You block port 24, 3, 4, shit, whatever. 169 00:12:41,380 --> 00:12:42,600 You know what I mean. 170 00:12:43,200 --> 00:12:44,540 It's been a long day. 171 00:12:44,540 --> 00:12:46,120 I yelled at most of you. 172 00:12:47,020 --> 00:12:50,100 But the point is, you block that port, you kill that service. 173 00:12:50,100 --> 00:12:54,700 If you don't run Dropbox in your enterprise, don't let people use Dropbox. 174 00:12:55,320 --> 00:12:56,520 Right? 175 00:12:56,660 --> 00:13:01,200 What personal Dropbox do they need to use for your corporate files? 176 00:13:01,200 --> 00: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. 177 00:13:13,700 --> 00:13:16,560 Because it will screw you. 178 00:13:17,700 --> 00:13:20,340 Now, for the more fun part, right? 179 00:13:20,340 --> 00: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? 180 00:13:31,920 --> 00:13:37,060 Well, as always, getting in is the hard part, right? 181 00:13:37,060 --> 00: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. 182 00:13:44,700 --> 00:13:47,940 This is Tom Petty on the Heartbreakers, yeah. 183 00:13:48,740 --> 00:13:51,280 But how do you get in in the first place? 184 00:13:51,280 --> 00:13:58,200 You abuse lax IAM permissions, you force logins, social engineering, old-fashioned exploitation, you know? 185 00:13:59,400 --> 00:14:01,420 Endpoints have vulnerabilities. 186 00:14:01,420 --> 00:14:02,820 People don't patch everything. 187 00:14:02,820 --> 00:14:09,120 People run, like, ancient versions of VLC, which is so weird. 188 00:14:09,120 --> 00:14:10,960 People run just the weirdest stuff. 189 00:14:10,960 --> 00:14:15,680 Somebody had FileZilla open, like, two months ago? 190 00:14:15,840 --> 00:14:17,200 Why? 191 00:14:17,760 --> 00:14:19,400 I don't know. 192 00:14:19,500 --> 00:14:26,920 And then you've got whatever blue you want, because people still haven't patched MS17010. 193 00:14:27,160 --> 00: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. 194 00:14:34,700 --> 00:14:39,300 The whole conference, the state of Nevada, go home and patch it. 195 00:14:40,500 --> 00:14:42,440 It's been two years. 196 00:14:43,820 --> 00:14:44,860 Right? 197 00:14:44,920 --> 00:14:49,920 And so, then once you have the access, then you can get by IDS, right? 198 00:14:49,940 --> 00:14:53,320 And you can pull your tools from Dropbox. 199 00:14:53,320 --> 00:14:55,360 You can pull your tools from S3. 200 00:14:55,360 --> 00:14:57,480 You can pull scripts from Pastebin. 201 00:14:57,540 --> 00:14:58,220 Seriously. 202 00:14:58,220 --> 00:15:07,360 Just put the Python in Pastebin and make a curl request to the raw and then pipe it to Python. 203 00:15:07,360 --> 00:15:08,640 It's that easy. 204 00:15:08,780 --> 00:15:10,320 And it runs and it works. 205 00:15:10,320 --> 00:15:12,300 And I don't know. 206 00:15:12,620 --> 00:15:16,940 Some people aren't mitigating this in any way, shape, or form, and it's nuts. 207 00:15:17,840 --> 00:15:18,760 And GitHub. 208 00:15:18,760 --> 00:15:26,300 GitHub is such an underutilized way to abuse trust relationships that companies have. 209 00:15:26,480 --> 00: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. 210 00:15:38,280 --> 00:15:40,680 Nobody's blocking GitHub traffic, right? 211 00:15:40,680 --> 00:15:43,000 Because what if it breaks your Jenkins pipeline? 212 00:15:44,700 --> 00:15:47,560 Yeah, that one guy found it funny. 213 00:15:47,560 --> 00:15:48,100 That was good. 214 00:15:48,100 --> 00:15:48,860 Thank you. 215 00:15:48,860 --> 00:15:50,040 You specifically. 216 00:15:50,620 --> 00:15:53,720 But seriously, you can just pull code. 217 00:15:53,720 --> 00:15:55,320 You can pull whatever from GitHub. 218 00:15:55,320 --> 00:15:57,080 And if you have file storage, forget about it. 219 00:15:57,080 --> 00:15:57,960 You can pull executables. 220 00:15:57,960 --> 00:15:59,940 You can do whatever you want, right? 221 00:16:02,380 --> 00:16:03,720 Nobody gets this one. 222 00:16:03,720 --> 00:16:04,540 That's okay. 223 00:16:05,160 --> 00:16:07,720 Carole King had a song called I Can't Hear You No More. 224 00:16:07,920 --> 00:16:08,780 It's fine. 225 00:16:09,380 --> 00:16:14,500 And then there's tried and true techniques for doing exfiltration over these sorts of services, right? 226 00:16:14,740 --> 00:16:21,140 You make a draft email in Gmail and attach something to it, but you don't send it. 227 00:16:21,140 --> 00:16:25,840 So, it never trips like an ESA, which is something I wasn't supposed to say. 228 00:16:26,800 --> 00:16:29,920 You know, Slack has an upload feature. 229 00:16:29,920 --> 00:16:31,600 Twitter, Dropbox, whatever. 230 00:16:31,600 --> 00:16:35,780 You can send data over these things, and they are usually trusted. 231 00:16:35,780 --> 00: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. 232 00:16:44,520 --> 00:16:51,080 It is a great way for you as a red teamer to exfiltrate data in a way that is super surreptitious. 233 00:16:52,120 --> 00:16:55,360 And one more thing I wanted to talk about. 234 00:16:55,740 --> 00:16:58,120 Before I talk about it, I do want to pay homage. 235 00:16:59,060 --> 00:17:00,600 This is not new. 236 00:17:00,900 --> 00:17:02,440 People have done this before. 237 00:17:02,480 --> 00:17:04,740 I am just demoing my version of it. 238 00:17:05,100 --> 00:17:11,880 So, Gcat, Twitter, Slackor, Slub, all did this really well, right? 239 00:17:12,440 --> 00:17:15,860 Slackor in particular is real nice. 240 00:17:16,180 --> 00:17:17,560 Coalfire put that out. 241 00:17:17,560 --> 00:17:19,580 So, huge props to them. 242 00:17:20,220 --> 00: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. 243 00:17:29,340 --> 00:17:30,620 It is really good. 244 00:17:31,720 --> 00:17:33,440 It was fun to reverse. 245 00:17:33,440 --> 00:17:35,780 It was fun to reverse the second time. 246 00:17:36,980 --> 00:17:39,860 It was a real friend, you know? 247 00:17:40,420 --> 00:17:48,180 So, I want to demonstrate something that we have been calling sassy boy, which is I've got this shirt. 248 00:17:48,640 --> 00:17:51,520 That guy has a shirt, too, because he works with me. 249 00:17:53,540 --> 00:17:58,480 And I'm going to pause it like six times, and you probably can't see it. 250 00:17:58,500 --> 00:18:01,780 So, I'm really sorry, which is why I'm going to talk you through it. 251 00:18:02,200 --> 00:18:04,780 So, let's do that. 252 00:18:04,780 --> 00:18:05,400 Okay. 253 00:18:06,260 --> 00:18:06,840 Right. 254 00:18:06,840 --> 00:18:09,260 So, we run the oh, Jesus. 255 00:18:09,380 --> 00:18:09,640 Okay. 256 00:18:09,640 --> 00:18:10,440 There we go. 257 00:18:10,440 --> 00:18:11,900 So, we run the agent. 258 00:18:12,080 --> 00:18:12,640 Okay. 259 00:18:13,560 --> 00:18:16,100 And this is not full screened. 260 00:18:16,100 --> 00:18:17,420 Not well enough. 261 00:18:18,280 --> 00:18:19,400 That's fine. 262 00:18:19,820 --> 00:18:20,580 Right? 263 00:18:21,180 --> 00:18:27,360 And so, you can see on the right, we've got our Slack, and on the left, we have a terminal. 264 00:18:27,640 --> 00:18:33,660 And in real life, your malware is not going to be so cooperative and provide you with a terminal. 265 00:18:34,460 --> 00:18:37,880 But I have done it so that I can know when things start and end. 266 00:18:38,020 --> 00:18:40,700 Also, because I like recording my screen this way. 267 00:18:41,300 --> 00:18:42,980 So, play. 268 00:18:43,100 --> 00:18:44,020 There we go. 269 00:18:44,080 --> 00:18:44,400 Right? 270 00:18:44,400 --> 00:18:45,420 So, we run the agent. 271 00:18:45,420 --> 00:18:46,000 Okay? 272 00:18:46,300 --> 00:18:51,820 And the first thing that happens is it checks in here, and it tells you some basic information. 273 00:18:51,820 --> 00:18:56,380 So, down at the bottom, which you can't read, and I should have tried this on a big screen. 274 00:18:56,480 --> 00:18:58,780 It says current user is not admin. 275 00:18:58,800 --> 00:19:00,300 Username is Eagle Lincoln. 276 00:19:00,500 --> 00:19:02,520 Mac scope.local. 277 00:19:03,360 --> 00:19:07,060 So, what's it doing? 278 00:19:07,060 --> 00: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. 279 00:19:15,200 --> 00:19:18,820 And you see, we pop calc, because you have to. 280 00:19:20,240 --> 00:19:24,300 It did download the actual calc.app and run it. 281 00:19:24,940 --> 00:19:27,060 So, it is downloading and executing code. 282 00:19:28,760 --> 00:19:30,660 That's just a law of demos. 283 00:19:30,660 --> 00:19:34,220 If anybody gave you a demo today and didn't pop calc, they're fired. 284 00:19:36,220 --> 00:19:37,040 Right? 285 00:19:37,040 --> 00:19:38,520 And so, then what did it do? 286 00:19:38,980 --> 00:19:40,240 It listed this directory. 287 00:19:40,240 --> 00:19:43,320 It listed the current directory that it's running out of. 288 00:19:43,500 --> 00:19:47,440 Because I'm lazy and didn't want to move it around or compile it into an executable. 289 00:19:47,440 --> 00:19:48,960 But you can do that with pants. 290 00:19:49,420 --> 00:19:50,780 Or whatever you want. 291 00:19:51,760 --> 00:19:53,100 So, what do we have here? 292 00:19:53,100 --> 00:19:53,580 Right? 293 00:19:53,580 --> 00:19:55,140 We've got some stuff. 294 00:19:55,380 --> 00:19:56,380 And then we're gonna give it a command. 295 00:19:56,380 --> 00:19:57,960 We're gonna tell it to list dir. 296 00:19:58,060 --> 00:20:00,180 We're gonna have it list our home directory. 297 00:20:00,180 --> 00:20:01,540 Users, Eagle Lincoln. 298 00:20:01,780 --> 00:20:04,240 And it takes a couple seconds to think about it. 299 00:20:05,680 --> 00:20:06,860 And then it comes back. 300 00:20:06,860 --> 00:20:07,500 Right? 301 00:20:07,580 --> 00:20:12,240 And we've got a bunch of files and directories there, because I don't keep my home dir clean. 302 00:20:12,520 --> 00:20:15,180 But we have one in particular that's pretty neat. 303 00:20:15,400 --> 00:20:17,280 And that's .ssh. 304 00:20:18,180 --> 00:20:22,060 I'm assuming that everyone here knows what lives in .ssh. 305 00:20:22,700 --> 00:20:31,040 So, we're gonna go ahead and upload our SSH private key to Dropbox. 306 00:20:31,380 --> 00:20:33,940 All we pass it... right? 307 00:20:34,000 --> 00:20:37,680 So, this... all of this functionality is not hardcoded. 308 00:20:37,680 --> 00:20:45,020 We're passing it a path for a file and we're passing it an OAuth key for Dropbox. 309 00:20:45,020 --> 00:20:47,480 The Dropbox is not hardcoded. 310 00:20:47,960 --> 00:20:55,640 The only thing that lives in the malware is the upload API call for Dropbox. 311 00:20:56,760 --> 00:21:01,280 And then it creates a folder called max scope, which is the name of the computer. 312 00:21:01,860 --> 00:21:04,700 And hey, there's my RSA private key. 313 00:21:04,700 --> 00:21:05,280 Right? 314 00:21:05,660 --> 00:21:06,880 And we love it. 315 00:21:07,040 --> 00:21:08,420 And yeah. 316 00:21:08,420 --> 00:21:10,400 I'm not gonna show you my RSA private key. 317 00:21:10,400 --> 00:21:11,420 I thought about it. 318 00:21:11,420 --> 00:21:15,600 And then I remembered that that's my actual production laptop for work. 319 00:21:16,320 --> 00:21:19,820 That would be a mistake to display at DEF CON. 320 00:21:21,320 --> 00:21:23,460 Yeah, there would be like 45 people taking pictures. 321 00:21:23,620 --> 00:21:23,820 Right? 322 00:21:23,820 --> 00:21:25,600 And then we tell it destroy. 323 00:21:25,940 --> 00:21:28,900 And then when it destroys, it kills the whole thing. 324 00:21:29,080 --> 00:21:29,960 So, it just dies. 325 00:21:29,960 --> 00:21:30,380 That's it. 326 00:21:30,380 --> 00:21:31,320 That's the whole demo. 327 00:21:33,480 --> 00:21:34,480 Thank you. 328 00:21:35,560 --> 00:21:36,580 Thank you. 329 00:21:38,580 --> 00:21:39,300 Right? 330 00:21:39,300 --> 00:21:40,840 So, code is available. 331 00:21:40,900 --> 00:21:42,700 That's not the correct address anymore. 332 00:21:42,700 --> 00:21:45,340 It's at net scope OSS. 333 00:21:45,440 --> 00:21:46,680 I can modify it. 334 00:21:46,680 --> 00:21:47,640 I'll make it available. 335 00:21:47,640 --> 00:21:50,160 We have a blog post that links to the code, too. 336 00:21:50,160 --> 00:21:53,660 Net scope OSS slash sassy underscore boy. 337 00:21:53,780 --> 00:21:55,620 S-A-A-S-Y. 338 00:21:58,360 --> 00:22:00,860 But I've open sourced the whole thing. 339 00:22:00,860 --> 00:22:03,000 You can see my crappy Python. 340 00:22:04,060 --> 00:22:09,620 And you can run it and you can test your own security stuff against it and see what your logs say. 341 00:22:10,160 --> 00:22:12,300 Which is why I'm opening it. 342 00:22:12,440 --> 00:22:21,850 My caveat is it ran on my Mac, it ran on my Windows VM, and it ran on my Linux installation. 343 00:22:22,380 --> 00:22:25,820 I am not promising it will work on yours. 344 00:22:25,820 --> 00:22:32,500 Whatever your environment looks like, I hope it works. 345 00:22:32,500 --> 00:22:33,140 Or not. 346 00:22:33,140 --> 00:22:35,280 I hope it doesn't work if you don't want this running. 347 00:22:35,280 --> 00:22:36,060 Right? 348 00:22:36,060 --> 00:22:39,020 Anyway, what have we learned? 349 00:22:39,020 --> 00:22:39,280 Right? 350 00:22:39,280 --> 00:22:43,340 You guys sat here and listened to me talk for however long it's been. 351 00:22:43,760 --> 00:22:45,220 So, what have we learned? 352 00:22:45,220 --> 00:22:45,580 Right? 353 00:22:45,580 --> 00:22:47,780 What are the lessons you should take away? 354 00:22:48,520 --> 00:22:51,960 SaaS applications can increase your attack surface. 355 00:22:52,040 --> 00: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. 356 00:23:02,000 --> 00: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. 357 00:23:11,520 --> 00:23:14,640 SaaS applications move data very surreptitiously. 358 00:23:15,240 --> 00: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? 359 00:23:25,200 --> 00:23:28,020 And it uses Twitter, too, that's another thing it does. 360 00:23:28,020 --> 00:23:29,600 It's got fallback methods. 361 00:23:31,560 --> 00:23:32,740 I gotcha. 362 00:23:34,500 --> 00:23:35,780 But it opens a reverse shell. 363 00:23:35,780 --> 00:23:37,120 You can run whatever command you want. 364 00:23:37,120 --> 00:23:41,260 If you want to RMRF slash, go for it. 365 00:23:41,440 --> 00:23:42,820 I'm not doing it. 366 00:23:42,960 --> 00: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. 367 00:23:51,880 --> 00:23:59,600 And APIs make it really easy to use one or two or eight services to do bad stuff. 368 00:23:59,600 --> 00: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. 369 00:24:12,180 --> 00:24:15,820 As is customary, I also want to do props and slops. 370 00:24:15,820 --> 00:24:18,880 Props to Slack for having a super easy to use REST API. 371 00:24:19,320 --> 00:24:21,800 And props to Facebook. 372 00:24:21,800 --> 00:24:25,000 Because I tried to use Facebook instead of Slack. 373 00:24:25,620 --> 00:24:30,140 And they made it really, really difficult to build a chat bot that abuses their TLS. 374 00:24:30,840 --> 00:24:34,080 It's an absolute nightmare to use. 375 00:24:34,080 --> 00:24:36,340 And it requires you to jump through way too many hoops. 376 00:24:36,340 --> 00:24:37,740 So, I just didn't do it. 377 00:24:38,200 --> 00:24:41,200 You probably could, if anybody here is determined. 378 00:24:41,200 --> 00:24:43,560 You can definitely... it's possible. 379 00:24:43,560 --> 00:24:44,720 It just sucks. 380 00:24:44,720 --> 00:24:46,660 And, like, they'll kill it. 381 00:24:48,100 --> 00:24:51,220 Props to Polsack, Coalfire, Trend Micro. 382 00:24:51,500 --> 00:24:55,180 And anybody who sat through this whole presentation is like, yeah, obviously, idiot. 383 00:24:55,180 --> 00:24:57,180 You can use Slack for C&C. 384 00:24:57,900 --> 00: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. 385 00:25:03,620 --> 00:25:05,580 Who made the timeline for this graphic. 386 00:25:05,580 --> 00:25:11,500 And a paper that we're releasing about a related topic made it far nicer. 387 00:25:11,500 --> 00:25:13,780 Because my original one was hideous. 388 00:25:14,620 --> 00:25:19,020 Also, slops to Slack for having a really easy to abuse REST API. 389 00:25:21,520 --> 00: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. 390 00:25:33,300 --> 00:25:34,640 They're so good. 391 00:25:34,640 --> 00:25:37,680 If any of you know the Emotet authors, please introduce me. 392 00:25:37,680 --> 00:25:39,580 I want to meet them so bad. 393 00:25:41,280 --> 00:25:41,800 Right? 394 00:25:41,880 --> 00: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. 395 00:25:53,140 --> 00:25:53,840 Whatever. 396 00:25:54,960 --> 00:25:56,400 You've all been warned. 397 00:25:57,440 --> 00:26:01,820 Slops to Facebook for making it really hard for me to have a chatbot that abuses their TOS. 398 00:26:01,860 --> 00:26:04,580 I really wanted to use Facebook Messenger. 399 00:26:04,580 --> 00:26:09,360 There were allegedly people coming here who are from Facebook. 400 00:26:09,840 --> 00:26:13,840 Maybe none of you made it because you heard that I wasn't doing it anymore. 401 00:26:13,840 --> 00:26:14,860 I don't know. 402 00:26:15,560 --> 00:26:17,620 But, yeah, that really sucked and was really frustrating. 403 00:26:17,620 --> 00: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. 404 00:26:26,780 --> 00:26:28,240 That really sucked. 405 00:26:28,780 --> 00:26:31,000 So, thank you all for listening to my talk. 406 00:26:31,000 --> 00:26:33,200 That's my Twitter and my personal blog. 407 00:26:33,200 --> 00:26:35,140 We also have a blog at Netsco. 408 00:26:36,560 --> 00:26:37,140 That's it. 409 00:26:37,140 --> 00:26:37,520 That's all. 410 00:26:37,520 --> 00:26:38,360 You can applaud now. 411 00:26:38,360 --> 00:26:38,960 Thank you.