WEBVTT

00:00.000 --> 00:01.500
All right, good morning.

00:01.660 --> 00:06.200
Thank you for coming out to the inaugural year of the Red Team Village.

00:06.800 --> 00:09.140
Hoping to have many, many, many more years.

00:09.160 --> 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.

00:17.040 --> 00:22.400
because we have so many amazing people in the red space field.

00:23.260 --> 00:26.800
And you had to go to all these different places to hear them and talk to them.

00:26.800 --> 00:30.260
So, we've got an amazing lineup of different folks.

00:30.440 --> 00:30.740
Mr.

00:30.740 --> 00:33.500
Charles Herring, he's got an immense background.

00:35.460 --> 00:37.720
You want to talk about me?

00:37.720 --> 00:38.880
There's a whole slide about me.

00:38.880 --> 00:40.080
It's my favorite topic.

00:40.080 --> 00:43.300
We're just going to do the whole hour about me.

00:43.840 --> 00:44.840
It's all about me.

00:44.840 --> 00:46.060
Anyway, well, thank you.

00:46.060 --> 00:48.080
Please give him a warm applause.

00:54.560 --> 00:59.880
We're going to do about 45-50 minutes and then we'll do some Q&A after that.

00:59.880 --> 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.

01:09.660 --> 01:13.400
If you want the deck, Twitter at Charles Herring, charlesherring.com.

01:13.400 --> 01:14.300
We'll shoot you to LinkedIn.

01:14.300 --> 01:17.400
You can grab this deck from either one of those places.

01:17.400 --> 01:19.020
It's uploaded to CDN.

01:19.120 --> 01:20.160
A little bit about me.

01:20.160 --> 01:23.220
This guy is actually me, though I do recognize it.

01:23.220 --> 01:25.940
I look like I ate him and had an allergic reaction.

01:27.860 --> 01:31.060
Life got hard during this time.

01:31.120 --> 01:32.520
I was in the Navy for 10 years.

01:32.520 --> 01:35.740
I spent seven years fixing F-18 Hornets.

01:35.840 --> 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.

01:42.840 --> 01:47.400
Ahead of that, I was detailed to be the network security officer at the Naval Postgraduate School.

01:47.400 --> 01:51.820
That was also a fun time when Chris Eagles spun up a school of root.

01:52.520 --> 01:58.360
So anyone that's old enough to remember that, one captured the flag here at DEFCON a handful of times.

01:58.820 --> 02:04.240
And at the time, we're trying to figure out how to operationalize cyber security operations.

02:04.240 --> 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.

02:20.780 --> 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.

02:28.120 --> 02:33.880
Georgia Tech had an arm that was doing something that later became called stealth watch.

02:37.320 --> 02:38.860
So it was the Naval Postgraduate School.

02:38.860 --> 02:40.060
It was called Therminator.

02:40.100 --> 02:41.220
You can Google that.

02:41.220 --> 02:43.200
NSA holds that code now.

02:45.440 --> 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.

02:56.380 --> 02:58.220
That company got acquired by Cisco.

02:58.640 --> 03:06.660
And about four years ago, I started a project called WIDFU that is setting out to orchestrate security operations.

03:06.660 --> 03:10.860
You can, if you are interested about that, there's www.widfu.com.

03:11.300 --> 03:13.000
So here's what we're going to cover today.

03:13.240 --> 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.

03:19.480 --> 03:24.140
Then we're really going to look at how to poison that data in the context of a red cell team.

03:24.140 --> 03:27.600
People are collecting data, they're analyzing it, they want to catch attacks.

03:27.940 --> 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.

03:35.300 --> 03:36.360
And so it's going to be two parts.

03:36.360 --> 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.

03:47.040 --> 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.

03:54.880 --> 03:58.620
So the packet, the file, it has some characteristic that's weird.

03:58.660 --> 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.

04:06.040 --> 04:09.040
I know that mold is not good, right?

04:09.240 --> 04:13.440
Behavioral detection is observing the subject after ingestion occurs.

04:13.440 --> 04:15.400
So sandboxing is really good at this.

04:15.400 --> 04:23.120
If I drink the drink and I become sick, that behavior tells me the object may have been bad, right?

04:23.120 --> 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.

04:29.800 --> 04:37.620
And then if anything happens that is not a categorized, whitelisted normal, it is abnormal, it is an anomaly.

04:37.760 --> 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.

04:54.060 --> 04:59.600
But in the relationships, anomaly detection create new behaviors.

04:59.600 --> 05:05.480
We see something new happening in the wild, and we categorize it as a nefarious behavior.

05:05.880 --> 05:08.660
So Heartbleed a few years ago was a good example of this.

05:08.660 --> 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.

05:19.300 --> 05:21.020
It's a net new behavior.

05:21.180 --> 05:28.080
And so we're able to tag that as an application denial of service.

05:29.320 --> 05:32.680
And then from behaviors, we are able to detect new signatures.

05:32.680 --> 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.

05:45.540 --> 05:48.760
And so those behaviors inform us on how to build new signatures.

05:48.760 --> 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.

06:01.340 --> 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,

06:18.160 --> 06:24.440
you're going to have alarms that are triggering that are uncategorized but non-nefarious.

06:26.060 --> 06:29.740
Anomaly-based detection, as we look at it, requires baselines.

06:29.740 --> 06:34.300
If you're establishing normal, you have to define what is normal.

06:34.420 --> 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.

06:43.280 --> 06:47.940
You can do mean, you can do different types of standard deviation.

06:47.940 --> 06:52.920
There's all kinds of models on what the baseline is, how many bytes.

06:52.920 --> 06:57.000
So what you start with is, what type of metric are we looking at?

06:57.000 --> 06:59.120
Is it packets transferred per second?

06:59.120 --> 07:01.740
Is it packets transferred per second against port?

07:01.740 --> 07:06.320
So you build a mathematical set of numbers that you're going to track.

07:06.320 --> 07:09.880
Second thing you have to figure out is, what is the baseline applied to?

07:09.880 --> 07:11.860
Is it applied to the entity?

07:11.860 --> 07:16.680
So are you baselining the behavior of every host or every user on the network?

07:16.680 --> 07:20.820
Or are you looking at set-based baselining?

07:20.820 --> 07:30.000
So all of the users in wireless, or all of the hosts that are belonging to the C-suite.

07:30.000 --> 07:33.940
So you create sets and then baseline against sets, or you baseline against entity.

07:33.960 --> 07:37.500
And that's pretty important when you look at how to exploit them.

07:37.500 --> 07:40.200
So what baseline are you going to exploit?

07:40.200 --> 07:42.240
We'll look at baseline boiling a little bit.

07:43.620 --> 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.

07:54.420 --> 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?

08:04.360 --> 08:06.560
And then what do those sets mean when we see them?

08:06.560 --> 08:10.660
And that was actually one of the main pieces of the Therminator research.

08:11.340 --> 08:19.000
So as a product in the industry, network behavioral anomaly detection is looking at a horizontal traffic.

08:19.000 --> 08:21.840
Normally inside the network it's looking at net flow generally.

08:22.220 --> 08:24.840
There's also the ability for probe solutions.

08:25.500 --> 08:32.200
But you don't, because you're counting things, you don't need to inspect the characteristics of the payload, right?

08:32.200 --> 08:37.540
We don't, so this is one thing that's sort of safe from encryption.

08:37.540 --> 08:39.780
Because you don't care what's in the payload, you care what's in the header.

08:39.780 --> 08:43.300
How many packets, how many bytes, how many connections, those kind of things.

08:43.660 --> 08:48.880
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:58.020
And that's why net flow or other meta type tools work there.

08:58.460 --> 09:00.240
Almost no one definitions, we'll get the fun part.

09:00.240 --> 09:04.940
That's a list of stuff from Gartner on people that do NBAD.

09:05.560 --> 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?

09:17.360 --> 09:18.940
And so you look at that type of thing.

09:18.940 --> 09:26.300
It also fits in the geographic traffic anomaly, how much traffic is impacting on a given geo.

09:26.300 --> 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.

09:40.600 --> 09:43.220
So those are just observing network patterns.

09:43.920 --> 09:50.040
When we look at UBA, really what this solves is where do you do an investigation?

09:50.160 --> 09:55.420
Those of us who have been doing this for a couple of decades remember the days where we had alarm tables.

09:55.780 --> 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.

10:08.200 --> 10:10.580
And we'd work our way down that list.

10:11.000 --> 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.

10:23.220 --> 10:25.340
And so you correlate them there.

10:25.340 --> 10:35.240
And then the first part of user-entity behavioral analysis is putting the alarms on the credential level.

10:35.240 --> 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.

10:43.720 --> 10:48.740
And what it does is it provides a boil down of all of those alerts.

10:48.740 --> 10:52.660
So there could be hundreds or thousands of alerts that are attached to one set of credentials.

10:53.400 --> 10:56.100
And then this is the interface that I use.

10:56.100 --> 11:03.160
This is using Cytoscape, which is a bioinformatics graph library.

11:03.780 --> 11:10.780
So when you look at user-based anomaly, I'm almost done with definitions, and we'll do the actual exploits.

11:11.760 --> 11:16.420
A couple of things, geographic traffic or magic carpet type of attacks.

11:16.420 --> 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.

11:27.520 --> 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.

11:38.140 --> 11:39.440
Different types of hosts.

11:39.440 --> 11:43.920
So when you categorize how does that user get onto the network?

11:43.920 --> 11:49.560
Is it only on guest wireless or are they logging into servers?

11:49.560 --> 11:53.620
So in those types of access change, it's also a type of anomaly.

11:53.620 --> 11:54.520
And then what services?

11:54.520 --> 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.

12:09.460 --> 12:13.100
All right, so now that's a million things that do UBA.

12:13.360 --> 12:15.580
So let's talk about how to poison the data now.

12:15.960 --> 12:21.620
So there's really three types of poisoning that we're going to go over here today.

12:21.680 --> 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.

12:34.240 --> 12:36.600
It's not just my computer, everyone's attacking.

12:36.600 --> 12:40.320
So you have to figure out which one's the real attacker.

12:40.420 --> 12:48.480
Second one is baseline boiling, is contributing to the calculations of baselines in a way that they grow.

12:48.560 --> 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.

12:59.620 --> 13:04.500
Everything is always normal because you're contributing that data in a slow way.

13:05.140 --> 13:09.520
Attack masking is when we send one record to offset another record.

13:09.740 --> 13:11.700
So this is really good in recon.

13:11.700 --> 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.

13:18.100 --> 13:19.700
So now it doesn't look like the scan anymore.

13:19.700 --> 13:21.660
It looks like a two-way handshake occurred.

13:22.560 --> 13:28.900
The ways we're going to do it is log spoofing, which means we're going to generate false logs.

13:28.900 --> 13:29.740
We're just going to lie.

13:29.740 --> 13:30.600
We're going to create a log.

13:30.600 --> 13:36.080
We're going to get it into the processing system and just write whatever we want.

13:36.120 --> 13:39.380
The second approach we do is behavioral spoofing.

13:39.380 --> 13:44.580
So we make it look like that a behavior happened on the network that didn't actually happen.

13:45.720 --> 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.

13:50.380 --> 13:52.560
We can do it from a VM or containers.

13:52.560 --> 13:57.040
A lot of the code I'm going to give up here is going to be via Docker containers.

13:57.160 --> 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.

14:08.360 --> 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.

14:19.760 --> 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.

14:32.980 --> 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.

14:45.000 --> 14:48.620
We're on stage two of this particular kill chain, this particular MO.

14:48.980 --> 14:53.480
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:04.840
We erase the records that we did an attack, so that there's no record.

15:04.840 --> 15:08.780
That's actually pretty hard, so I like the second one better.

15:08.920 --> 15:11.320
Make it look like everything's screwed, right?

15:11.320 --> 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.

15:20.160 --> 15:24.840
So this is what we're going to drive at toward in these exploits.

15:25.600 --> 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.

15:32.160 --> 15:35.900
We have a really bad problem with non-repudiation and logging.

15:35.920 --> 15:42.580
UDP is a really crappy way to get data logging into a system.

15:42.980 --> 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.

15:52.840 --> 15:55.700
And for some technologies, it's not even possible.

15:55.700 --> 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.

16:11.300 --> 16:15.280
So you can't buy a tool that actually complies with that part of the RFC.

16:15.300 --> 16:18.780
It also does, of course, add client overhead, server overhead.

16:18.780 --> 16:23.400
You can run into reflection, denial of service, all those things as well.

16:23.820 --> 16:26.340
And spoofing, right?

16:26.340 --> 16:27.560
So people, you can just lie.

16:27.560 --> 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.

16:34.120 --> 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.

16:41.360 --> 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.

16:54.280 --> 16:59.960
Then really the other part is protecting the collection infrastructure.

16:59.960 --> 17:08.620
The tools that are generating telemetry should be in a segment that is the path to the analysis is protected.

17:08.620 --> 17:14.040
So everyone can't, no one on the network can send logs unless they're in an authorized segment.

17:14.640 --> 17:17.960
I do, I also put up here honeypot.

17:17.960 --> 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.

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: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?

17:42.360 --> 17:45.500
What listening service received it on what port?

17:45.920 --> 17:49.720
What were the authentication components that happened?

17:49.720 --> 17:50.840
Was it sent over TLS?

17:50.840 --> 17:52.160
Was it sent over UDP?

17:52.420 --> 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.

18:03.980 --> 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.

18:11.840 --> 18:14.320
So the first technique is really simple.

18:14.320 --> 18:16.020
It's just what I call a pump and dump.

18:16.320 --> 18:22.420
So what you do is you're going to spin up a container or VM.

18:22.420 --> 18:25.560
I'm going to give you the code on the container here in a second using a Docker container.

18:25.800 --> 18:27.600
You assign it a MAC address.

18:27.600 --> 18:30.800
You can pull an IP address from DHCP or assign your own IP address.

18:30.800 --> 18:33.260
You do stuff, like maybe you do recon.

18:33.620 --> 18:36.140
And then you kill that container.

18:36.580 --> 18:41.740
You reassign a new MAC address, pull a new IP address, and then do something else.

18:41.740 --> 18:46.400
And so in the logging in the system, you're spoofing the IP address, you're spoofing the MAC address.

18:46.400 --> 18:49.160
They can't find the machine because it vaporizes, right?

18:49.160 --> 18:57.680
So it's the same machine, but it keeps popping up using a different networking component.

18:57.680 --> 19:00.860
So this is a Docker version with Kali Linux.

19:00.860 --> 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.

19:08.320 --> 19:11.500
It establishes whatever MAC address you want to use.

19:11.500 --> 19:14.260
In this scenario, it's going to pull a DHCP address.

19:14.260 --> 19:18.420
So that way you know it can route.

19:18.500 --> 19:20.000
And there's a record.

19:20.000 --> 19:21.300
You do stuff.

19:21.440 --> 19:23.560
So you create the container.

19:23.560 --> 19:24.880
You start the container.

19:24.880 --> 19:27.180
That gives you a shell into the container.

19:27.180 --> 19:29.320
You do all the stuff you want to do, right?

19:29.320 --> 19:32.360
These scenarios will go through a little bit or anything else.

19:32.360 --> 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.

19:38.720 --> 19:42.400
So it looks like you have this machine that pops up for a few minutes.

19:42.400 --> 19:49.440
It might hit something, flag it, but it's gone by the time the responders can deal with it.

19:51.000 --> 19:52.480
This one's really fun.

19:52.480 --> 19:54.200
It's what I call a pocket dimension.

19:54.280 --> 19:57.280
So a lot of access switches now are sending telemetry.

19:57.280 --> 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.

20:07.300 --> 20:12.760
So you spin up several containers on a fake network.

20:12.760 --> 20:14.660
And it can be on a Slash 2, a Slash 4.

20:14.660 --> 20:18.500
You might be able to get a Slash 0 to work, but I generally run on a Slash 4.

20:18.800 --> 20:21.180
And you spin up an external host.

20:21.180 --> 20:24.540
It could be a Microsoft host or whatever IP addresses you want.

20:24.640 --> 20:27.120
And then you do things to those fake machines.

20:27.120 --> 20:34.020
So it looks like 10.10.5.5 is communicating with 8.8.8.8, but it's not.

20:34.020 --> 20:36.940
It's communicating with your 8.8.8.8.

20:36.940 --> 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.

20:48.100 --> 20:52.220
You're creating a behavior in this fake network.

20:52.260 --> 20:56.300
That fake network is bound to the NIC.

20:56.300 --> 21:02.820
The NIC is then being monitored by the wireless access point.

21:02.820 --> 21:08.280
A wired access switch is generating either syslog or NetFlow telemetry.

21:08.280 --> 21:15.060
That stuff is already configured to ship it to the syslog or NetFlow or UBA tools.

21:15.080 --> 21:17.700
So you're generating all this fake traffic and it gets shipped out.

21:17.700 --> 21:18.680
So it looks like this.

21:18.680 --> 21:21.360
This is two different machines.

21:22.040 --> 21:28.980
You create a network bridge called Pocket, or a Docker network called Pocket.

21:29.000 --> 21:38.680
You bridge that across to the physical network that's on the bridge command there.

21:38.880 --> 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.

21:51.180 --> 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.

22:01.980 --> 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.

22:13.120 --> 22:16.660
And I'll show you a couple of techniques for resolving this.

22:16.660 --> 22:23.380
First is you can look for DNS things, because people name them like syslogcollector.acme.local, right?

22:23.380 --> 22:30.800
So doing some basic DNS lookups will probably reveal something, give you a step towards where the collector is.

22:31.060 --> 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.

22:43.990 --> 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.

22:50.810 --> 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.

22:57.930 --> 22:59.730
And then you can just do a pump and dump, right?

22:59.730 --> 23:05.650
Create the records, 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:14.950
Syslog is really uncomplicated.

23:15.490 --> 23:17.770
So you can send any message you want.

23:17.770 --> 23:21.930
Most syslog formats from different tools are very well documented.

23:21.990 --> 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.

23:30.630 --> 23:35.630
So another cool way of doing is what I call a UDP spray.

23:35.630 --> 23:38.250
There's a cool project on GitHub called Samplicator.

23:38.250 --> 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.

23:52.010 --> 23:54.910
And what it does is it maintains the original header.

23:54.930 --> 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.

24:04.650 --> 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.

24:15.290 --> 24:21.830
Some detection mechanisms may see a UDP flood or something like that because of the number of UDP packets coming out.

24:21.930 --> 24:27.790
But this is one way to get the packet to the destination if there's a route to it.

24:28.130 --> 24:32.570
So it's send it to everybody, and whoever picks up on that log just receives the log.

24:33.130 --> 24:34.890
And that's really all that you have to do there.

24:35.210 --> 24:38.310
Samplicator is a very simple application to use.

24:38.910 --> 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.

24:47.490 --> 24:51.270
For things that are using TLS, this is some really simple Python code.

24:53.530 --> 24:55.670
That's all you need to do to send a message.

24:55.670 --> 24:58.190
You'll see the message is right here on the socket.

24:58.190 --> 25:01.150
The rest of it's just removing verification.

25:01.150 --> 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.

25:14.130 --> 25:17.550
But that's the Python stuff there.

25:17.550 --> 25:25.370
And again, if anybody needs these slides, they're just at Charles Herring, charlesherring.com.

25:25.870 --> 25:30.670
Give them to you right here on the thumb drive that I would not recommend you plug into your machine.

25:33.330 --> 25:36.350
Next thing is, here's another approach.

25:36.350 --> 25:37.830
So there's a tool called nProbe.

25:37.990 --> 25:39.890
There's an open source version.

25:40.190 --> 25:41.150
It sniffs a NIC.

25:41.150 --> 25:46.610
So it sniffs the packet capture and it creates NetFlow records.

25:46.870 --> 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?

25:58.930 --> 26:04.290
Whether you do that through a UDP spray or you already know the end destination of where you're going.

26:04.290 --> 26:07.690
So grab that from nTop, friends over there.

26:10.070 --> 26:12.990
A lot of stuff starting to move towards REST APIs.

26:12.990 --> 26:15.670
So Elasticsearch, Splunk, those types of devices.

26:15.670 --> 26:18.010
If you're making a, you want to make a direct right there.

26:18.130 --> 26:20.690
This is an example for Elasticsearch in the format.

26:20.690 --> 26:23.750
It really is just message colon.

26:23.750 --> 26:29.070
So this is a JSON post to the Elasticsearch API.

26:30.050 --> 26:30.870
So you can do that.

26:30.870 --> 26:36.450
But generally, if you're using Elasticsearch, you also have available something's listening on syslog somewhere.

26:36.850 --> 26:37.990
Mike's dying.

26:38.330 --> 26:38.810
Okay.

26:39.430 --> 26:39.790
All right.

26:39.790 --> 26:40.910
So let's do a scenario.

26:42.990 --> 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?

26:50.470 --> 26:54.650
And so they can't, they won't find our machine until it's way too late.

26:55.050 --> 27:02.890
So best way to do this is in a pocket dimension and generate, you can generate the fake records, right?

27:02.890 --> 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.

27:12.530 --> 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.

27:25.370 --> 27:27.930
So in the pocket dimension, you can do as many as you want.

27:27.950 --> 27:34.350
You can simulate some syntax, but it's really good in just getting a recon done.

27:34.350 --> 27:36.630
And they will know recon just happened.

27:36.630 --> 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.

27:42.930 --> 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.

27:58.930 --> 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.

28:09.630 --> 28:12.870
Inside of the real network, you're scanning the whole network.

28:12.930 --> 28:17.890
And if you don't get a SYNACK back, you create a net flow record.

28:17.890 --> 28:22.490
In this case, it says there was a SYNACK, that the SYNACK did come back.

28:22.490 --> 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.

28:33.690 --> 28:35.930
There's also the ability to do this.

28:35.930 --> 28:36.910
There's a scanner.

28:36.910 --> 28:39.970
I'll see if I can post it later on to where it does this automatically.

28:39.970 --> 28:47.330
So you scan, the machine doesn't get a SYNACK back, and it knows where the flow collector is.

28:47.330 --> 28:51.070
You can generate a SYNACK record from the scanner itself.

28:51.070 --> 28:54.690
So it's this really simple Python script to shoot that out.

28:56.590 --> 28:59.530
And this one's sort of the fun one here.

28:59.930 --> 29:01.830
How do you boil a baseline?

29:01.830 --> 29:08.270
So boiling a baseline, 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:15.370
Unless you break the baselines.

29:15.510 --> 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.

29:22.650 --> 29:24.530
Data exfiltration is a big one here.

29:24.610 --> 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.

29:37.110 --> 29:42.070
You start with a K, and the next day it's a K and a half, then it's 5K.

29:42.250 --> 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.

29:51.670 --> 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?

30:03.770 --> 30:11.470
Where you're executing these increasingly large, whether it's data transfers, time of days are another good one for this.

30:11.510 --> 30:16.230
Eventually, you should have every user logging on from every place at every hour of the day.

30:16.270 --> 30:23.330
And now you can never detect an anomaly in user behavior because everyone's always working everywhere.

30:23.670 --> 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.

30:34.470 --> 30:35.950
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:43.290
Think about a question.

30:46.170 --> 30:48.730
All right, so this is the last piece.

30:49.750 --> 30:53.350
Just recapping this to prevent this stuff from happening.

30:54.070 --> 31:00.990
If you can do TLS, client-based authentication on record collection, that is ideal.

31:01.190 --> 31:04.670
Because then you're down to protecting the public key infrastructure, right?

31:04.710 --> 31:09.150
And if you lose the public key infrastructure, you're screwed, of course, so don't let that happen.

31:09.350 --> 31:10.730
But there is overhead there.

31:10.730 --> 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.

31:21.770 --> 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.

31:30.910 --> 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.

31:42.330 --> 31:46.290
If anybody can send data into the telemetry, you're sort of in trouble.

31:47.090 --> 31:50.070
But that is basically it.

31:51.410 --> 31:52.790
Get the thing there.

31:52.790 --> 31:54.530
I'll answer any questions.

31:54.830 --> 31:56.370
Thank you for having me.

31:56.410 --> 31:59.430
Applause.

