[00:00.000 --> 00:06.200] All right, good morning. Thank you for coming out to the inaugural year of the Red Team Village. [00:06.800 --> 00:11.220] Hoping to have many, many, many more years. We tried to dedicate a lot of space, so [00:11.760 --> 00:14.640] we ended up getting a little bit more space, but we tried to dedicate at least [00:14.640 --> 00:20.500] 30 plus percent of that space to T.O.P.S. because we have so many amazing people in the [00:20.500 --> 00:26.800] red space field. And you had to go to all these different places to hear them and talk to them. [00:26.800 --> 00:32.580] So, we've got an amazing lineup of different folks. Mr. Charles Herring, he's got an immense [00:32.580 --> 00:40.080] background. You want to talk about me? There's a whole slide about me. It's my favorite topic. [00:40.080 --> 00:46.220] We're just going to do the whole hour about me. It's all about me. Anyway, well, thank you. Please [00:46.220 --> 00:58.840] give him a warm applause. We're going to do about 45-50 minutes and then we'll do some Q&A [00:58.840 --> 01:04.780] after that. If you have any questions along the way, feel free to shoot a hand up and I will [01:04.780 --> 01:08.900] answer the question because that gives me an opportunity to drink my water. [01:09.660 --> 01:14.300] If you want the deck, Twitter at Charles Herring, charlesherring.com. We'll shoot you to LinkedIn. [01:14.300 --> 01:19.760] You can grab this deck from either one of those places. It's uploaded to CDN. A little bit about [01:19.760 --> 01:24.960] me. This guy is actually me, though I do recognize it. I look like I ate him and had an allergic [01:24.960 --> 01:33.340] reaction. Life got hard during this time. I was in the Navy for 10 years. I spent seven years [01:33.340 --> 01:40.680] fixing F-18 Hornets. After 9-11, got wrapped into doing security because I was doing that for fun, [01:40.680 --> 01:45.320] cyber security stuff, hacking stuff for fun. Ahead of that, I was detailed to be the network [01:45.320 --> 01:49.900] security officer at the Naval Postgraduate School. That was also a fun time when Chris Eagles spun up [01:50.660 --> 01:56.680] a school of root. So anyone that's old enough to remember that, one captured the flag here at [01:56.680 --> 02:02.360] DEFCON a handful of times. And at the time, we're trying to figure out how to operationalize [02:02.360 --> 02:07.780] cyber security operations. And so I partnered with InfoWorld back before journalism died and [02:07.780 --> 02:12.080] the test center was still open and they would send all the gear and we would mess with it, [02:12.080 --> 02:18.060] put it on the network and figure out what could work, what didn't work, what type of [02:18.060 --> 02:22.440] technologies and approaches worked. Some of the stuff we're going to talk about today, [02:22.440 --> 02:27.580] network behavioral anomaly detection was done really in two veins that were pretty successful. [02:28.120 --> 02:37.760] Georgia Tech had an arm that was doing something that later became called stealth watch. So it was [02:37.760 --> 02:42.080] the Naval Postgraduate School. It was called Therminator. You can Google that. NSA holds that [02:42.080 --> 02:51.740] code now. Left the Navy, did consulting work for about seven years, then went back to Lancope to [02:51.740 --> 02:55.280] help them figure out how to sell something as complicated as network behavioral anomaly [02:55.280 --> 03:00.320] detection. That company got acquired by Cisco. And about four years ago, I started a project [03:00.320 --> 03:07.560] called WIDFU that is setting out to orchestrate security operations. You can, if you are [03:07.560 --> 03:13.000] interested about that, there's www.widfu.com. So here's what we're going to cover today. [03:13.240 --> 03:18.020] Going to hit on the concepts of NBAD and UBA, how it works, what the terms mean, just to define [03:18.020 --> 03:22.380] those so we're all up to speed. Then we're really going to look at how to poison that data in the [03:22.380 --> 03:26.720] context of a red cell team. People are collecting data, they're analyzing it, they want to catch [03:26.720 --> 03:31.420] attacks. What we're going to look at today are some concrete techniques in messing that data up [03:31.420 --> 03:36.360] so they cannot catch the attacks that are underlying. And so it's going to be two parts. [03:36.360 --> 03:41.800] The techniques, so what are the commands we run, and the scenarios, or how do we leverage those [03:41.800 --> 03:48.780] techniques in different poisoning scenarios. So just real quick on some definitions, [03:48.900 --> 03:52.520] a signature-based definition, most of you guys know this, signature is you're inspecting an [03:52.520 --> 03:57.500] object as it's entering the subject. So the packet, the file, it has some characteristic [03:57.500 --> 04:02.760] that's weird. If I was drinking my drink and there was mold floating on it or something weird, [04:02.760 --> 04:06.040] I'm like, okay, there's something wrong with this object, I'm not going to ingest it. [04:06.040 --> 04:12.380] I know that mold is not good, right? Behavioral detection is observing the subject after [04:12.380 --> 04:19.080] ingestion occurs. So sandboxing is really good at this. If I drink the drink and I become sick, [04:19.080 --> 04:24.760] that behavior tells me the object may have been bad, right? And then anomaly detection is looking [04:24.760 --> 04:27.900] at all of the behaviors, whether they're on the network, on the endpoint, or whatever, [04:27.900 --> 04:33.240] you establish what is normal. And then if anything happens that is not a categorized, [04:33.800 --> 04:40.320] whitelisted normal, it is abnormal, it is an anomaly. And so this is one area that has worked [04:40.320 --> 04:45.060] really well over the last few years, and we've done a whole lot of good research as an industry [04:45.860 --> 04:50.620] on anomaly detection, or what's more commonly being marketed now as machine learning, [04:50.620 --> 04:57.020] is particularly supervised machine learning. But in the relationships, [04:57.020 --> 05:02.320] anomaly detection create new behaviors. We see something new happening in the wild, [05:02.320 --> 05:08.240] and we categorize it as a nefarious behavior. So Heartbleed a few years ago was a good example [05:08.240 --> 05:13.760] of this. When we start seeing the ratio of server bytes, client bytes, that are being [05:13.760 --> 05:21.020] exchanged across Apache are not in the realm of normal web communications. It's a net new behavior. [05:21.180 --> 05:31.160] And so we're able to tag that as an application denial of service. And then from behaviors, [05:31.160 --> 05:35.520] we are able to detect new signatures. When we see this behavior, we may not know what the attack is [05:35.520 --> 05:41.320] at the time, but we know the behavior is bad, such as the files are being encrypted on the disk, [05:41.320 --> 05:47.000] data is being deleted, data is being exfiltrated, the behavior is bad. And so those behaviors inform [05:47.000 --> 05:50.840] us on how to build new signatures. And of course, the best thing about signatures are, [05:50.840 --> 05:56.920] we can attach CVEs to them, we know exactly, we can look at the adversaries that created them [05:56.920 --> 06:04.340] to better understand exactly what happened. So false positives, or when I say a false positive, [06:04.340 --> 06:10.940] I mean a detection of something other than an attack is high in anomaly-based detection, [06:10.940 --> 06:16.720] because until you get to the point where you've categorized every behavior so you know what's [06:16.720 --> 06:22.600] normal and why it's normal, you're going to have alarms that are triggering that are uncategorized [06:22.600 --> 06:29.940] but non-nefarious. Anomaly-based detection, as we look at it, requires baselines. If you're [06:29.940 --> 06:36.200] establishing normal, you have to define what is normal. And most of the techniques we do [06:36.200 --> 06:40.100] in anomaly detection, whether it's on the network side or the user side, [06:40.100 --> 06:47.320] they're based on mathematical models. You can do mean, you can do different types of standard [06:47.320 --> 06:53.520] deviation. There's all kinds of models on what the baseline is, how many bytes. So what you start [06:53.520 --> 06:59.640] with is, what type of metric are we looking at? Is it packets transferred per second? Is it packets [06:59.640 --> 07:05.480] transferred per second against port? So you build a mathematical set of numbers that you're going to [07:05.480 --> 07:10.560] track. Second thing you have to figure out is, what is the baseline applied to? Is it applied [07:10.560 --> 07:16.880] to the entity? So are you baselining the behavior of every host or every user on the network? Or [07:16.880 --> 07:25.820] are you looking at set-based baselining? So all of the users in wireless, or all of the hosts that [07:25.820 --> 07:32.820] are belonging to the C-suite. So you create sets and then baseline against sets, or you baseline [07:32.820 --> 07:38.420] against entity. And that's pretty important when you look at how to exploit them. So what baseline [07:38.420 --> 07:44.560] are you going to exploit? We'll look at baseline boiling a little bit. Supervised machine learning [07:44.560 --> 07:48.780] versus unsupervised machine learning is you take all the variables in unsupervised machine learning [07:48.780 --> 07:55.720] and you find every possible relationship against the different data. So if you have 15, if you have [07:55.720 --> 08:02.020] packets versus port versus bytes versus, you know, all these things you can look at, what are the [08:02.020 --> 08:07.100] distributions of those sets? And then what do those sets mean when we see them? And that was actually [08:07.100 --> 08:13.440] one of the main pieces of the Therminator research. So as a product in the industry, [08:13.440 --> 08:20.020] network behavioral anomaly detection is looking at a horizontal traffic. Normally inside the network it's [08:20.020 --> 08:26.280] looking at net flow generally. There's also the ability for probe solutions. But you don't, because [08:26.280 --> 08:32.460] you're counting things, you don't need to inspect the characteristics of the payload, right? We don't, [08:32.460 --> 08:38.440] so this is one thing that's sort of safe from encryption. Because you don't care what's in the [08:38.440 --> 08:42.240] payload, you care what's in the header. How many packets, how many bytes, how many connections, [08:42.240 --> 08:48.880] those kind of things. It also tends to look at solving horizontal east-west conversations. [08:48.880 --> 08:52.480] What are the, how much data is being transferred from data center to data center or whatever. [08:53.580 --> 08:59.700] And that's why net flow or other meta type tools work there. Almost no one definitions, we'll get [08:59.700 --> 09:06.620] the fun part. That's a list of stuff from Gartner on people that do NBAD. Types of anomalies you [09:06.620 --> 09:16.700] look for are service traffic thresholds, so how much web traffic was consumed from China in a day, [09:16.700 --> 09:21.720] right? And so you look at that type of thing. It also fits in the geographic traffic anomaly, [09:21.720 --> 09:29.880] how much traffic is impacting on a given geo. Data hoarding or data staging is if you expect a host [09:29.880 --> 09:36.800] to consume 10 megs a day from the network services and now they just consumed 100 megs, [09:36.800 --> 09:41.380] that's a mathematical anomaly against what you expected in the baseline. So those are just [09:41.380 --> 09:49.200] observing network patterns. When we look at UBA, really what this solves is where do you do an [09:49.200 --> 09:53.120] investigation? Those of us who have been doing this for a couple of decades remember the days [09:53.120 --> 09:58.500] where we had alarm tables. We started to be on alert at the top of the table, we'd prioritize [09:58.500 --> 10:03.500] them on different types of metrics, which one was scarier, which was our confidence level, [10:03.500 --> 10:09.100] all these things that came in sort of in the really initial IDS, IPS days. And we'd work our [10:09.100 --> 10:15.160] way down that list. The next sort of thing that happened was host-centric investigations to where [10:15.160 --> 10:20.540] you take the alarms and you attach them to the network devices that are generating the alarms [10:20.540 --> 10:27.120] and then you investigate that host. And so you correlate them there. And then the first part of [10:28.020 --> 10:36.020] user-entity behavioral analysis is putting the alarms on the credential level. So if there's [10:36.020 --> 10:41.480] three different machines used, but one credential used, you investigate the user credential [10:42.160 --> 10:48.760] instead of the host level. And what it does is it provides a boil down of all of those alerts. So [10:48.760 --> 10:52.660] there could be hundreds or thousands of alerts that are attached to one set of credentials. [10:53.400 --> 11:01.640] And then this is the interface that I use. This is using Cytoscape, which is a bioinformatics [11:01.640 --> 11:08.920] graph library. So when you look at user-based anomaly, I'm almost done with definitions, [11:08.920 --> 11:15.080] and we'll do the actual exploits. A couple of things, geographic traffic or magic carpet [11:15.080 --> 11:20.040] type of attacks. If a guy always logs in in Columbus, Ohio, and then all of a sudden he's [11:20.040 --> 11:25.840] logging in from Tehran, that's a geographic anomaly that he's too far outside of where he [11:25.840 --> 11:30.700] normally logs in. A time of day, if they're always logging in at 8 o'clock in the morning or during [11:30.700 --> 11:36.300] the morning hours, and all of a sudden he starts logging in at 2 o'clock in the morning, that's a [11:36.300 --> 11:43.080] time of day anomaly. Different types of hosts. So when you categorize how does that user get onto [11:43.080 --> 11:50.520] the network? Is it only on guest wireless or are they logging into servers? So in those types of [11:50.520 --> 11:56.200] access change, it's also a type of anomaly. And then what services? If it's only consuming email [11:56.740 --> 12:01.700] and the internet is the baseline, then all of a sudden we're looking at something like [12:02.800 --> 12:09.460] accessing core data services like SQL or something like that, then that's an anomaly in itself. [12:09.460 --> 12:14.720] All right, so now that's a million things that do UBA. So let's talk about how to poison the [12:14.720 --> 12:21.620] data now. So there's really three types of poisoning that we're going to go over here today. [12:21.680 --> 12:28.200] The first is mass implication, which means if I'm attacking from this computer, [12:28.200 --> 12:33.000] I don't want you to investigate this computer because I'm going to make it look like everybody's [12:33.000 --> 12:37.280] attacking the network. It's not just my computer, everyone's attacking. So you have to figure out [12:37.280 --> 12:45.160] which one's the real attacker. Second one is baseline boiling, is contributing to the [12:45.160 --> 12:49.880] calculations of baselines in a way that they grow. So if you're doing something like data [12:49.880 --> 12:55.460] exfiltration or time of day, you just slowly contribute data that makes it to where the [12:55.460 --> 13:00.080] baseline is so big that it's useless, that everything is always okay. Everything is [13:00.080 --> 13:06.800] always normal because you're contributing that data in a slow way. Attack masking is when we [13:06.800 --> 13:12.900] send one record to offset another record. So this is really good in recon. So if I send a send packet [13:13.260 --> 13:18.460] and a send act doesn't come back, I can generate a record that said a send act came back. So now it [13:18.460 --> 13:23.340] doesn't look like the scan anymore. It looks like a two-way handshake occurred. The ways we're going [13:23.340 --> 13:29.740] to do it is log spoofing, which means we're going to generate false logs. We're just going to lie. [13:29.740 --> 13:34.960] We're going to create a log. We're going to get it into the processing system and just write [13:34.960 --> 13:40.840] whatever we want. The second approach we do is behavioral spoofing. So we make it look like that [13:40.940 --> 13:46.980] a behavior happened on the network that didn't actually happen. And so the way that we're going [13:46.980 --> 13:51.480] to do this is one, we can do it from a machine we own on the network. We can do it from a VM [13:51.480 --> 13:57.040] or containers. A lot of the code I'm going to give up here is going to be via Docker containers. [13:57.160 --> 14:03.520] And we can also trick networking devices into lying for us by doing fake telemetry [14:03.520 --> 14:07.540] that makes the networking device think that something happened that didn't really happen. [14:08.360 --> 14:15.640] So the end goal of this is, on the left, is an attack that happened at a university [14:16.240 --> 14:24.320] of data exfiltration going from left to right. And when you look at UBA tools and tools that [14:24.320 --> 14:31.620] utilize graph theory, what you're driving for in developing these visualizations is clarity [14:31.620 --> 14:37.380] to the investigator. You take thousands or tens of thousands of events, you contextualize them [14:37.380 --> 14:43.620] against the modus operandi of the attacker, and then you render it and the investigator's like, [14:43.620 --> 14:47.520] yep, someone's stealing our data. We're on stage two of this particular kill chain, [14:47.520 --> 14:53.480] this particular MO. And then that's easy to investigate, and then the bad guy's killed. [14:54.000 --> 14:58.400] What we're going to look at in poisoning is, if you can, we move to being invisible, right? [14:58.400 --> 15:05.480] We erase the records that we did an attack, so that there's no record. That's actually pretty [15:05.480 --> 15:11.700] hard, so I like the second one better. Make it look like everything's screwed, right? And so [15:11.700 --> 15:17.600] make it look like every single thing on the network is infected, and an attacker make everything look [15:17.600 --> 15:22.040] horrible, and you can't investigate any of it. So this is what we're going to drive at toward [15:22.040 --> 15:29.540] in these exploits. So real quick on how to protect against this, and this is sort of the key part if [15:29.540 --> 15:35.900] you have to tell people how to fix it. We have a really bad problem with non-repudiation and logging. [15:35.920 --> 15:45.300] UDP is a really crappy way to get data logging into a system. TLS is really, it's a pain too, [15:45.300 --> 15:53.340] because of the overhead of the TCP handshake, as well as the encryption handshake. And for [15:53.340 --> 16:00.120] some technologies, it's not even possible. RFC 5101, which establishes IPFIX as a metadata for [16:00.930 --> 16:09.060] sending out network communications, it's written to support TLS encryption or transport, but [16:09.980 --> 16:15.280] no one does it. So you can't buy a tool that actually complies with that part of the RFC. [16:15.300 --> 16:19.440] It also does, of course, add client overhead, server overhead. You can run into [16:20.540 --> 16:26.940] reflection, denial of service, all those things as well. And spoofing, right? So people, you can [16:26.940 --> 16:31.140] just lie. There's nothing with the UDP packet in particular that keeps you from saying in the [16:31.140 --> 16:36.080] header that I am whatever IP address I want to be. And as long as that packet can route to the [16:36.080 --> 16:42.720] destination, I look, it sounds like I, it looks to the server like I did that. And so tools like [16:42.720 --> 16:48.520] Cisco have the overhead of doing a reverse path lookup to make sure that if you're saying you're [16:48.520 --> 16:56.020] sending from 10.10.5.5, that you're really on that segment. Then really the other part is protecting [16:56.020 --> 17:03.880] the collection infrastructure. The tools that are generating telemetry should be in a segment that [17:03.880 --> 17:10.660] is the path to the analysis is protected. So everyone can't, no one on the network can send [17:10.660 --> 17:18.240] logs unless they're in an authorized segment. I do, I also put up here honeypot. So if you're [17:18.240 --> 17:22.620] doing any type of deception, that stuff, that stuff is really cool when you run into everything's [17:22.620 --> 17:28.620] infected because you get real telemetry because nothing should be talking to a non-existent box. [17:28.620 --> 17:34.500] So it's really the tripwire of figuring out where is the real guy when all of the analysis fails. [17:34.840 --> 17:40.320] And really another core part here is as you're receiving data, it needs to be tagged on how it [17:40.320 --> 17:47.360] was received, right? What listening service received it on what port? What were the authentication [17:48.720 --> 17:53.340] components that happened? Was it sent over TLS? Was it sent over UDP? And those types of things [17:53.340 --> 17:58.360] so that when you run into a poisoning scenario, you can filter out the stuff that meets the criteria [17:58.360 --> 18:05.580] of poisoning because you logged that as it came in. The things we're going to go over really fit [18:05.580 --> 18:11.340] in all parts of the MITRE ATT&CK matrix for enterprise except for initial access. [18:11.840 --> 18:16.020] So the first technique is really simple. It's just what I call a pump and dump. [18:16.320 --> 18:22.800] So what you do is you're going to spin up a container or VM. I'm going to give you the [18:22.800 --> 18:27.600] code on the container here in a second using a Docker container. You assign it a MAC address. [18:27.600 --> 18:31.800] You can pull an IP address from DHCP or assign your own IP address. You do stuff, [18:31.800 --> 18:38.980] like maybe you do recon. And then you kill that container. You reassign a new MAC address, [18:38.980 --> 18:44.200] pull a new IP address, and then do something else. And so in the logging in the system, [18:44.200 --> 18:47.680] you're spoofing the IP address, you're spoofing the MAC address. They can't find the machine [18:47.680 --> 18:52.740] because it vaporizes, right? So it's the same machine, but it keeps popping up using [18:53.960 --> 19:00.860] a different networking component. So this is a Docker version with Kali Linux. [19:00.860 --> 19:06.040] So the first thing is that one line creates the container, and it'll actually pull from [19:06.040 --> 19:11.060] Docker Hub if you have an internet connection. It establishes whatever MAC address you want [19:11.060 --> 19:18.420] to use. In this scenario, it's going to pull a DHCP address. So that way you know it can route. [19:18.500 --> 19:24.880] And there's a record. You do stuff. So you create the container. You start the container. [19:24.880 --> 19:29.320] That gives you a shell into the container. You do all the stuff you want to do, right? [19:29.320 --> 19:33.670] These scenarios will go through a little bit or anything else. Then you kill the container, [19:34.440 --> 19:39.360] spin up a new one with a new MAC address, pull a new IP address, and then repeat. So it looks like [19:39.360 --> 19:45.400] you have this machine that pops up for a few minutes. It might hit something, flag it, but [19:45.400 --> 19:53.360] it's gone by the time the responders can deal with it. This one's really fun. It's what I call a [19:53.360 --> 19:58.420] pocket dimension. So a lot of access switches now are sending telemetry. Wireless access points do [19:58.420 --> 20:04.720] this a lot, things like Meraki or Mist, where they just believe the traffic happening on the [20:04.720 --> 20:13.100] access point is really happening. So you spin up several containers on a fake network. And it can [20:13.100 --> 20:17.760] be on a Slash 2, a Slash 4. You might be able to get a Slash 0 to work, but I generally run on a [20:17.760 --> 20:23.240] Slash 4. And you spin up an external host. It could be a Microsoft host or whatever IP addresses [20:23.240 --> 20:31.180] you want. And then you do things to those fake machines. So it looks like 10.10.5.5 is communicating [20:31.180 --> 20:38.420] with 8.8.8.8, but it's not. It's communicating with your 8.8.8.8. And so you can generate all [20:38.420 --> 20:43.360] these false traffic patterns, whether they're inside the network or outside of the network, [20:43.360 --> 20:49.260] by creating the containers, launching the traffic that you're lying about. You're creating a behavior [20:49.260 --> 20:58.300] in this fake network. That fake network is bound to the NIC. The NIC is then being monitored by [21:01.000 --> 21:06.420] the wireless access point. A wired access switch is generating either syslog or [21:06.420 --> 21:15.060] NetFlow telemetry. That stuff is already configured to ship it to the syslog or NetFlow or UBA tools. [21:15.080 --> 21:18.840] So you're generating all this fake traffic and it gets shipped out. So it looks like this. This [21:18.840 --> 21:27.840] is two different machines. You create a network bridge called Pocket, or a Docker network called [21:27.840 --> 21:38.680] Pocket. You bridge that across to the physical network that's on the bridge command there. [21:38.880 --> 21:45.700] Spin up containers, have the communications you want, whether that uses for boiling baselines, [21:45.700 --> 21:51.080] you could use it for doing recon, you could scan the whole internet if you want. [21:51.180 --> 21:56.140] Whatever you wanted to do, but it's happening in this fake network, but generating real telemetry [21:56.140 --> 22:05.800] inside of the security architecture. This one is a little bit harder, or should be harder, [22:05.800 --> 22:11.780] is just spoofing records directly to the log collector, whether that's syslog or NetFlow, [22:11.780 --> 22:14.640] but you have to find it first. And I'll show you a couple of techniques for [22:15.260 --> 22:20.300] resolving this. First is you can look for DNS things, because people name them like [22:21.320 --> 22:27.080] syslogcollector.acme.local, right? So doing some basic DNS lookups will probably reveal [22:27.080 --> 22:32.380] something, give you a step towards where the collector is. If you have a compromised machine [22:32.380 --> 22:37.150] that's already generating telemetry, that's just a TCP dump on that machine to figure out what it's [22:37.150 --> 22:45.630] with over NetFlow or syslog pieces, you can just do a SYN scan. If something's collecting syslog, [22:45.630 --> 22:51.590] they're going to be open on 514, see if you get a SYNAC back on any of those. But once you discover [22:51.590 --> 22:56.030] it, you're just going to spoof records that can say anything that you want, because record [22:56.030 --> 23:01.890] collection stinks right now. And then you can just do a pump and dump, right? Create the records, [23:01.890 --> 23:05.650] drop that machine, create more records from a new machine. [23:06.730 --> 23:10.710] So if you don't know how to send syslog over Netcat, that's how you do it. [23:11.370 --> 23:19.610] Syslog is really uncomplicated. So you can send any message you want. Most syslog formats from [23:19.610 --> 23:24.410] different tools are very well documented. There are plugins for it, but essentially just Netcat [23:24.410 --> 23:30.630] anything you want to the port of the server, and the server will process it as if it is the gospel. [23:30.630 --> 23:37.090] So another cool way of doing is what I call a UDP spray. There's a cool project on GitHub [23:37.090 --> 23:41.670] called Samplicator. And essentially what it does is it opens up a socket, it listens for a UDP [23:41.670 --> 23:46.630] packet, and you have rule-based systems that say, when I receive packets from the following sources [23:46.630 --> 23:51.730] or they have the following characteristics, forward those packets to the following destinations. [23:52.010 --> 23:58.790] And what it does is it maintains the original header. So if you sent from 10.1.1.1, [23:58.790 --> 24:04.290] it looks like 10.1.1.1 when it hits the final destination and not the Samplicator IP address. [24:04.650 --> 24:11.110] So you can just load up class B's worth of IP addresses and just say, I'm going to send a packet [24:11.110 --> 24:15.930] into Samplicator and it's going to spray it out to every possible destination. Some detection [24:15.930 --> 24:21.070] mechanisms may see a UDP flood or something like that because of the number of UDP packets coming [24:21.070 --> 24:28.690] out. But this is one way to get the packet to the destination if there's a route to it. So it's [24:28.690 --> 24:33.770] send it to everybody, and whoever picks up on that log just receives the log. And that's really all [24:33.770 --> 24:39.750] that you have to do there. Samplicator is a very simple application to use. Then it's used the [24:39.750 --> 24:43.930] previous slide to generate the Netcat message, send it to Samplicator, and then it shoots it out [24:43.930 --> 24:51.270] to all the UDP destinations. For things that are using TLS, this is some really simple Python code. [24:53.530 --> 24:57.670] That's all you need to do to send a message. You'll see the message is right here on the [24:57.670 --> 25:03.050] socket. The rest of it's just removing verification. So if the endpoint does [25:03.050 --> 25:07.010] require certificate verification, you're obviously going to have to get a hold of a good certificate [25:07.010 --> 25:11.770] here, which actually might not be too hard if you own a machine because the machine will have a [25:11.770 --> 25:17.970] certificate on it if it's already shipping logs. But that's the Python stuff there. And again, [25:17.970 --> 25:25.370] if anybody needs these slides, they're just at Charles Herring, charlesherring.com. [25:25.870 --> 25:29.910] Give them to you right here on the thumb drive that I would not recommend you plug into your [25:29.910 --> 25:38.530] machine. Next thing is, here's another approach. So there's a tool called nProbe. There's an [25:38.530 --> 25:46.610] open source version. It sniffs a NIC. So it sniffs the packet capture and it creates NetFlow records. [25:46.870 --> 25:51.750] And so in the case of like a pocket dimension, you're running these different attacks, [25:51.750 --> 25:58.790] have nProbe generate the metadata about those fake attacks and forward those on to the collector, [25:58.790 --> 26:03.830] right? Whether you do that through a UDP spray or you already know the end destination of where [26:03.830 --> 26:11.830] you're going. So grab that from nTop, friends over there. A lot of stuff starting to move towards [26:11.830 --> 26:16.710] REST APIs. So Elasticsearch, Splunk, those types of devices. If you're making a, you want to make [26:16.790 --> 26:21.190] a direct right there. This is an example for Elasticsearch in the format. It really is just [26:21.190 --> 26:31.350] message colon. So this is a JSON post to the Elasticsearch API. So you can do that. But [26:31.350 --> 26:35.190] generally, if you're using Elasticsearch, you also have available something's listening on [26:35.190 --> 26:40.910] syslog somewhere. Mike's dying. Okay. All right. So let's do a scenario. [26:42.990 --> 26:48.750] We want to recon the network, but we want to cover our tracks by making it look like everybody's [26:48.750 --> 26:53.950] reconning the network, right? And so they can't, they won't find our machine until it's way too [26:53.950 --> 27:01.730] late. So best way to do this is in a pocket dimension and generate, you can generate the [27:01.730 --> 27:05.830] fake records, right? So you're scanning everything inside of the pocket dimension, [27:05.830 --> 27:11.710] which is generating all these recon records that are getting forwarded off to the infrastructure. [27:12.530 --> 27:16.950] You could also do this by spinning up as many Docker containers as you want, spoofing the IP [27:16.950 --> 27:22.550] address if it's because it doesn't matter in recon, particularly if you're doing a send scan, [27:22.550 --> 27:27.030] if the packet comes back to the fake machines. So in the pocket dimension, you can do as many [27:27.030 --> 27:34.350] as you want. You can simulate some syntax, but it's really good in just getting a recon done. [27:34.350 --> 27:38.530] And they will know recon just happened. So the blue team will know recon just happened, [27:38.530 --> 27:41.290] but they won't be able to figure out where it actually came from or where the data was [27:41.290 --> 27:45.530] collected to shut it down. And also you could use a pump and dump here, of course, [27:45.530 --> 27:50.330] after you finish the recon from the machine that collected the data, kill the MAC address, [27:50.330 --> 27:56.630] kill the IP address, then create a new container for subsequent parts of the kill chain. [27:58.930 --> 28:04.470] This is something I talked about a little earlier, but if you're going to send, [28:04.470 --> 28:08.970] let's say you're scanning the network and you just want to create a bidirectional connection. [28:09.630 --> 28:13.910] Inside of the real network, you're scanning the whole network. And if you don't get a [28:13.910 --> 28:20.690] SYNACK back, you create a net flow record. In this case, it says there was a SYNACK, [28:20.690 --> 28:27.510] that the SYNACK did come back. So it will confuse detection mechanisms enough to prevent a scan [28:27.510 --> 28:33.050] from triggering because it has a record that the bidirectional connection actually occurred. [28:33.690 --> 28:38.330] There's also the ability to do this. There's a scanner. I'll see if I can post it later on [28:38.330 --> 28:43.150] to where it does this automatically. So you scan, the machine doesn't get a SYNACK back, [28:43.150 --> 28:50.290] and it knows where the flow collector is. You can generate a SYNACK record from the [28:50.290 --> 28:54.690] scanner itself. So it's this really simple Python script to shoot that out. [28:56.590 --> 29:03.610] And this one's sort of the fun one here. How do you boil a baseline? So boiling a baseline, [29:03.610 --> 29:08.270] and going back to the Venn diagram we had, anomaly detection catches everything. [29:08.270 --> 29:12.090] As long as you have visibility on everything, it will always generate an alert, right? [29:13.450 --> 29:17.690] Unless you break the baselines. And so if you think about the metric that you want to run [29:17.690 --> 29:23.350] against, whether that's doing a geographical attack, you need to move data. Data exfiltration [29:23.350 --> 29:31.770] is a big one here. If you need to move data to a segment on the Internet that normally doesn't [29:31.770 --> 29:37.610] transact that data, you're going to create records every day of data going out there. You start with [29:37.710 --> 29:44.110] a K, and the next day it's a K and a half, then it's 5K. And every day you just slowly move that [29:44.110 --> 29:50.850] baseline up by generating more and more telemetry that says that traffic happened that really did [29:50.850 --> 29:55.470] not happen. And so that can be done either by direct logging, so you're sending the logs [29:55.470 --> 30:03.050] directly to the collection source, or it can be by spoofing the behavior inside of a pocket [30:03.050 --> 30:09.330] dimension, right? Where you're executing these increasingly large, whether it's data transfers, [30:09.330 --> 30:13.350] time of days are another good one for this. Eventually, you should have every user logging [30:13.350 --> 30:19.510] on from every place at every hour of the day. And now you can never detect an anomaly in user [30:19.510 --> 30:25.810] behavior because everyone's always working everywhere. And so in that case, it's just [30:25.810 --> 30:30.870] generated a syslog record for authentication successful for user so-and-so, and then you just [30:30.870 --> 30:35.950] do that for every user that you need to use inside of a campaign. Any questions on that? [30:36.010 --> 30:39.750] I don't care if there's any questions, but I'm gonna drink this drink. [30:41.910 --> 30:51.970] Think about a question. All right, so this is the last piece. Just recapping this to prevent [30:51.970 --> 30:59.650] this stuff from happening. If you can do TLS, client-based authentication on record collection, [30:59.650 --> 31:04.350] that is ideal. Because then you're down to protecting the public key infrastructure, [31:04.350 --> 31:07.490] right? And if you lose the public key infrastructure, you're screwed, of course, so [31:07.490 --> 31:12.970] don't let that happen. But there is overhead there. So as you're scoping out products and [31:14.330 --> 31:19.630] resources for doing the logging, it has to be mindful of the overhead that's going to go into [31:19.630 --> 31:26.410] that logging collection. And then when you're building out tools, firewalls, EDRs, all those [31:26.410 --> 31:33.850] things, they need to be wrapped into their own DMZ. So if your teams have not built tooling [31:33.850 --> 31:41.730] telemetry inside of a bubble that communicates with the logging tools, you're going to have [31:41.730 --> 31:47.730] problems. If anybody can send data into the telemetry, you're sort of in trouble. But that [31:47.730 --> 31:56.370] is basically it. Get the thing there. I'll answer any questions. Thank you for having me. [31:56.410 --> 31:59.430] Applause.