start	end	text
0	2800	So, first off, thank you for coming.
2800	9960	I know almost everyone wants to be either napping in a coma or in some kind of stupor around here at this point.
9960	11760	So I do appreciate that.
11980	17180	We are going to be talking about decision making and adversarial automation.
17180	19640	I do have to give you a quick warning.
19820	21780	This does contain math.
21840	26920	I understand that some people have a very fraught relationship with math.
26920	31700	And to quote my mother-in-law, math isn't supposed to have symbols or letters.
32660	34740	So we'll try to keep that to the minimum.
35940	36880	I'm Bobby.
37980	40420	I'm a dad , husband, nerd.
40420	43180	I chase rockets when I'm not breaking things.
44620	46680	Michael O'Dell, or I go by Moke sometimes.
46680	48320	I'm just a nerd that happens to work with him .
48320	49820	He thought I'd be good for this talk.
49980	51000	Pleasure to meet you.
51000	55360	He's also making it a project to bonsai that, whatever that is.
55760	56780	All right.
57640	64400	So I know we've got a couple of blackjack players, statistically speaking here in the audience.
64680	67780	You're probably basic system kind of folks, right?
67780	77040	You know, you actually follow the rules and you're responding in a deterministic fashion to what happens.
77040	89600	And then you have some random who sits down and starts, you know, hitting on an 18 or something equally insane.
91360	95960	Randomness, chaos agents, floky worshipers, whatever you want to call that.
95960	99600	So we're going to go through a couple of things here.
99600	107340	We're going to talk about determinism versus probabilistic things, how that factors into decision making.
107340	111780	And then we're going to show you a little demo that puts these principles into practice.
113040	116760	So our friend, the stochastic parrot,
119920	128640	the term comes from a paper on the dangers of stochastic parrots by Mary Bender and crew.
129360	131940	Stochastic is probabilistic, random.
131940	135460	Parrot, it doesn't, it isn't able to do anything new or novel.
135460	141340	It is only able to regurgitate what it has been trained with, what it knows.
141880	149440	On the flip side, and stealing from predator-prey dynamics, we have deterministic predators.
149440	160040	So these are things that are going to be following a fairly robust sort of processes and are predictable to an extent.
160040	168340	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.
170440	175700	When we are making decisions, decisions are all about observing trade-offs.
176700	182680	We can look at, do we learn more about an environment or do we do things to that environment?
182820	191620	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?
191620	214080	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?
214980	229920	So when you are working in an adversarial situation with decision making, you're not the only decision maker that matters in this.
229980	231960	The enemy gets a vote.
232380	244140	So going back in time a ways, we've got this delightful concept, the OODA, observe, orient, decide and act.
244140	250320	So make this a colleague has stepped to the other side of the stage.
250320	251500	He's off to my right.
251500	258380	I'm deciding to fling this bottle of water at him and at that action he now has to do the thing.
259520	264360	The moment I choose to act, I screw up his loop.
266080	269080	His decision making process has to reset.
269080	271860	He now has to have observed that behavior.
271860	278160	He has to decide what to do with it and so on and so forth.
278320	286620	What this comes down to when we're talking about these decision making loops and who here has dealt with or runs a SOC?
287600	289600	A couple of you.
290040	294040	What's your average latency for event to alert?
295700	297480	Anyone want to volunteer something?
298760	299460	It's okay.
299460	300380	This is a safe space.
300380	302600	It's only recorded for the entire internet.
304740	313170	Would anywhere between five minutes and I don't even want to know be a fair way of putting that?
314320	316880	Well, that's the decision loop.
317320	321980	The SOC has to observe, go through the whole process and decide what to do.
321980	333720	Meanwhile, an attacker learning things as they go can make those choices and can move through the environment with a degree of rapidity.
333720	346440	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.
348060	356860	So there's a couple of different models that have emerged in decision making.
357700	364520	Quick and dirty, let's say that we are able to know everything about an environment in order to make decisions.
364520	366600	Markov decision process.
366820	372100	We have a state, the existence of the universe.
372160	375240	We have our set of actions that are allowed.
375240	382440	We have the probability of using each one of those actions.
382440	388780	We have some kind of reward and then there's a another fudge factor called a discount factor in there.
389020	395080	Who remembers when Google DeepMind had an AI that it taught itself how to play Atari games?
396740	398000	Okay, a couple of you.
398000	406080	So you think an Atari game, you've got what gets displayed on the screen, that's the state, that's the universe.
406080	411600	An Atari has four buttons, those are the actions that you can potentially exercise with that.
411600	418280	And most of those games have a scoring function, there's a numerical integer based score for that.
418280	435900	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.
436040	449580	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.
449660	456060	That's where we get into what's called a partially observable Markov decision process.
456180	459660	There's a lot more letters, some of them look kind of funky here.
460740	472840	But for every possible observation and the potentiality of the unobserved things, the unknown unknowns, have to be factored into this model.
472840	477280	You don't know what you're going to find on that next subnet over after you've landed on a box.
477280	484500	You don't know what services or what users with what access you're going to enumerate when you start.
484880	494960	You can think of a straightforward MDP as the white boxiest white box assessment that you've ever conducted.
495040	501100	Whereas a partially observable MDP is your black box.
501100	502740	We're exploring as we go.
502740	504580	We have to weigh actions.
504580	514180	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.
515720	523300	So within those spaces, we've got a couple of ways of looking at this.
523500	526800	Stochastic methodologies.
526800	534640	Anytime that you are talking about decision planning, you can mentally substitute pi for probability.
534680	537200	That's your spare math tip.
537200	538840	A is always going to be action.
538840	541760	S is going to be the state of the system.
541760	548420	So if I've got four potential actions here that are valid for a state, there's an equal probability.
548420	550500	We're just rolling the dice here.
552280	561420	Random walk, no different than if we're letting a kid go and pick which block we land on for what we do.
562120	570900	Whereas if we want predictability around these things, we go for a more deterministic process.
571120	578640	So probability for a particular state, we're looking at the maximum quality action.
578640	581980	So if we want to always pick the best thing that we could possibly do.
581980	586040	If you've got admin credentials, you're going to want to do admin things.
595660	598740	You're you've got predictability.
598740	600500	You can explain why.
600500	608060	You're not having to explain that there's some randomness in here.
608280	619820	Now, where we get into some interesting elements is there's other risk factors that we can apply to the decision making process.
619820	622780	It's not just a straightforward reward function.
622820	625340	We can look at detectability.
625340	630300	Is a particular action likely to trigger some kind of response?
630960	636760	Is that going to, how is that impacted by where we are and what we're doing?
636760	642180	There's a lot of gray area in this that's really challenging to model.
642180	648300	I'm sure most of you have preferred detective controls.
648540	657080	The things that if you are a tester, you hate going up against because they're reasonably good.
659380	662340	So this is something that we can dial around.
662880	665240	We can move it from zero to 100.
665780	669760	If we're going straight with the math, it's more zero to one.
670280	672740	But that's neither here nor there.
673400	680920	We look at what's the worst thing that could happen versus what is the best that we can get out of this.
681000	683260	That all gets weighed.
683260	688280	And we can leverage that in a couple of different fashions.
688320	692420	Worst thing that could happen, you had a foothold, now you don't.
694440	705060	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.
706620	709300	What's the best thing that we can get out of it?
709300	711540	Is this going to allow us access to additional information?
711540	715380	Is this going to allow us to move on to other systems?
715380	719880	Is this going to allow us to perform actions that we couldn't perform before?
719880	724740	Is this going to allow us to repurpose conference room equipment as an audio bug?
724800	729680	There's all kinds of situations here.
731220	745400	So when we're talking about building the adversarial decision making systems, you're going to want some kind of automation in place.
745400	749260	Nothing should be done 100% by hand.
751600	763960	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.
764280	771940	And it turns out, like most challenging things, evaluation is really, really hard.
772860	783160	How do you know without rerunning the scenario thousands of times through all the permutations that this is the best thing?
783580	791540	A lot of really good adversary simulation folks, they don't really think about the environment.
791540	794760	They feel the environment that they're operating in.
794760	798880	There's an aspect of intuition that's really hard to codify.
799980	811880	And the fact of the matter is, it's very, very hard to build scenarios where you can test this in a repeatable fashion.
812140	818220	So we have a continuous debate between emulation versus simulation.
818540	831120	With emulation on these models, you have a system that behaves like the real environment, but things happen in real life.
831120	833520	Things happen on actual networks.
833520	840700	They're not all perfectly deployed cookie cutter boxes, no matter what the DevOps people tell us.
843100	848000	So emulation only gets you part of the way.
848000	851740	Sometimes you just have to do it in real life.
851980	855260	We just have to fire it off in actual environments.
857280	861520	So that is a thing that we have to do.
862460	872880	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.
872960	876500	Who here has heard of or worked with LUDIS?
878700	879980	Okay.
880300	883020	You all have some nice take home bits.
883220	888940	LUDIS is a tool for scanning up repeatable cyber ranges programmatically.
889220	900700	Specter ops just dropped a tool that can take a blood hound export and reproduce it inside a LUDIS range, which is really sexy.
903100	906220	So I'm going to skip along.
906320	914180	We have different mechanisms for performing this decision making.
915020	929760	If you were to imagine the optimum decision outcomes as a three dimensional surface, that's what policy gradients are.
929860	934240	We have a probability, we have a set of actions, we have a set of states.
934360	937920	That function can be represented any number of ways.
938040	951160	It's more commonly found in environments where there's a degree of continuous behavior in terms of the actions.
951160	956800	Are we turning the steering wheel 10 degrees or 12 degrees?
957240	964660	But it is equally applicable to discrete actions where I'm going to run a particular command with a certain set of parameters.
964660	966580	I'm going to press a certain button.
966720	970540	I'm going to slam on the brakes because this guy keeps tailgating me.
971900	980260	In the middle set of this, we've got another fun thing, Boltzmann exploration.
980360	987460	This relies on a much more interesting set of elements.
988700	999040	Anytime you see a cue with the state action, it's the quality of the state and action.
999040	1010600	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.
1011020	1019040	Again, this is a somewhat more decidable model.
1019240	1024640	And who here has worked with run books or checklists in their day-to-day?
1024720	1025920	A couple.
1026040	1030320	So decision trees are essentially checklists.
1030320	1032480	What do we do at any particular time?
1032640	1035880	These can be encoded algorithmically.
1036160	1046930	The problem with this is it is a state machine.
1048450	1052410	You can only have a finite number of things that you do.
1052410	1054570	You have a finite number of conditions.
1054590	1056690	You run through each of those.
1056690	1082490	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.
1082490	1091130	They may have CTI from other organizations that have been impacted and they know what playbook you're using.
1091590	1101490	Or maybe your company playbook got leaked and everyone is wondering about all of that fun training that you have going on.
1102670	1117430	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.
1117730	1119770	We did it because we were domain admin.
1121050	1125210	Now, there's one big problem with this.
1125850	1139110	This is easy to deal with in toy scenarios where we're dealing with a very limited number of machines and environment, potential tools.
1140450	1159290	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.
1161350	1179830	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.
1180470	1183250	And that's deeply problematic.
1183310	1185010	Because it doesn't scale.
1185050	1191450	And we don't necessarily have infinite processing capability around all of these fun things.
1191490	1193490	So we make do.
1193670	1197430	So we're going to want to borrow some techniques.
1197430	1202990	And we know that environments and their connections can be represented in graphs.
1204310	1214770	Everybody has learned from the bloodhound folks that attackers thinking graphs, that structure works for representing networks.
1215050	1221470	But when you're deciding what to do, you can look at patterns within the graphs to filter that down.
1221470	1229860	So we have this delightful technique called sub graph matching.
1229880	1241400	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.
1241400	1249280	And there's a lot of prior art on speeding up this technique on doing these fun things.
1249460	1260040	Because social media networks have billions of nodes and you might want to query that in a relatively short time.
1260040	1265380	Or let's say that you're a bank and you're looking for money laundering or potential tax evasion.
1265540	1273320	You're looking at transaction pairs and amounts and who is moving money to whom and who are they moving money to.
1273320	1280820	Those patterns are repeatable and distinct and can be relatively easy represented with this.
1280820	1287300	So we've got a toy example that we've got a quick demo to show leveraging this.
1288160	1294960	We use a property graph to represent the state of a environment.
1295040	1310960	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.
1311340	1320660	And because Neo4j sucks in so many ways, it's not a good graph system for this.
1321980	1331540	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.
1331800	1335320	It's good stuff, spun out of University of Toronto.
1335320	1339500	I highly recommend you check it out if you're doing anything graphy that requires Cypher.
1340080	1343680	So we're not directly taunting the demo gods.
1343680	1345560	I went and had a recording.
1346100	1349420	So I'm going to talk through this a little bit.
1349440	1352920	But we're priming the system.
1352920	1367180	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.
1367620	1368780	Let's go through this a little bit.
1369800	1373560	Simply say that as you can see as we're having inputs being brought in, the graph is starting to update.
1373560	1381260	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.
1381260	1394920	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.
1394920	1397620	So this is derived off of that.
1397620	1405120	We're priming the pump here with some manual exploration commands simply to get things going.
1405320	1413180	We're going to fast forward in just a second because nmap takes forever to run and I did not want to sit here.
1413180	1415700	Everyone should be hearing the voice at this point.
1416700	1426560	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.
1427900	1432020	I am resisting using this so much.
1432900	1434940	Come on.
1437860	1440500	I can fast forward more if I need to.
1440920	1441960	There we go.
1442720	1443120	All right.
1443120	1449640	So we're pulling out from the clipboard, pasting in, starting with some basic Linux.
1450240	1452640	Eventually the model is going to get annoyed.
1454280	1456860	Because it's running out of things that it can try.
1457280	1467480	We only primed this example with 14 different tool usages just for the sake of quickness.
1475610	1478610	Helps if I pay attention when I'm recording this stuff.
1479970	1487850	You can see we're taking in new inputs every time and the next Now it's angry and wants to respond.
1489190	1491410	We backed it into a corner.
1492230	1500970	And we're going to skip ahead just a minute when it intercepts things.
1500970	1504390	The test environment that we used for this was gated directory.
1504770	1507010	Again, excellent work.
1507010	1507990	Love it to death.
1507990	1514190	It's great for sending out things like this and tools and all the other various things.
1514190	1515710	So we've got a hash.
1515710	1518490	We'll pop out of that so that it'll process that hash.
1518490	1525150	And now that we've got a hash, we can decide to do some cracking.
1527250	1529630	Which will happen in a moment.
1533930	1535330	Crack and skip.
1543860	1544880	Yay.
1548060	1551320	We will get to that in just a second.
1555400	1560280	But so we'll just finalize this out.
1561020	1567940	We'll do a secret stamp on that because now that we've got a credential that we can run that, boom, we go.
1569740	1571720	This is a toy example.
1572260	1577220	We're working toward building similar systems for production use around this.
1579480	1580960	Domain dumped.
1581060	1581920	Yay.
1582280	1583240	All right.
1583920	1585500	Let me chuck forward.
1585540	1591200	If you want to check out the DSL and use that to build things off of, that's awesome.
1591200	1592260	We appreciate it.
1592260	1597520	Thanks for adversary village for letting us come and bug you guys.
1597520	1601220	Feel free to hit us up, reach out, all that fun stuff.
1601220	1607180	And I will take questions out in the hall so that our next crew can come in and get set up.
1607180	1609020	Thank you very much for your time, everyone.
