WEBVTT

00:00.000 --> 00:02.800
So, first off, thank you for coming.

00:02.800 --> 00:09.960
I know almost everyone wants to be either napping in a coma or in some kind of stupor around here at this point.

00:09.960 --> 00:11.760
So I do appreciate that.

00:11.980 --> 00:17.180
We are going to be talking about decision making and adversarial automation.

00:17.180 --> 00:19.640
I do have to give you a quick warning.

00:19.820 --> 00:21.780
This does contain math.

00:21.840 --> 00:26.920
I understand that some people have a very fraught relationship with math.

00:26.920 --> 00:31.700
And to quote my mother-in-law, math isn't supposed to have symbols or letters.

00:32.660 --> 00:34.740
So we'll try to keep that to the minimum.

00:35.940 --> 00:36.880
I'm Bobby.

00:37.980 --> 00:40.420
I'm a dad , husband, nerd.

00:40.420 --> 00:43.180
I chase rockets when I'm not breaking things.

00:44.620 --> 00:46.680
Michael O'Dell, or I go by Moke sometimes.

00:46.680 --> 00:48.320
I'm just a nerd that happens to work with him .

00:48.320 --> 00:49.820
He thought I'd be good for this talk.

00:49.980 --> 00:51.000
Pleasure to meet you.

00:51.000 --> 00:55.360
He's also making it a project to bonsai that, whatever that is.

00:55.760 --> 00:56.780
All right.

00:57.640 --> 01:04.400
So I know we've got a couple of blackjack players, statistically speaking here in the audience.

01:04.680 --> 01:07.780
You're probably basic system kind of folks, right?

01:07.780 --> 01:17.040
You know, you actually follow the rules and you're responding in a deterministic fashion to what happens.

01:17.040 --> 01:29.600
And then you have some random who sits down and starts, you know, hitting on an 18 or something equally insane.

01:31.360 --> 01:35.960
Randomness, chaos agents, floky worshipers, whatever you want to call that.

01:35.960 --> 01:39.600
So we're going to go through a couple of things here.

01:39.600 --> 01:47.340
We're going to talk about determinism versus probabilistic things, how that factors into decision making.

01:47.340 --> 01:51.780
And then we're going to show you a little demo that puts these principles into practice.

01:53.040 --> 01:56.760
So our friend, the stochastic parrot,

01:59.920 --> 02:08.640
the term comes from a paper on the dangers of stochastic parrots by Mary Bender and crew.

02:09.360 --> 02:11.940
Stochastic is probabilistic, random.

02:11.940 --> 02:15.460
Parrot, it doesn't, it isn't able to do anything new or novel.

02:15.460 --> 02:21.340
It is only able to regurgitate what it has been trained with, what it knows.

02:21.880 --> 02:29.440
On the flip side, and stealing from predator-prey dynamics, we have deterministic predators.

02:29.440 --> 02:40.040
So these are things that are going to be following a fairly robust sort of processes and are predictable to an extent.

02:40.040 --> 02:48.340
You know, you put meat down in front of a carnivore that hasn't eaten in a while, it's probably going to go after it, assuming it doesn't find you tastier.

02:50.440 --> 02:55.700
When we are making decisions, decisions are all about observing trade-offs.

02:56.700 --> 03:02.680
We can look at, do we learn more about an environment or do we do things to that environment?

03:02.820 --> 03:11.620
In particularly in adversarial work, do we go for stealth and linger for a long time or do we go for speed and get that knockout blow?

03:11.620 --> 03:34.080
For those of us who are trying to emulate the various classes of adversarial behavior, are we going for a smash and grab like a typical ransomware operation or are we trying to siphon out large quantities of data undetected for extensive periods of time?

03:34.980 --> 03:49.920
So when you are working in an adversarial situation with decision making, you're not the only decision maker that matters in this.

03:49.980 --> 03:51.960
The enemy gets a vote.

03:52.380 --> 04:04.140
So going back in time a ways, we've got this delightful concept, the OODA, observe, orient, decide and act.

04:04.140 --> 04:10.320
So make this a colleague has stepped to the other side of the stage.

04:10.320 --> 04:11.500
He's off to my right.

04:11.500 --> 04:18.380
I'm deciding to fling this bottle of water at him and at that action he now has to do the thing.

04:19.520 --> 04:24.360
The moment I choose to act, I screw up his loop.

04:26.080 --> 04:29.080
His decision making process has to reset.

04:29.080 --> 04:31.860
He now has to have observed that behavior.

04:31.860 --> 04:38.160
He has to decide what to do with it and so on and so forth.

04:38.320 --> 04:46.620
What this comes down to when we're talking about these decision making loops and who here has dealt with or runs a SOC?

04:47.600 --> 04:49.600
A couple of you.

04:50.040 --> 04:54.040
What's your average latency for event to alert?

04:55.700 --> 04:57.480
Anyone want to volunteer something?

04:58.760 --> 04:59.460
It's okay.

04:59.460 --> 05:00.380
This is a safe space.

05:00.380 --> 05:02.600
It's only recorded for the entire internet.

05:04.740 --> 05:13.170
Would anywhere between five minutes and I don't even want to know be a fair way of putting that?

05:14.320 --> 05:16.880
Well, that's the decision loop.

05:17.320 --> 05:21.980
The SOC has to observe, go through the whole process and decide what to do.

05:21.980 --> 05:33.720
Meanwhile, an attacker learning things as they go can make those choices and can move through the environment with a degree of rapidity.

05:33.720 --> 05:46.440
And every time the attacker has gone and done something, SOC moves to contain it, the attacker may already be on 17 other boxes and have compromised a dozen or more accounts depending on the speed of that.

05:48.060 --> 05:56.860
So there's a couple of different models that have emerged in decision making.

05:57.700 --> 06:04.520
Quick and dirty, let's say that we are able to know everything about an environment in order to make decisions.

06:04.520 --> 06:06.600
Markov decision process.

06:06.820 --> 06:12.100
We have a state, the existence of the universe.

06:12.160 --> 06:15.240
We have our set of actions that are allowed.

06:15.240 --> 06:22.440
We have the probability of using each one of those actions.

06:22.440 --> 06:28.780
We have some kind of reward and then there's a another fudge factor called a discount factor in there.

06:29.020 --> 06:35.080
Who remembers when Google DeepMind had an AI that it taught itself how to play Atari games?

06:36.740 --> 06:38.000
Okay, a couple of you.

06:38.000 --> 06:46.080
So you think an Atari game, you've got what gets displayed on the screen, that's the state, that's the universe.

06:46.080 --> 06:51.600
An Atari has four buttons, those are the actions that you can potentially exercise with that.

06:51.600 --> 06:58.280
And most of those games have a scoring function, there's a numerical integer based score for that.

06:58.280 --> 07:15.900
So it's really easy to have a model learn how to make decisions and predict what's going to be able to predict what actions at any given state are going to result in what it wants, which is the score to go up.

07:16.040 --> 07:29.580
But when you're working with an environment that you don't necessarily have full, complete and utter knowledge on, that's a whole different problem set.

07:29.660 --> 07:36.060
That's where we get into what's called a partially observable Markov decision process.

07:36.180 --> 07:39.660
There's a lot more letters, some of them look kind of funky here.

07:40.740 --> 07:52.840
But for every possible observation and the potentiality of the unobserved things, the unknown unknowns, have to be factored into this model.

07:52.840 --> 07:57.280
You don't know what you're going to find on that next subnet over after you've landed on a box.

07:57.280 --> 08:04.500
You don't know what services or what users with what access you're going to enumerate when you start.

08:04.880 --> 08:14.960
You can think of a straightforward MDP as the white boxiest white box assessment that you've ever conducted.

08:15.040 --> 08:21.100
Whereas a partially observable MDP is your black box.

08:21.100 --> 08:22.740
We're exploring as we go.

08:22.740 --> 08:24.580
We have to weigh actions.

08:24.580 --> 08:34.180
We have to weigh whether or not doing a thing that is going to give us more information about the environment is the best step versus actually taking action off of what we already know.

08:35.720 --> 08:43.300
So within those spaces, we've got a couple of ways of looking at this.

08:43.500 --> 08:46.800
Stochastic methodologies.

08:46.800 --> 08:54.640
Anytime that you are talking about decision planning, you can mentally substitute pi for probability.

08:54.680 --> 08:57.200
That's your spare math tip.

08:57.200 --> 08:58.840
A is always going to be action.

08:58.840 --> 09:01.760
S is going to be the state of the system.

09:01.760 --> 09:08.420
So if I've got four potential actions here that are valid for a state, there's an equal probability.

09:08.420 --> 09:10.500
We're just rolling the dice here.

09:12.280 --> 09:21.420
Random walk, no different than if we're letting a kid go and pick which block we land on for what we do.

09:22.120 --> 09:30.900
Whereas if we want predictability around these things, we go for a more deterministic process.

09:31.120 --> 09:38.640
So probability for a particular state, we're looking at the maximum quality action.

09:38.640 --> 09:41.980
So if we want to always pick the best thing that we could possibly do.

09:41.980 --> 09:46.040
If you've got admin credentials, you're going to want to do admin things.

09:55.660 --> 09:58.740
You're you've got predictability.

09:58.740 --> 10:00.500
You can explain why.

10:00.500 --> 10:08.060
You're not having to explain that there's some randomness in here.

10:08.280 --> 10:19.820
Now, where we get into some interesting elements is there's other risk factors that we can apply to the decision making process.

10:19.820 --> 10:22.780
It's not just a straightforward reward function.

10:22.820 --> 10:25.340
We can look at detectability.

10:25.340 --> 10:30.300
Is a particular action likely to trigger some kind of response?

10:30.960 --> 10:36.760
Is that going to, how is that impacted by where we are and what we're doing?

10:36.760 --> 10:42.180
There's a lot of gray area in this that's really challenging to model.

10:42.180 --> 10:48.300
I'm sure most of you have preferred detective controls.

10:48.540 --> 10:57.080
The things that if you are a tester, you hate going up against because they're reasonably good.

10:59.380 --> 11:02.340
So this is something that we can dial around.

11:02.880 --> 11:05.240
We can move it from zero to 100.

11:05.780 --> 11:09.760
If we're going straight with the math, it's more zero to one.

11:10.280 --> 11:12.740
But that's neither here nor there.

11:13.400 --> 11:20.920
We look at what's the worst thing that could happen versus what is the best that we can get out of this.

11:21.000 --> 11:23.260
That all gets weighed.

11:23.260 --> 11:28.280
And we can leverage that in a couple of different fashions.

11:28.320 --> 11:32.420
Worst thing that could happen, you had a foothold, now you don't.

11:34.440 --> 11:45.060
Ranging all the way up to you had a foothold and now you have some nice men from a federal agency banging on your door because someone didn't read their scope document.

11:46.620 --> 11:49.300
What's the best thing that we can get out of it?

11:49.300 --> 11:51.540
Is this going to allow us access to additional information?

11:51.540 --> 11:55.380
Is this going to allow us to move on to other systems?

11:55.380 --> 11:59.880
Is this going to allow us to perform actions that we couldn't perform before?

11:59.880 --> 12:04.740
Is this going to allow us to repurpose conference room equipment as an audio bug?

12:04.800 --> 12:09.680
There's all kinds of situations here.

12:11.220 --> 12:25.400
So when we're talking about building the adversarial decision making systems, you're going to want some kind of automation in place.

12:25.400 --> 12:29.260
Nothing should be done 100% by hand.

12:31.600 --> 12:43.960
But there's always a question of is this really the best thing that we can choose to do at this point in time given what we know and the state that we're in.

12:44.280 --> 12:51.940
And it turns out, like most challenging things, evaluation is really, really hard.

12:52.860 --> 13:03.160
How do you know without rerunning the scenario thousands of times through all the permutations that this is the best thing?

13:03.580 --> 13:11.540
A lot of really good adversary simulation folks, they don't really think about the environment.

13:11.540 --> 13:14.760
They feel the environment that they're operating in.

13:14.760 --> 13:18.880
There's an aspect of intuition that's really hard to codify.

13:19.980 --> 13:31.880
And the fact of the matter is, it's very, very hard to build scenarios where you can test this in a repeatable fashion.

13:32.140 --> 13:38.220
So we have a continuous debate between emulation versus simulation.

13:38.540 --> 13:51.120
With emulation on these models, you have a system that behaves like the real environment, but things happen in real life.

13:51.120 --> 13:53.520
Things happen on actual networks.

13:53.520 --> 14:00.700
They're not all perfectly deployed cookie cutter boxes, no matter what the DevOps people tell us.

14:03.100 --> 14:08.000
So emulation only gets you part of the way.

14:08.000 --> 14:11.740
Sometimes you just have to do it in real life.

14:11.980 --> 14:15.260
We just have to fire it off in actual environments.

14:17.280 --> 14:21.520
So that is a thing that we have to do.

14:22.460 --> 14:32.880
But what's nice is there are some delightful pieces of technology that have popped up in the last short bit that make this a lot easier for us.

14:32.960 --> 14:36.500
Who here has heard of or worked with LUDIS?

14:38.700 --> 14:39.980
Okay.

14:40.300 --> 14:43.020
You all have some nice take home bits.

14:43.220 --> 14:48.940
LUDIS is a tool for scanning up repeatable cyber ranges programmatically.

14:49.220 --> 15:00.700
Specter ops just dropped a tool that can take a blood hound export and reproduce it inside a LUDIS range, which is really sexy.

15:03.100 --> 15:06.220
So I'm going to skip along.

15:06.320 --> 15:14.180
We have different mechanisms for performing this decision making.

15:15.020 --> 15:29.760
If you were to imagine the optimum decision outcomes as a three dimensional surface, that's what policy gradients are.

15:29.860 --> 15:34.240
We have a probability, we have a set of actions, we have a set of states.

15:34.360 --> 15:37.920
That function can be represented any number of ways.

15:38.040 --> 15:51.160
It's more commonly found in environments where there's a degree of continuous behavior in terms of the actions.

15:51.160 --> 15:56.800
Are we turning the steering wheel 10 degrees or 12 degrees?

15:57.240 --> 16:04.660
But it is equally applicable to discrete actions where I'm going to run a particular command with a certain set of parameters.

16:04.660 --> 16:06.580
I'm going to press a certain button.

16:06.720 --> 16:10.540
I'm going to slam on the brakes because this guy keeps tailgating me.

16:11.900 --> 16:20.260
In the middle set of this, we've got another fun thing, Boltzmann exploration.

16:20.360 --> 16:27.460
This relies on a much more interesting set of elements.

16:28.700 --> 16:39.040
Anytime you see a cue with the state action, it's the quality of the state and action.

16:39.040 --> 16:50.600
So we're taking the probability of any particular action is represented as the overall relative quality against all of the things that are potentially there.

16:51.020 --> 16:59.040
Again, this is a somewhat more decidable model.

16:59.240 --> 17:04.640
And who here has worked with run books or checklists in their day-to-day?

17:04.720 --> 17:05.920
A couple.

17:06.040 --> 17:10.320
So decision trees are essentially checklists.

17:10.320 --> 17:12.480
What do we do at any particular time?

17:12.640 --> 17:15.880
These can be encoded algorithmically.

17:16.160 --> 17:26.930
The problem with this is it is a state machine.

17:28.450 --> 17:32.410
You can only have a finite number of things that you do.

17:32.410 --> 17:34.570
You have a finite number of conditions.

17:34.590 --> 17:36.690
You run through each of those.

17:36.690 --> 18:02.490
So if you are trying to avoid detection or other elements around that, it's challenging because you're following your rules and you're enemy, which may be the defender, may know what those rules are.

18:02.490 --> 18:11.130
They may have CTI from other organizations that have been impacted and they know what playbook you're using.

18:11.590 --> 18:21.490
Or maybe your company playbook got leaked and everyone is wondering about all of that fun training that you have going on.

18:22.670 --> 18:37.430
But with this, we can point at that chart and say, you know, we can go, when someone comes back and asks, why did you do thing X at time Y, we can point at the chart and go, see, that's why.

18:37.730 --> 18:39.770
We did it because we were domain admin.

18:41.050 --> 18:45.210
Now, there's one big problem with this.

18:45.850 --> 18:59.110
This is easy to deal with in toy scenarios where we're dealing with a very limited number of machines and environment, potential tools.

19:00.450 --> 19:19.290
When you look at the growth of a state space and the growth of the action space, that starts increasing on one of those fun curves that the computer scientists don't like.

19:21.350 --> 19:39.830
When you start getting into real world network environments where you have tens or hundreds of thousands of systems and similar numbers of services, huge numbers of users, you end up with a huge space that you have to chop through.

19:40.470 --> 19:43.250
And that's deeply problematic.

19:43.310 --> 19:45.010
Because it doesn't scale.

19:45.050 --> 19:51.450
And we don't necessarily have infinite processing capability around all of these fun things.

19:51.490 --> 19:53.490
So we make do.

19:53.670 --> 19:57.430
So we're going to want to borrow some techniques.

19:57.430 --> 20:02.990
And we know that environments and their connections can be represented in graphs.

20:04.310 --> 20:14.770
Everybody has learned from the bloodhound folks that attackers thinking graphs, that structure works for representing networks.

20:15.050 --> 20:21.470
But when you're deciding what to do, you can look at patterns within the graphs to filter that down.

20:21.470 --> 20:29.860
So we have this delightful technique called sub graph matching.

20:29.880 --> 20:41.400
Basically if we can define a pattern of prerequisites in a environment, in a graph, we can go through that graph looking for instances of that.

20:41.400 --> 20:49.280
And there's a lot of prior art on speeding up this technique on doing these fun things.

20:49.460 --> 21:00.040
Because social media networks have billions of nodes and you might want to query that in a relatively short time.

21:00.040 --> 21:05.380
Or let's say that you're a bank and you're looking for money laundering or potential tax evasion.

21:05.540 --> 21:13.320
You're looking at transaction pairs and amounts and who is moving money to whom and who are they moving money to.

21:13.320 --> 21:20.820
Those patterns are repeatable and distinct and can be relatively easy represented with this.

21:20.820 --> 21:27.300
So we've got a toy example that we've got a quick demo to show leveraging this.

21:28.160 --> 21:34.960
We use a property graph to represent the state of a environment.

21:35.040 --> 21:50.960
We have a, and we're releasing this bit, a domain specific language that's based on top of YAML for helping to define preconditions and what they look like in the graph to a particular tool use and what you expect to get out of it.

21:51.340 --> 22:00.660
And because Neo4j sucks in so many ways, it's not a good graph system for this.

22:01.980 --> 22:11.540
We've stumbled across an open source embedded graph database that runs in process, single file, doesn't require you standing up a server called Kuzu.

22:11.800 --> 22:15.320
It's good stuff, spun out of University of Toronto.

22:15.320 --> 22:19.500
I highly recommend you check it out if you're doing anything graphy that requires Cypher.

22:20.080 --> 22:23.680
So we're not directly taunting the demo gods.

22:23.680 --> 22:25.560
I went and had a recording.

22:26.100 --> 22:29.420
So I'm going to talk through this a little bit.

22:29.440 --> 22:32.920
But we're priming the system.

22:32.920 --> 22:47.180
I was just going to say that you can see here on the right side, basically the export of all this stuff, as we're going through the left side and capturing input from our user and going through the pen test days, you'll see we're starting to collect information on the right side here as it's being pulled in.

22:47.620 --> 22:48.780
Let's go through this a little bit.

22:49.800 --> 22:53.560
Simply say that as you can see as we're having inputs being brought in, the graph is starting to update.

22:53.560 --> 23:01.260
You'll see before long as we go through this, it will actually start to present some of the actual outputs and some of the stuff we can run in the system, actually showing the next step, essentially.

23:01.260 --> 23:14.920
So we've built a solution inside of our testing architecture where we're collecting console data from all of our operators' systems and we're able to use this to reconstruct their performance.

23:14.920 --> 23:17.620
So this is derived off of that.

23:17.620 --> 23:25.120
We're priming the pump here with some manual exploration commands simply to get things going.

23:25.320 --> 23:33.180
We're going to fast forward in just a second because nmap takes forever to run and I did not want to sit here.

23:33.180 --> 23:35.700
Everyone should be hearing the voice at this point.

23:36.700 --> 23:46.560
So nmap finishes, we'll abort out of that, it'll process that and go on start giving us commands to run in the environment.

23:47.900 --> 23:52.020
I am resisting using this so much.

23:52.900 --> 23:54.940
Come on.

23:57.860 --> 24:00.500
I can fast forward more if I need to.

24:00.920 --> 24:01.960
There we go.

24:02.720 --> 24:03.120
All right.

24:03.120 --> 24:09.640
So we're pulling out from the clipboard, pasting in, starting with some basic Linux.

24:10.240 --> 24:12.640
Eventually the model is going to get annoyed.

24:14.280 --> 24:16.860
Because it's running out of things that it can try.

24:17.280 --> 24:27.480
We only primed this example with 14 different tool usages just for the sake of quickness.

24:35.610 --> 24:38.610
Helps if I pay attention when I'm recording this stuff.

24:39.970 --> 24:47.850
You can see we're taking in new inputs every time and the next Now it's angry and wants to respond.

24:49.190 --> 24:51.410
We backed it into a corner.

24:52.230 --> 25:00.970
And we're going to skip ahead just a minute when it intercepts things.

25:00.970 --> 25:04.390
The test environment that we used for this was gated directory.

25:04.770 --> 25:07.010
Again, excellent work.

25:07.010 --> 25:07.990
Love it to death.

25:07.990 --> 25:14.190
It's great for sending out things like this and tools and all the other various things.

25:14.190 --> 25:15.710
So we've got a hash.

25:15.710 --> 25:18.490
We'll pop out of that so that it'll process that hash.

25:18.490 --> 25:25.150
And now that we've got a hash, we can decide to do some cracking.

25:27.250 --> 25:29.630
Which will happen in a moment.

25:33.930 --> 25:35.330
Crack and skip.

25:43.860 --> 25:44.880
Yay.

25:48.060 --> 25:51.320
We will get to that in just a second.

25:55.400 --> 26:00.280
But so we'll just finalize this out.

26:01.020 --> 26:07.940
We'll do a secret stamp on that because now that we've got a credential that we can run that, boom, we go.

26:09.740 --> 26:11.720
This is a toy example.

26:12.260 --> 26:17.220
We're working toward building similar systems for production use around this.

26:19.480 --> 26:20.960
Domain dumped.

26:21.060 --> 26:21.920
Yay.

26:22.280 --> 26:23.240
All right.

26:23.920 --> 26:25.500
Let me chuck forward.

26:25.540 --> 26:31.200
If you want to check out the DSL and use that to build things off of, that's awesome.

26:31.200 --> 26:32.260
We appreciate it.

26:32.260 --> 26:37.520
Thanks for adversary village for letting us come and bug you guys.

26:37.520 --> 26:41.220
Feel free to hit us up, reach out, all that fun stuff.

26:41.220 --> 26:47.180
And I will take questions out in the hall so that our next crew can come in and get set up.

26:47.180 --> 26:49.020
Thank you very much for your time, everyone.

