1 00:00:00,000 --> 00:00:01,500 All right, good morning. 2 00:00:01,660 --> 00:00:06,200 Thank you for coming out to the inaugural year of the Red Team Village. 3 00:00:06,800 --> 00:00:09,140 Hoping to have many, many, many more years. 4 00:00:09,160 --> 00:00:17,040 We tried to dedicate a lot of space, so we ended up getting a little bit more space, but we tried to dedicate at least 30 plus percent of that space to T.O.P.S. 5 00:00:17,040 --> 00:00:22,400 because we have so many amazing people in the red space field. 6 00:00:23,260 --> 00:00:26,800 And you had to go to all these different places to hear them and talk to them. 7 00:00:26,800 --> 00:00:30,260 So, we've got an amazing lineup of different folks. 8 00:00:30,440 --> 00:00:30,740 Mr. 9 00:00:30,740 --> 00:00:33,500 Charles Herring, he's got an immense background. 10 00:00:35,460 --> 00:00:37,720 You want to talk about me? 11 00:00:37,720 --> 00:00:38,880 There's a whole slide about me. 12 00:00:38,880 --> 00:00:40,080 It's my favorite topic. 13 00:00:40,080 --> 00:00:43,300 We're just going to do the whole hour about me. 14 00:00:43,840 --> 00:00:44,840 It's all about me. 15 00:00:44,840 --> 00:00:46,060 Anyway, well, thank you. 16 00:00:46,060 --> 00:00:48,080 Please give him a warm applause. 17 00:00:54,560 --> 00:00:59,880 We're going to do about 45-50 minutes and then we'll do some Q&A after that. 18 00:00:59,880 --> 00:01:08,900 If you have any questions along the way, feel free to shoot a hand up and I will answer the question because that gives me an opportunity to drink my water. 19 00:01:09,660 --> 00:01:13,400 If you want the deck, Twitter at Charles Herring, charlesherring.com. 20 00:01:13,400 --> 00:01:14,300 We'll shoot you to LinkedIn. 21 00:01:14,300 --> 00:01:17,400 You can grab this deck from either one of those places. 22 00:01:17,400 --> 00:01:19,020 It's uploaded to CDN. 23 00:01:19,120 --> 00:01:20,160 A little bit about me. 24 00:01:20,160 --> 00:01:23,220 This guy is actually me, though I do recognize it. 25 00:01:23,220 --> 00:01:25,940 I look like I ate him and had an allergic reaction. 26 00:01:27,860 --> 00:01:31,060 Life got hard during this time. 27 00:01:31,120 --> 00:01:32,520 I was in the Navy for 10 years. 28 00:01:32,520 --> 00:01:35,740 I spent seven years fixing F-18 Hornets. 29 00:01:35,840 --> 00:01:42,840 After 9-11, got wrapped into doing security because I was doing that for fun, cyber security stuff, hacking stuff for fun. 30 00:01:42,840 --> 00:01:47,400 Ahead of that, I was detailed to be the network security officer at the Naval Postgraduate School. 31 00:01:47,400 --> 00:01:51,820 That was also a fun time when Chris Eagles spun up a school of root. 32 00:01:52,520 --> 00:01:58,360 So anyone that's old enough to remember that, one captured the flag here at DEFCON a handful of times. 33 00:01:58,820 --> 00:02:04,240 And at the time, we're trying to figure out how to operationalize cyber security operations. 34 00:02:04,240 --> 00:02:20,580 And so I partnered with InfoWorld back before journalism died and the test center was still open and they would send all the gear and we would mess with it, put it on the network and figure out what could work, what didn't work, what type of technologies and approaches worked. 35 00:02:20,780 --> 00:02:27,580 Some of the stuff we're going to talk about today, network behavioral anomaly detection was done really in two veins that were pretty successful. 36 00:02:28,120 --> 00:02:33,880 Georgia Tech had an arm that was doing something that later became called stealth watch. 37 00:02:37,320 --> 00:02:38,860 So it was the Naval Postgraduate School. 38 00:02:38,860 --> 00:02:40,060 It was called Therminator. 39 00:02:40,100 --> 00:02:41,220 You can Google that. 40 00:02:41,220 --> 00:02:43,200 NSA holds that code now. 41 00:02:45,440 --> 00:02:56,280 Left the Navy, did consulting work for about seven years, then went back to Lancope to help them figure out how to sell something as complicated as network behavioral anomaly detection. 42 00:02:56,380 --> 00:02:58,220 That company got acquired by Cisco. 43 00:02:58,640 --> 00:03:06,660 And about four years ago, I started a project called WIDFU that is setting out to orchestrate security operations. 44 00:03:06,660 --> 00:03:10,860 You can, if you are interested about that, there's www.widfu.com. 45 00:03:11,300 --> 00:03:13,000 So here's what we're going to cover today. 46 00:03:13,240 --> 00:03:19,480 Going to hit on the concepts of NBAD and UBA, how it works, what the terms mean, just to define those so we're all up to speed. 47 00:03:19,480 --> 00:03:24,140 Then we're really going to look at how to poison that data in the context of a red cell team. 48 00:03:24,140 --> 00:03:27,600 People are collecting data, they're analyzing it, they want to catch attacks. 49 00:03:27,940 --> 00:03:34,840 What we're going to look at today are some concrete techniques in messing that data up so they cannot catch the attacks that are underlying. 50 00:03:35,300 --> 00:03:36,360 And so it's going to be two parts. 51 00:03:36,360 --> 00:03:46,800 The techniques, so what are the commands we run, and the scenarios, or how do we leverage those techniques in different poisoning scenarios. 52 00:03:47,040 --> 00:03:54,760 So just real quick on some definitions, a signature-based definition, most of you guys know this, signature is you're inspecting an object as it's entering the subject. 53 00:03:54,880 --> 00:03:58,620 So the packet, the file, it has some characteristic that's weird. 54 00:03:58,660 --> 00:04:06,040 If I was drinking my drink and there was mold floating on it or something weird, I'm like, okay, there's something wrong with this object, I'm not going to ingest it. 55 00:04:06,040 --> 00:04:09,040 I know that mold is not good, right? 56 00:04:09,240 --> 00:04:13,440 Behavioral detection is observing the subject after ingestion occurs. 57 00:04:13,440 --> 00:04:15,400 So sandboxing is really good at this. 58 00:04:15,400 --> 00:04:23,120 If I drink the drink and I become sick, that behavior tells me the object may have been bad, right? 59 00:04:23,120 --> 00:04:29,600 And then anomaly detection is looking at all of the behaviors, whether they're on the network, on the endpoint, or whatever, you establish what is normal. 60 00:04:29,800 --> 00:04:37,620 And then if anything happens that is not a categorized, whitelisted normal, it is abnormal, it is an anomaly. 61 00:04:37,760 --> 00:04:54,060 And so this is one area that has worked really well over the last few years, and we've done a whole lot of good research as an industry on anomaly detection, or what's more commonly being marketed now as machine learning, is particularly supervised machine learning. 62 00:04:54,060 --> 00:04:59,600 But in the relationships, anomaly detection create new behaviors. 63 00:04:59,600 --> 00:05:05,480 We see something new happening in the wild, and we categorize it as a nefarious behavior. 64 00:05:05,880 --> 00:05:08,660 So Heartbleed a few years ago was a good example of this. 65 00:05:08,660 --> 00:05:19,300 When we start seeing the ratio of server bytes, client bytes, that are being exchanged across Apache are not in the realm of normal web communications. 66 00:05:19,300 --> 00:05:21,020 It's a net new behavior. 67 00:05:21,180 --> 00:05:28,080 And so we're able to tag that as an application denial of service. 68 00:05:29,320 --> 00:05:32,680 And then from behaviors, we are able to detect new signatures. 69 00:05:32,680 --> 00:05:45,540 When we see this behavior, we may not know what the attack is at the time, but we know the behavior is bad, such as the files are being encrypted on the disk, data is being deleted, data is being exfiltrated, the behavior is bad. 70 00:05:45,540 --> 00:05:48,760 And so those behaviors inform us on how to build new signatures. 71 00:05:48,760 --> 00:06:01,340 And of course, the best thing about signatures are, we can attach CVEs to them, we know exactly, we can look at the adversaries that created them to better understand exactly what happened. 72 00:06:01,340 --> 00:06:18,160 So false positives, or when I say a false positive, I mean a detection of something other than an attack is high in anomaly-based detection, because until you get to the point where you've categorized every behavior so you know what's normal and why it's normal, 73 00:06:18,160 --> 00:06:24,440 you're going to have alarms that are triggering that are uncategorized but non-nefarious. 74 00:06:26,060 --> 00:06:29,740 Anomaly-based detection, as we look at it, requires baselines. 75 00:06:29,740 --> 00:06:34,300 If you're establishing normal, you have to define what is normal. 76 00:06:34,420 --> 00:06:43,280 And most of the techniques we do in anomaly detection, whether it's on the network side or the user side, they're based on mathematical models. 77 00:06:43,280 --> 00:06:47,940 You can do mean, you can do different types of standard deviation. 78 00:06:47,940 --> 00:06:52,920 There's all kinds of models on what the baseline is, how many bytes. 79 00:06:52,920 --> 00:06:57,000 So what you start with is, what type of metric are we looking at? 80 00:06:57,000 --> 00:06:59,120 Is it packets transferred per second? 81 00:06:59,120 --> 00:07:01,740 Is it packets transferred per second against port? 82 00:07:01,740 --> 00:07:06,320 So you build a mathematical set of numbers that you're going to track. 83 00:07:06,320 --> 00:07:09,880 Second thing you have to figure out is, what is the baseline applied to? 84 00:07:09,880 --> 00:07:11,860 Is it applied to the entity? 85 00:07:11,860 --> 00:07:16,680 So are you baselining the behavior of every host or every user on the network? 86 00:07:16,680 --> 00:07:20,820 Or are you looking at set-based baselining? 87 00:07:20,820 --> 00:07:30,000 So all of the users in wireless, or all of the hosts that are belonging to the C-suite. 88 00:07:30,000 --> 00:07:33,940 So you create sets and then baseline against sets, or you baseline against entity. 89 00:07:33,960 --> 00:07:37,500 And that's pretty important when you look at how to exploit them. 90 00:07:37,500 --> 00:07:40,200 So what baseline are you going to exploit? 91 00:07:40,200 --> 00:07:42,240 We'll look at baseline boiling a little bit. 92 00:07:43,620 --> 00:07:54,420 Supervised machine learning versus unsupervised machine learning is you take all the variables in unsupervised machine learning and you find every possible relationship against the different data. 93 00:07:54,420 --> 00:08:04,160 So if you have 15, if you have packets versus port versus bytes versus, you know, all these things you can look at, what are the distributions of those sets? 94 00:08:04,360 --> 00:08:06,560 And then what do those sets mean when we see them? 95 00:08:06,560 --> 00:08:10,660 And that was actually one of the main pieces of the Therminator research. 96 00:08:11,340 --> 00:08:19,000 So as a product in the industry, network behavioral anomaly detection is looking at a horizontal traffic. 97 00:08:19,000 --> 00:08:21,840 Normally inside the network it's looking at net flow generally. 98 00:08:22,220 --> 00:08:24,840 There's also the ability for probe solutions. 99 00:08:25,500 --> 00:08:32,200 But you don't, because you're counting things, you don't need to inspect the characteristics of the payload, right? 100 00:08:32,200 --> 00:08:37,540 We don't, so this is one thing that's sort of safe from encryption. 101 00:08:37,540 --> 00:08:39,780 Because you don't care what's in the payload, you care what's in the header. 102 00:08:39,780 --> 00:08:43,300 How many packets, how many bytes, how many connections, those kind of things. 103 00:08:43,660 --> 00:08:48,880 It also tends to look at solving horizontal east-west conversations. 104 00:08:48,880 --> 00:08:52,480 What are the, how much data is being transferred from data center to data center or whatever. 105 00:08:53,580 --> 00:08:58,020 And that's why net flow or other meta type tools work there. 106 00:08:58,460 --> 00:09:00,240 Almost no one definitions, we'll get the fun part. 107 00:09:00,240 --> 00:09:04,940 That's a list of stuff from Gartner on people that do NBAD. 108 00:09:05,560 --> 00:09:17,360 Types of anomalies you look for are service traffic thresholds, so how much web traffic was consumed from China in a day, right? 109 00:09:17,360 --> 00:09:18,940 And so you look at that type of thing. 110 00:09:18,940 --> 00:09:26,300 It also fits in the geographic traffic anomaly, how much traffic is impacting on a given geo. 111 00:09:26,300 --> 00:09:40,520 Data hoarding or data staging is if you expect a host to consume 10 megs a day from the network services and now they just consumed 100 megs, that's a mathematical anomaly against what you expected in the baseline. 112 00:09:40,600 --> 00:09:43,220 So those are just observing network patterns. 113 00:09:43,920 --> 00:09:50,040 When we look at UBA, really what this solves is where do you do an investigation? 114 00:09:50,160 --> 00:09:55,420 Those of us who have been doing this for a couple of decades remember the days where we had alarm tables. 115 00:09:55,780 --> 00:10:08,200 We started to be on alert at the top of the table, we'd prioritize them on different types of metrics, which one was scarier, which was our confidence level, all these things that came in sort of in the really initial IDS, IPS days. 116 00:10:08,200 --> 00:10:10,580 And we'd work our way down that list. 117 00:10:11,000 --> 00:10:23,020 The next sort of thing that happened was host-centric investigations to where you take the alarms and you attach them to the network devices that are generating the alarms and then you investigate that host. 118 00:10:23,220 --> 00:10:25,340 And so you correlate them there. 119 00:10:25,340 --> 00:10:35,240 And then the first part of user-entity behavioral analysis is putting the alarms on the credential level. 120 00:10:35,240 --> 00:10:43,720 So if there's three different machines used, but one credential used, you investigate the user credential instead of the host level. 121 00:10:43,720 --> 00:10:48,740 And what it does is it provides a boil down of all of those alerts. 122 00:10:48,740 --> 00:10:52,660 So there could be hundreds or thousands of alerts that are attached to one set of credentials. 123 00:10:53,400 --> 00:10:56,100 And then this is the interface that I use. 124 00:10:56,100 --> 00:11:03,160 This is using Cytoscape, which is a bioinformatics graph library. 125 00:11:03,780 --> 00:11:10,780 So when you look at user-based anomaly, I'm almost done with definitions, and we'll do the actual exploits. 126 00:11:11,760 --> 00:11:16,420 A couple of things, geographic traffic or magic carpet type of attacks. 127 00:11:16,420 --> 00:11:27,340 If a guy always logs in in Columbus, Ohio, and then all of a sudden he's logging in from Tehran, that's a geographic anomaly that he's too far outside of where he normally logs in. 128 00:11:27,520 --> 00:11:37,340 A time of day, if they're always logging in at 8 o'clock in the morning or during the morning hours, and all of a sudden he starts logging in at 2 o'clock in the morning, that's a time of day anomaly. 129 00:11:38,140 --> 00:11:39,440 Different types of hosts. 130 00:11:39,440 --> 00:11:43,920 So when you categorize how does that user get onto the network? 131 00:11:43,920 --> 00:11:49,560 Is it only on guest wireless or are they logging into servers? 132 00:11:49,560 --> 00:11:53,620 So in those types of access change, it's also a type of anomaly. 133 00:11:53,620 --> 00:11:54,520 And then what services? 134 00:11:54,520 --> 00:12:09,460 If it's only consuming email and the internet is the baseline, then all of a sudden we're looking at something like accessing core data services like SQL or something like that, then that's an anomaly in itself. 135 00:12:09,460 --> 00:12:13,100 All right, so now that's a million things that do UBA. 136 00:12:13,360 --> 00:12:15,580 So let's talk about how to poison the data now. 137 00:12:15,960 --> 00:12:21,620 So there's really three types of poisoning that we're going to go over here today. 138 00:12:21,680 --> 00:12:34,240 The first is mass implication, which means if I'm attacking from this computer, I don't want you to investigate this computer because I'm going to make it look like everybody's attacking the network. 139 00:12:34,240 --> 00:12:36,600 It's not just my computer, everyone's attacking. 140 00:12:36,600 --> 00:12:40,320 So you have to figure out which one's the real attacker. 141 00:12:40,420 --> 00:12:48,480 Second one is baseline boiling, is contributing to the calculations of baselines in a way that they grow. 142 00:12:48,560 --> 00:12:59,620 So if you're doing something like data exfiltration or time of day, you just slowly contribute data that makes it to where the baseline is so big that it's useless, that everything is always okay. 143 00:12:59,620 --> 00:13:04,500 Everything is always normal because you're contributing that data in a slow way. 144 00:13:05,140 --> 00:13:09,520 Attack masking is when we send one record to offset another record. 145 00:13:09,740 --> 00:13:11,700 So this is really good in recon. 146 00:13:11,700 --> 00:13:18,100 So if I send a send packet and a send act doesn't come back, I can generate a record that said a send act came back. 147 00:13:18,100 --> 00:13:19,700 So now it doesn't look like the scan anymore. 148 00:13:19,700 --> 00:13:21,660 It looks like a two-way handshake occurred. 149 00:13:22,560 --> 00:13:28,900 The ways we're going to do it is log spoofing, which means we're going to generate false logs. 150 00:13:28,900 --> 00:13:29,740 We're just going to lie. 151 00:13:29,740 --> 00:13:30,600 We're going to create a log. 152 00:13:30,600 --> 00:13:36,080 We're going to get it into the processing system and just write whatever we want. 153 00:13:36,120 --> 00:13:39,380 The second approach we do is behavioral spoofing. 154 00:13:39,380 --> 00:13:44,580 So we make it look like that a behavior happened on the network that didn't actually happen. 155 00:13:45,720 --> 00:13:50,380 And so the way that we're going to do this is one, we can do it from a machine we own on the network. 156 00:13:50,380 --> 00:13:52,560 We can do it from a VM or containers. 157 00:13:52,560 --> 00:13:57,040 A lot of the code I'm going to give up here is going to be via Docker containers. 158 00:13:57,160 --> 00:14:07,540 And we can also trick networking devices into lying for us by doing fake telemetry that makes the networking device think that something happened that didn't really happen. 159 00:14:08,360 --> 00:14:19,760 So the end goal of this is, on the left, is an attack that happened at a university of data exfiltration going from left to right. 160 00:14:19,760 --> 00:14:32,980 And when you look at UBA tools and tools that utilize graph theory, what you're driving for in developing these visualizations is clarity to the investigator. 161 00:14:32,980 --> 00:14:45,000 You take thousands or tens of thousands of events, you contextualize them against the modus operandi of the attacker, and then you render it and the investigator's like, yep, someone's stealing our data. 162 00:14:45,000 --> 00:14:48,620 We're on stage two of this particular kill chain, this particular MO. 163 00:14:48,980 --> 00:14:53,480 And then that's easy to investigate, and then the bad guy's killed. 164 00:14:54,000 --> 00:14:58,400 What we're going to look at in poisoning is, if you can, we move to being invisible, right? 165 00:14:58,400 --> 00:15:04,840 We erase the records that we did an attack, so that there's no record. 166 00:15:04,840 --> 00:15:08,780 That's actually pretty hard, so I like the second one better. 167 00:15:08,920 --> 00:15:11,320 Make it look like everything's screwed, right? 168 00:15:11,320 --> 00:15:20,160 And so make it look like every single thing on the network is infected, and an attacker make everything look horrible, and you can't investigate any of it. 169 00:15:20,160 --> 00:15:24,840 So this is what we're going to drive at toward in these exploits. 170 00:15:25,600 --> 00:15:32,160 So real quick on how to protect against this, and this is sort of the key part if you have to tell people how to fix it. 171 00:15:32,160 --> 00:15:35,900 We have a really bad problem with non-repudiation and logging. 172 00:15:35,920 --> 00:15:42,580 UDP is a really crappy way to get data logging into a system. 173 00:15:42,980 --> 00:15:52,840 TLS is really, it's a pain too, because of the overhead of the TCP handshake, as well as the encryption handshake. 174 00:15:52,840 --> 00:15:55,700 And for some technologies, it's not even possible. 175 00:15:55,700 --> 00:16:11,300 RFC 5101, which establishes IPFIX as a metadata for sending out network communications, it's written to support TLS encryption or transport, but no one does it. 176 00:16:11,300 --> 00:16:15,280 So you can't buy a tool that actually complies with that part of the RFC. 177 00:16:15,300 --> 00:16:18,780 It also does, of course, add client overhead, server overhead. 178 00:16:18,780 --> 00:16:23,400 You can run into reflection, denial of service, all those things as well. 179 00:16:23,820 --> 00:16:26,340 And spoofing, right? 180 00:16:26,340 --> 00:16:27,560 So people, you can just lie. 181 00:16:27,560 --> 00:16:34,120 There's nothing with the UDP packet in particular that keeps you from saying in the header that I am whatever IP address I want to be. 182 00:16:34,120 --> 00:16:41,280 And as long as that packet can route to the destination, I look, it sounds like I, it looks to the server like I did that. 183 00:16:41,360 --> 00:16:53,360 And so tools like Cisco have the overhead of doing a reverse path lookup to make sure that if you're saying you're sending from 10.10.5.5, that you're really on that segment. 184 00:16:54,280 --> 00:16:59,960 Then really the other part is protecting the collection infrastructure. 185 00:16:59,960 --> 00:17:08,620 The tools that are generating telemetry should be in a segment that is the path to the analysis is protected. 186 00:17:08,620 --> 00:17:14,040 So everyone can't, no one on the network can send logs unless they're in an authorized segment. 187 00:17:14,640 --> 00:17:17,960 I do, I also put up here honeypot. 188 00:17:17,960 --> 00:17:28,620 So if you're doing any type of deception, that stuff, that stuff is really cool when you run into everything's infected because you get real telemetry because nothing should be talking to a non-existent box. 189 00:17:28,620 --> 00:17:34,500 So it's really the tripwire of figuring out where is the real guy when all of the analysis fails. 190 00:17:34,840 --> 00:17:42,280 And really another core part here is as you're receiving data, it needs to be tagged on how it was received, right? 191 00:17:42,360 --> 00:17:45,500 What listening service received it on what port? 192 00:17:45,920 --> 00:17:49,720 What were the authentication components that happened? 193 00:17:49,720 --> 00:17:50,840 Was it sent over TLS? 194 00:17:50,840 --> 00:17:52,160 Was it sent over UDP? 195 00:17:52,420 --> 00:18:02,420 And those types of things so that when you run into a poisoning scenario, you can filter out the stuff that meets the criteria of poisoning because you logged that as it came in. 196 00:18:03,980 --> 00:18:11,340 The things we're going to go over really fit in all parts of the MITRE ATT&CK matrix for enterprise except for initial access. 197 00:18:11,840 --> 00:18:14,320 So the first technique is really simple. 198 00:18:14,320 --> 00:18:16,020 It's just what I call a pump and dump. 199 00:18:16,320 --> 00:18:22,420 So what you do is you're going to spin up a container or VM. 200 00:18:22,420 --> 00:18:25,560 I'm going to give you the code on the container here in a second using a Docker container. 201 00:18:25,800 --> 00:18:27,600 You assign it a MAC address. 202 00:18:27,600 --> 00:18:30,800 You can pull an IP address from DHCP or assign your own IP address. 203 00:18:30,800 --> 00:18:33,260 You do stuff, like maybe you do recon. 204 00:18:33,620 --> 00:18:36,140 And then you kill that container. 205 00:18:36,580 --> 00:18:41,740 You reassign a new MAC address, pull a new IP address, and then do something else. 206 00:18:41,740 --> 00:18:46,400 And so in the logging in the system, you're spoofing the IP address, you're spoofing the MAC address. 207 00:18:46,400 --> 00:18:49,160 They can't find the machine because it vaporizes, right? 208 00:18:49,160 --> 00:18:57,680 So it's the same machine, but it keeps popping up using a different networking component. 209 00:18:57,680 --> 00:19:00,860 So this is a Docker version with Kali Linux. 210 00:19:00,860 --> 00:19:08,040 So the first thing is that one line creates the container, and it'll actually pull from Docker Hub if you have an internet connection. 211 00:19:08,320 --> 00:19:11,500 It establishes whatever MAC address you want to use. 212 00:19:11,500 --> 00:19:14,260 In this scenario, it's going to pull a DHCP address. 213 00:19:14,260 --> 00:19:18,420 So that way you know it can route. 214 00:19:18,500 --> 00:19:20,000 And there's a record. 215 00:19:20,000 --> 00:19:21,300 You do stuff. 216 00:19:21,440 --> 00:19:23,560 So you create the container. 217 00:19:23,560 --> 00:19:24,880 You start the container. 218 00:19:24,880 --> 00:19:27,180 That gives you a shell into the container. 219 00:19:27,180 --> 00:19:29,320 You do all the stuff you want to do, right? 220 00:19:29,320 --> 00:19:32,360 These scenarios will go through a little bit or anything else. 221 00:19:32,360 --> 00:19:38,720 Then you kill the container, spin up a new one with a new MAC address, pull a new IP address, and then repeat. 222 00:19:38,720 --> 00:19:42,400 So it looks like you have this machine that pops up for a few minutes. 223 00:19:42,400 --> 00:19:49,440 It might hit something, flag it, but it's gone by the time the responders can deal with it. 224 00:19:51,000 --> 00:19:52,480 This one's really fun. 225 00:19:52,480 --> 00:19:54,200 It's what I call a pocket dimension. 226 00:19:54,280 --> 00:19:57,280 So a lot of access switches now are sending telemetry. 227 00:19:57,280 --> 00:20:06,840 Wireless access points do this a lot, things like Meraki or Mist, where they just believe the traffic happening on the access point is really happening. 228 00:20:07,300 --> 00:20:12,760 So you spin up several containers on a fake network. 229 00:20:12,760 --> 00:20:14,660 And it can be on a Slash 2, a Slash 4. 230 00:20:14,660 --> 00:20:18,500 You might be able to get a Slash 0 to work, but I generally run on a Slash 4. 231 00:20:18,800 --> 00:20:21,180 And you spin up an external host. 232 00:20:21,180 --> 00:20:24,540 It could be a Microsoft host or whatever IP addresses you want. 233 00:20:24,640 --> 00:20:27,120 And then you do things to those fake machines. 234 00:20:27,120 --> 00:20:34,020 So it looks like 10.10.5.5 is communicating with 8.8.8.8, but it's not. 235 00:20:34,020 --> 00:20:36,940 It's communicating with your 8.8.8.8. 236 00:20:36,940 --> 00:20:48,100 And so you can generate all these false traffic patterns, whether they're inside the network or outside of the network, by creating the containers, launching the traffic that you're lying about. 237 00:20:48,100 --> 00:20:52,220 You're creating a behavior in this fake network. 238 00:20:52,260 --> 00:20:56,300 That fake network is bound to the NIC. 239 00:20:56,300 --> 00:21:02,820 The NIC is then being monitored by the wireless access point. 240 00:21:02,820 --> 00:21:08,280 A wired access switch is generating either syslog or NetFlow telemetry. 241 00:21:08,280 --> 00:21:15,060 That stuff is already configured to ship it to the syslog or NetFlow or UBA tools. 242 00:21:15,080 --> 00:21:17,700 So you're generating all this fake traffic and it gets shipped out. 243 00:21:17,700 --> 00:21:18,680 So it looks like this. 244 00:21:18,680 --> 00:21:21,360 This is two different machines. 245 00:21:22,040 --> 00:21:28,980 You create a network bridge called Pocket, or a Docker network called Pocket. 246 00:21:29,000 --> 00:21:38,680 You bridge that across to the physical network that's on the bridge command there. 247 00:21:38,880 --> 00:21:51,080 Spin up containers, have the communications you want, whether that uses for boiling baselines, you could use it for doing recon, you could scan the whole internet if you want. 248 00:21:51,180 --> 00:21:58,820 Whatever you wanted to do, but it's happening in this fake network, but generating real telemetry inside of the security architecture. 249 00:22:01,980 --> 00:22:13,120 This one is a little bit harder, or should be harder, is just spoofing records directly to the log collector, whether that's syslog or NetFlow, but you have to find it first. 250 00:22:13,120 --> 00:22:16,660 And I'll show you a couple of techniques for resolving this. 251 00:22:16,660 --> 00:22:23,380 First is you can look for DNS things, because people name them like syslogcollector.acme.local, right? 252 00:22:23,380 --> 00:22:30,800 So doing some basic DNS lookups will probably reveal something, give you a step towards where the collector is. 253 00:22:31,060 --> 00:22:43,990 If you have a compromised machine that's already generating telemetry, that's just a TCP dump on that machine to figure out what it's with over NetFlow or syslog pieces, you can just do a SYN scan. 254 00:22:43,990 --> 00:22:50,290 If something's collecting syslog, they're going to be open on 514, see if you get a SYNAC back on any of those. 255 00:22:50,810 --> 00:22:57,610 But once you discover it, you're just going to spoof records that can say anything that you want, because record collection stinks right now. 256 00:22:57,930 --> 00:22:59,730 And then you can just do a pump and dump, right? 257 00:22:59,730 --> 00:23:05,650 Create the records, drop that machine, create more records from a new machine. 258 00:23:06,730 --> 00:23:10,710 So if you don't know how to send syslog over Netcat, that's how you do it. 259 00:23:11,370 --> 00:23:14,950 Syslog is really uncomplicated. 260 00:23:15,490 --> 00:23:17,770 So you can send any message you want. 261 00:23:17,770 --> 00:23:21,930 Most syslog formats from different tools are very well documented. 262 00:23:21,990 --> 00:23:30,630 There are plugins for it, but essentially just Netcat anything you want to the port of the server, and the server will process it as if it is the gospel. 263 00:23:30,630 --> 00:23:35,630 So another cool way of doing is what I call a UDP spray. 264 00:23:35,630 --> 00:23:38,250 There's a cool project on GitHub called Samplicator. 265 00:23:38,250 --> 00:23:51,730 And essentially what it does is it opens up a socket, it listens for a UDP packet, and you have rule-based systems that say, when I receive packets from the following sources or they have the following characteristics, forward those packets to the following destinations. 266 00:23:52,010 --> 00:23:54,910 And what it does is it maintains the original header. 267 00:23:54,930 --> 00:24:04,290 So if you sent from 10.1.1.1, it looks like 10.1.1.1 when it hits the final destination and not the Samplicator IP address. 268 00:24:04,650 --> 00:24:15,170 So you can just load up class B's worth of IP addresses and just say, I'm going to send a packet into Samplicator and it's going to spray it out to every possible destination. 269 00:24:15,290 --> 00:24:21,830 Some detection mechanisms may see a UDP flood or something like that because of the number of UDP packets coming out. 270 00:24:21,930 --> 00:24:27,790 But this is one way to get the packet to the destination if there's a route to it. 271 00:24:28,130 --> 00:24:32,570 So it's send it to everybody, and whoever picks up on that log just receives the log. 272 00:24:33,130 --> 00:24:34,890 And that's really all that you have to do there. 273 00:24:35,210 --> 00:24:38,310 Samplicator is a very simple application to use. 274 00:24:38,910 --> 00:24:46,070 Then it's used the previous slide to generate the Netcat message, send it to Samplicator, and then it shoots it out to all the UDP destinations. 275 00:24:47,490 --> 00:24:51,270 For things that are using TLS, this is some really simple Python code. 276 00:24:53,530 --> 00:24:55,670 That's all you need to do to send a message. 277 00:24:55,670 --> 00:24:58,190 You'll see the message is right here on the socket. 278 00:24:58,190 --> 00:25:01,150 The rest of it's just removing verification. 279 00:25:01,150 --> 00:25:13,690 So if the endpoint does require certificate verification, you're obviously going to have to get a hold of a good certificate here, which actually might not be too hard if you own a machine because the machine will have a certificate on it if it's already shipping logs. 280 00:25:14,130 --> 00:25:17,550 But that's the Python stuff there. 281 00:25:17,550 --> 00:25:25,370 And again, if anybody needs these slides, they're just at Charles Herring, charlesherring.com. 282 00:25:25,870 --> 00:25:30,670 Give them to you right here on the thumb drive that I would not recommend you plug into your machine. 283 00:25:33,330 --> 00:25:36,350 Next thing is, here's another approach. 284 00:25:36,350 --> 00:25:37,830 So there's a tool called nProbe. 285 00:25:37,990 --> 00:25:39,890 There's an open source version. 286 00:25:40,190 --> 00:25:41,150 It sniffs a NIC. 287 00:25:41,150 --> 00:25:46,610 So it sniffs the packet capture and it creates NetFlow records. 288 00:25:46,870 --> 00:25:58,930 And so in the case of like a pocket dimension, you're running these different attacks, have nProbe generate the metadata about those fake attacks and forward those on to the collector, right? 289 00:25:58,930 --> 00:26:04,290 Whether you do that through a UDP spray or you already know the end destination of where you're going. 290 00:26:04,290 --> 00:26:07,690 So grab that from nTop, friends over there. 291 00:26:10,070 --> 00:26:12,990 A lot of stuff starting to move towards REST APIs. 292 00:26:12,990 --> 00:26:15,670 So Elasticsearch, Splunk, those types of devices. 293 00:26:15,670 --> 00:26:18,010 If you're making a, you want to make a direct right there. 294 00:26:18,130 --> 00:26:20,690 This is an example for Elasticsearch in the format. 295 00:26:20,690 --> 00:26:23,750 It really is just message colon. 296 00:26:23,750 --> 00:26:29,070 So this is a JSON post to the Elasticsearch API. 297 00:26:30,050 --> 00:26:30,870 So you can do that. 298 00:26:30,870 --> 00:26:36,450 But generally, if you're using Elasticsearch, you also have available something's listening on syslog somewhere. 299 00:26:36,850 --> 00:26:37,990 Mike's dying. 300 00:26:38,330 --> 00:26:38,810 Okay. 301 00:26:39,430 --> 00:26:39,790 All right. 302 00:26:39,790 --> 00:26:40,910 So let's do a scenario. 303 00:26:42,990 --> 00:26:50,470 We want to recon the network, but we want to cover our tracks by making it look like everybody's reconning the network, right? 304 00:26:50,470 --> 00:26:54,650 And so they can't, they won't find our machine until it's way too late. 305 00:26:55,050 --> 00:27:02,890 So best way to do this is in a pocket dimension and generate, you can generate the fake records, right? 306 00:27:02,890 --> 00:27:11,710 So you're scanning everything inside of the pocket dimension, which is generating all these recon records that are getting forwarded off to the infrastructure. 307 00:27:12,530 --> 00:27:24,970 You could also do this by spinning up as many Docker containers as you want, spoofing the IP address if it's because it doesn't matter in recon, particularly if you're doing a send scan, if the packet comes back to the fake machines. 308 00:27:25,370 --> 00:27:27,930 So in the pocket dimension, you can do as many as you want. 309 00:27:27,950 --> 00:27:34,350 You can simulate some syntax, but it's really good in just getting a recon done. 310 00:27:34,350 --> 00:27:36,630 And they will know recon just happened. 311 00:27:36,630 --> 00:27:42,650 So the blue team will know recon just happened, but they won't be able to figure out where it actually came from or where the data was collected to shut it down. 312 00:27:42,930 --> 00:27:56,630 And also you could use a pump and dump here, of course, after you finish the recon from the machine that collected the data, kill the MAC address, kill the IP address, then create a new container for subsequent parts of the kill chain. 313 00:27:58,930 --> 00:28:08,970 This is something I talked about a little earlier, but if you're going to send, let's say you're scanning the network and you just want to create a bidirectional connection. 314 00:28:09,630 --> 00:28:12,870 Inside of the real network, you're scanning the whole network. 315 00:28:12,930 --> 00:28:17,890 And if you don't get a SYNACK back, you create a net flow record. 316 00:28:17,890 --> 00:28:22,490 In this case, it says there was a SYNACK, that the SYNACK did come back. 317 00:28:22,490 --> 00:28:33,050 So it will confuse detection mechanisms enough to prevent a scan from triggering because it has a record that the bidirectional connection actually occurred. 318 00:28:33,690 --> 00:28:35,930 There's also the ability to do this. 319 00:28:35,930 --> 00:28:36,910 There's a scanner. 320 00:28:36,910 --> 00:28:39,970 I'll see if I can post it later on to where it does this automatically. 321 00:28:39,970 --> 00:28:47,330 So you scan, the machine doesn't get a SYNACK back, and it knows where the flow collector is. 322 00:28:47,330 --> 00:28:51,070 You can generate a SYNACK record from the scanner itself. 323 00:28:51,070 --> 00:28:54,690 So it's this really simple Python script to shoot that out. 324 00:28:56,590 --> 00:28:59,530 And this one's sort of the fun one here. 325 00:28:59,930 --> 00:29:01,830 How do you boil a baseline? 326 00:29:01,830 --> 00:29:08,270 So boiling a baseline, and going back to the Venn diagram we had, anomaly detection catches everything. 327 00:29:08,270 --> 00:29:12,090 As long as you have visibility on everything, it will always generate an alert, right? 328 00:29:13,450 --> 00:29:15,370 Unless you break the baselines. 329 00:29:15,510 --> 00:29:22,650 And so if you think about the metric that you want to run against, whether that's doing a geographical attack, you need to move data. 330 00:29:22,650 --> 00:29:24,530 Data exfiltration is a big one here. 331 00:29:24,610 --> 00:29:37,110 If you need to move data to a segment on the Internet that normally doesn't transact that data, you're going to create records every day of data going out there. 332 00:29:37,110 --> 00:29:42,070 You start with a K, and the next day it's a K and a half, then it's 5K. 333 00:29:42,250 --> 00:29:51,670 And every day you just slowly move that baseline up by generating more and more telemetry that says that traffic happened that really did not happen. 334 00:29:51,670 --> 00:30:03,770 And so that can be done either by direct logging, so you're sending the logs directly to the collection source, or it can be by spoofing the behavior inside of a pocket dimension, right? 335 00:30:03,770 --> 00:30:11,470 Where you're executing these increasingly large, whether it's data transfers, time of days are another good one for this. 336 00:30:11,510 --> 00:30:16,230 Eventually, you should have every user logging on from every place at every hour of the day. 337 00:30:16,270 --> 00:30:23,330 And now you can never detect an anomaly in user behavior because everyone's always working everywhere. 338 00:30:23,670 --> 00:30:33,950 And so in that case, it's just generated a syslog record for authentication successful for user so-and-so, and then you just do that for every user that you need to use inside of a campaign. 339 00:30:34,470 --> 00:30:35,950 Any questions on that? 340 00:30:36,010 --> 00:30:39,750 I don't care if there's any questions, but I'm gonna drink this drink. 341 00:30:41,910 --> 00:30:43,290 Think about a question. 342 00:30:46,170 --> 00:30:48,730 All right, so this is the last piece. 343 00:30:49,750 --> 00:30:53,350 Just recapping this to prevent this stuff from happening. 344 00:30:54,070 --> 00:31:00,990 If you can do TLS, client-based authentication on record collection, that is ideal. 345 00:31:01,190 --> 00:31:04,670 Because then you're down to protecting the public key infrastructure, right? 346 00:31:04,710 --> 00:31:09,150 And if you lose the public key infrastructure, you're screwed, of course, so don't let that happen. 347 00:31:09,350 --> 00:31:10,730 But there is overhead there. 348 00:31:10,730 --> 00:31:20,910 So as you're scoping out products and resources for doing the logging, it has to be mindful of the overhead that's going to go into that logging collection. 349 00:31:21,770 --> 00:31:30,910 And then when you're building out tools, firewalls, EDRs, all those things, they need to be wrapped into their own DMZ. 350 00:31:30,910 --> 00:31:42,330 So if your teams have not built tooling telemetry inside of a bubble that communicates with the logging tools, you're going to have problems. 351 00:31:42,330 --> 00:31:46,290 If anybody can send data into the telemetry, you're sort of in trouble. 352 00:31:47,090 --> 00:31:50,070 But that is basically it. 353 00:31:51,410 --> 00:31:52,790 Get the thing there. 354 00:31:52,790 --> 00:31:54,530 I'll answer any questions. 355 00:31:54,830 --> 00:31:56,370 Thank you for having me. 356 00:31:56,410 --> 00:31:59,430 Applause.