00:00:00.100-->00:00:06.306 >>Next we have uh Matt, uh all the way from the UK. He works at PwC. And he is going to talk 00:00:06.306-->00:00:12.279 about attribution and the hardest part of digital forensics, placing a person at a 00:00:12.279-->00:00:17.284 keyboard at a specific time. Let's give him a big round of applause. [applause] >>Cheers. 00:00:22.723-->00:00:26.727 Okay, uh hi everyone, thank you very much for coming. Uh so this is Betrayed by the Keyboard: How 00:00:26.727-->00:00:32.699 What You Type Can Give You Away. Um so just a disclaimer. It's for educational purposes only. 00:00:32.699-->00:00:37.704 In terms of what this talk isn't, did anyone come to my talk last year uh at DefCon? A 00:00:37.704-->00:00:43.644 couple of people so you might be a little bit disappointed. Um, so that talk about drones and 00:00:43.644-->00:00:48.382 lasers and ultrasonic pulses and I had some really nice feedback from people that said please do 00:00:48.382-->00:00:53.120 more of the same stuff next year. So this talk is all about inferential statistics. Um 00:00:56.356-->00:01:00.060 [laughter] So my name is Matt Wixey, uh I'm no good at taking direction apparently, uh and I 00:01:00.060-->00:01:04.932 lead research for PwC cybersecurity practice in the UK. Uh I work on this ethical 00:01:04.932-->00:01:10.571 hacking team, I'm a part-time doctoral researcher at UCL, uh and my previous job before PwC 00:01:10.571-->00:01:16.743 was working law enforcement in the UK uh leading a technical R&D team. So this talk is based 00:01:16.743-->00:01:21.748 on some research I did at UCL uh um before my PhD, it's now being continued at PwC. And I have an 00:01:24.351-->00:01:28.622 interest in in side-channel attacks generally. Um but what I'm particularly interested in 00:01:28.622-->00:01:33.393 is something I call human side channels, which is kind of unconsciously unconscious 00:01:33.393-->00:01:38.432 leakage of various um queues that can together be brought together to try and link things 00:01:38.432-->00:01:43.570 and attribute things. Uh my first degree was in English language and literature, so I 00:01:43.570-->00:01:49.910 have an interest in uh forensic linguistics. Uh and that kind of side channel approach as well. 00:01:49.910-->00:01:53.847 So I'm gonna cover what attribution is and some problems with traditional approaches to 00:01:53.847-->00:01:59.152 it; uh I'm then gonna move on to case linkage analysis or CLA, which is a possible solution to 00:01:59.152-->00:02:05.225 that. I'm gonna talk about an experiment I did at ULA to try and test that out um and cover 00:02:05.225-->00:02:09.396 the results and implications. And then I'm gonna sum up and I'll give some ideas for future 00:02:09.396-->00:02:15.602 research in this area as well. So what would we want to do attribution, what the benefits, 00:02:15.602-->00:02:20.207 what kind of types are they, what kind of approaches. So uh it's a bit of a hot topic in 00:02:20.207-->00:02:24.177 literature in terms of what we mean by attribution. Uh something that it means 00:02:24.177-->00:02:29.916 identifying the location, um or country or organizations behind an attack. Others think it means 00:02:29.916-->00:02:34.621 putting an actual individual at the keyboard, um and some people would think it it means trying 00:02:34.621-->00:02:39.493 to find a machine that as responsible or that was used rather than a human. Uh several 00:02:39.493-->00:02:45.699 benefits to doing it from an investigative point of view, um there's an argument that you may 00:02:45.699-->00:02:51.538 deter future attacks, again that's uh been again debated in the literature, but it's uh a 00:02:51.538-->00:02:56.376 perspective. Um interrupting and disrupting ongoing attacks, um and then depending on which side 00:02:56.376-->00:02:59.579 you're on and which side of the fence you're on, it's a desirable outcome um 00:02:59.579-->00:03:04.518 potentially. So Hutchins and others in 2011 uh categorized 3 different kinds of uh indicators 00:03:07.888-->00:03:14.127 of compromise, IOCs that could be used for attribution. Uh they talked about atomic IOCs, by 00:03:14.127-->00:03:17.898 which they mean things like IP addresses, email addresses, domain names, discrete 00:03:17.898-->00:03:23.603 identifiers basically. Uh they also covered computed IOCs, by which they mean hash values from 00:03:23.603-->00:03:29.409 malware, uh for instance. And then behavioral IOCs, what an attacker does on a computer once 00:03:29.409-->00:03:34.414 they have access to it. Now there's also sort of uh issues with some of these. Um so atomic 00:03:36.683-->00:03:41.321 IOCS, for instance, um the easiest result, depending on the amount of resources that are 00:03:41.321-->00:03:45.992 available to you, generally the most effective uh and the most direct in terms of finding out 00:03:45.992-->00:03:50.931 who did what, um but also the most easiest uh from an attacker's perspective to spoof 00:03:50.931-->00:03:55.936 or obfuscate or anonymize . Computed IOCs are only as good as the uh the particular method 00:03:59.039-->00:04:02.709 you're using. So if you're using a hash value to identify malware, for instance, perfectly 00:04:02.709-->00:04:06.179 valid approach, but slight changes to that malware would obviously result in a different 00:04:06.179-->00:04:12.719 hash value. Um along the same kind of lines, there are um other methods of computed IOCs, 00:04:12.719-->00:04:19.226 so one that's used quite a lot is trying to correlate malicious activity with um office hours in 00:04:19.226-->00:04:23.096 a particular time zone for instance, and then say that it was uh the attack was 00:04:23.096-->00:04:27.901 perpetrated in a particular location. Um so that's been used in a few studies, it's been used 00:04:27.901-->00:04:34.508 in a PcW um investigation last year called CloudHopper. Um there's also the approach we're 00:04:34.508-->00:04:40.080 trying to deanonymize programmers uh and developers either through their stylistics, 00:04:40.080-->00:04:45.352 so the way that they write code, or through artifacts in compiled code. Uh so Caliskan and others 00:04:45.352-->00:04:50.524 a few years ago um looked at trying to deanonymize developers through compiled binaries and 00:04:50.524-->00:04:57.397 Caliskan and Greenstadt did a talk this year at DefCon on uh um an extended um uh approach to 00:04:57.397-->00:05:02.836 that. You can also look at similarities in malware, in the capabilities malware has and try 00:05:02.836-->00:05:07.340 and use that as an attribution technique. So a good example of that would be Stuxnet and 00:05:07.340-->00:05:12.846 DOS/Coup, which both had similar capabilities. And then finally you can try and just look at if 00:05:12.846-->00:05:16.516 it's a human doing an attack or a bot. And that was done a few years ago, um based on various 00:05:16.516-->00:05:20.754 things, and I'm going to talk a little bit more about that particular study uh later on. 00:05:23.590-->00:05:28.295 The problem with all of these is that you're not so much focusing on an individual. You're 00:05:28.295-->00:05:33.133 focusing maybe trying to identify a state or a sponsor, something like that. And the the 00:05:33.133-->00:05:39.573 challenge from an investigative perspective then becomes procedural uh legal. Uh 00:05:39.573-->00:05:43.677 behavioral profiling uh on the other hand, is really interesting. Um it's less about 00:05:43.677-->00:05:48.114 attribution, uhnhow it's been historically in the literature, it's more about trying to 00:05:48.114-->00:05:53.119 understand uhnwho commits attacks and why they do it. Um there's been various studies 00:05:53.119-->00:05:57.657 looking at attackers' motivations, their skill levels, uh the kind of culture that 00:05:57.657-->00:06:02.729 would drive them to um to attack, their psychological motivations for that and that 00:06:02.729-->00:06:07.734 kind of thing. And then a subset of that category is attack profiling. So this is looking at 00:06:09.769-->00:06:14.474 um once an attacker is on a machine, what do they do. And it's not so much about 00:06:14.474-->00:06:19.145 attribution it's just trying to understand the process and the the flow of the attack. So I 00:06:19.145-->00:06:24.317 mentioned this study, uh Filippoupolitis and others in 2014 um looked at various 00:06:24.317-->00:06:29.489 metrics um from attacks, uh sort of skills in typing speed, number of mistakes, that kind of 00:06:29.489-->00:06:35.428 thing, uh to try to work out if it was a human attacking or a bot. Uh similarly, there have 00:06:35.428-->00:06:39.799 been studies looking at skill level of the attackers and about uh specific attacker behaviors 00:06:39.799-->00:06:44.804 on a compromised machine. So that's a really interesting approach um. What hasn't really 00:06:47.274-->00:06:52.345 been covered in the literature is trying to use that as a comparison method. So looking at 00:06:52.345-->00:06:57.250 attack behaviors on a machine and trying to use that to see if you can generate some kind of 00:06:57.250-->00:07:02.188 attack signature which can then be used to attribute attacks. So um this leads me on to talk 00:07:04.658-->00:07:09.663 about case linkage analysis. Uh has anyone heard of case linkage analysis before? Okay. A few 00:07:12.232-->00:07:17.604 people maybe? So it's a not a particularly well-known method. Um so to give you a bit of 00:07:17.604-->00:07:22.042 background, uh a few years ago, I had no idea, which is, uh trust me, it's quite a rare um 00:07:22.042-->00:07:28.315 event. Um so I was lurking in the OSCP labs, I was doing OSCP at the time, and uh if you've 00:07:28.315-->00:07:33.353 done OSCP, you know they have an IOC channel uh where all the students come together and talk 00:07:33.353-->00:07:37.390 about uh attack methods and various machines, that kind of thing. And just kind of 00:07:37.390-->00:07:42.028 observing the traffic and people talking to each other, uh I made a couple of casual observations. 00:07:42.028-->00:07:46.166 So the first is everyone had their own way of doing something, whether that was 00:07:46.166-->00:07:51.538 trying exfiltrate stuff or search for stuff post-exploitation or um you know 00:07:51.538-->00:07:56.076 download a binary to a compromised box, whatever it was. And the second observation 00:07:56.076-->00:07:59.546 was that once someone had a particular preferred way of doing something, they would 00:07:59.546-->00:08:06.052 stick to it. They wouldn't really change it. Now that seems fairly obvious. Uh my first 00:08:06.052-->00:08:10.590 degree was in English lit and I pretty much discovered after the first 3 weeks of the first term, 00:08:10.590-->00:08:14.828 I could pretty much just make it up. Um so that's what I did for the next three years, um and 00:08:14.828-->00:08:18.431 then apparently in science you actually have to provide evidence and actually prove 00:08:18.431-->00:08:23.636 things. Um you can't just kinda say this is obvious. [scattered laughs] Academics tend to frown 00:08:23.636-->00:08:28.174 on that uh surprisingly. So I wanted a way to kind of empirically test this 00:08:28.174-->00:08:33.313 assumption. And I came across this thing called case linkage analysis. So it's uh a 00:08:33.313-->00:08:38.518 methodology found in crime science. Uh so crime science is a discipline, it's kinda of a 00:08:38.518-->00:08:44.758 multidisciplinary approach to looking at um how crimes can be prevented. So it's distinct from 00:08:44.758-->00:08:49.295 criminology. Criminology is looking at why people commit crimes, crime science is looking 00:08:49.295-->00:08:54.367 at um uh if you have uh series of crimes being committed, for instance, what kind of 00:08:54.367-->00:08:59.806 interventions could you put in place to try and stop that? So CLA case linkage analysis is 00:08:59.806-->00:09:05.311 designed to link separate crimes to a common offender based on behaviors exhibited during the 00:09:05.311-->00:09:11.651 commission of an offense. So the benefits of doing this, um you might not know who the 00:09:11.651-->00:09:15.889 individual is that's committed this linked offenses, but you can potentially investigate 00:09:15.889-->00:09:21.060 offenses as a series, so all together so you can focus resources. Uh it can be used 00:09:21.060-->00:09:26.900 evidentially. And there's also this uh speculation that a minority of offenders commit the 00:09:26.900-->00:09:31.771 majority of crimes. That's uh in terms of crimes generally, that's um debatable. But 00:09:31.771-->00:09:36.776 potentially with more specialist crimes it's it's more accurate. So if you want to try and link 2 00:09:38.845-->00:09:42.849 separate crimes to a common offender, regardless if you know who that offender is, the the 00:09:42.849-->00:09:46.853 best way to do that is through physical evidence, DNA, fingerprints, that kind of 00:09:46.853-->00:09:52.525 thing. Um the problem with that approach is that evidence just might not be there um or 00:09:52.525-->00:09:57.931 depending on the crime type, it might not apply. So with uh with network intrusion attacks, 00:09:57.931-->00:10:02.936 cyberattacks, for instance, you're not going to have physical evidence in most cases. 00:10:02.936-->00:10:07.507 You might have kinda forensic artifacts but they're not going to be uh unique in the same way 00:10:07.507-->00:10:11.911 that DNA or fingerprints are. They may not take you back to a specific individual either. So 00:10:11.911-->00:10:18.017 as an alternative, what you can do is use um behavioral evidence. So very specific, very 00:10:18.017-->00:10:24.924 granular things that an offender does during the commission of a crime. Uh either um in order to 00:10:24.924-->00:10:31.130 perpetrate the offense or to prepare for the offense or something that they do that's uh 00:10:31.130-->00:10:37.337 coincidental to the offense. So the uh basic methodology is you classify those behaviors into 7 00:10:37.337-->00:10:43.643 behavioral domains uh and you create uh pairs of crimes and you compare those 2 crimes 00:10:43.643-->00:10:48.648 together in terms of the behaviors that were exhibited. And then you try and determine a 00:10:48.648-->00:10:54.854 statistical degree of similarity between them. So it's not offender profiling. Um that's uh 00:10:54.854-->00:11:01.161 a very common misconception. So offender profiling seeks to make an interference on someone based 00:11:01.161-->00:11:05.164 on the assumption that what they do in the commission of a crime is going to be the same as what 00:11:05.164-->00:11:10.203 they do in every everyday life. So uh if you were looking at a particular crime, you could say 00:11:10.203-->00:11:16.376 based on those, I infer that the perpetrator is uh um a boring but very charismatic research 00:11:16.376-->00:11:21.381 from the UK , no one specific in mind, and uh case linkage analysis on the other hand, it 00:11:23.516-->00:11:29.389 trying to make a statistical inference of the similarity of 2 or more crimes based on 00:11:29.389-->00:11:34.394 behaviors uh exhibited during both of them. So in this case, you might look at crime A, you 00:11:34.394-->00:11:39.465 know who's committed that, and it's gt various features in common with crime B, therefore 00:11:39.465-->00:11:44.470 crime A and crime B may have been committed by the same person. So CLA has uh 2 main 00:11:47.407-->00:11:52.412 assumptions at the root of it. Um that come out of personality psychology. So this behavioral 00:11:52.412-->00:11:57.250 consistency, the assumption that someone uh who has committed crimes is gonna continue to 00:11:57.250-->00:12:02.388 commit crimes in the same way across the series of time, across time. Um and then there's 00:12:02.388-->00:12:08.261 behavioral distinctiveness. So the way an offender commits a particular crime is going to be 00:12:08.261-->00:12:14.100 uh distinguishable from the way that other people commit crime. And both of these have to be 00:12:14.100-->00:12:18.938 present otherwise CLA doesn't really work. Um so uh I'll talk about this a bit later but 00:12:18.938-->00:12:23.276 certain crimes are more suited to CLA analysis than others. So if you look at something like 00:12:23.276-->00:12:29.148 homicide for instance, uh homicide uh uh a very common characteristic of that is 00:12:29.148-->00:12:33.820 dumping a body in a remote location. So that's consistent for many offenders but it's not 00:12:33.820-->00:12:38.825 distinctive enough to be able to use that uh as grounds for for CLA. So talking a bit more about 00:12:42.295-->00:12:47.634 personality psychology, uh there's been uh various papers on the way people respond to 00:12:47.634-->00:12:54.440 things, the fact that the way we respond to stimuli uh is unique or uh distinctive at least, and 00:12:54.440-->00:13:00.446 stable across time because it's based on our upbringing and our education and our previous 00:13:00.446-->00:13:05.685 experiences. So uh Michel and Shoda talk about something called CAPS, the cognitive 00:13:05.685-->00:13:10.023 personality system uh which basically says that every individual has their own system 00:13:10.023-->00:13:15.028 of reacting to things of expectations and strategies uh which is consistent yet 00:13:17.096-->00:13:22.101 distinctive. And this uh these assumptions made in other fields are the similar fields around 00:13:24.637-->00:13:28.041 the kind of concept of human side channels. So if you look at something like forensic 00:13:28.041-->00:13:32.812 linguistics for instance, uh which is based on the assumption that people have a stable yet 00:13:32.812-->00:13:38.551 distinctive uh writing style and a way of uh formulating sentences are kinda predictable, 00:13:38.551-->00:13:44.157 um uh average sentence length, syllable count, uh structuring of paragraphs, that kind of 00:13:44.157-->00:13:49.162 thing. Um and it applies to some biometrics or kind of pseudo biometric methods as well, so 00:13:51.330-->00:13:58.071 you may have heard um of some researchers um proposing that typing speed or typing style be 00:13:58.071-->00:14:01.874 used as an additional authenticating system. So as well as a password, you also 00:14:01.874-->00:14:06.879 have uh, you know, the speed at which someone times in addition to that. So does it actually 00:14:09.015-->00:14:14.587 work? Well the consensus in the literature is yes, in most cases uh so it's been applied to a 00:14:14.587-->00:14:20.893 wide number of crime types, to burglary, arson, uh homicide, motor vehicle crime, um and 00:14:20.893-->00:14:25.898 various others as well. So the uh methodology. If you want to apply CLA to something, what do 00:14:28.034-->00:14:32.739 you do? So you separate behaviors into particular domains, you calculate a 00:14:32.739-->00:14:38.444 similarity coefficient. Um which is a kinda coarse measure of the similarity between the 2 crimes 00:14:38.444-->00:14:43.182 you're looking at. You input that into a logistic regression model, uh regression model, and 00:14:43.182-->00:14:46.719 then you determine the optimal combination of domains. So of all domains you're looking at, 00:14:46.719-->00:14:51.524 which are the uh best ones for predictive accuracy and then you use something called receiving 00:14:51.524-->00:14:55.828 operating characteristic curves, which are just a further measure of predictive accuracy, they're 00:14:55.828-->00:15:01.801 kind of um they plot the probability of a true positive against a false positive. Now as 00:15:01.801-->00:15:07.039 a former uh literature student, I hate statistics, I'm not very good at statistics, so I'm going 00:15:07.039-->00:15:11.077 to try and explain this uh, first the way I wish it had been explained to me when I first 00:15:11.077-->00:15:14.781 started looking at this but we're the sort of people who have no no stats experience at 00:15:14.781-->00:15:20.219 all. I will try and walk you through so. Say we have 2 burglaries, burglary A and 00:15:20.219-->00:15:24.457 burglary B, and we want to find out if the same offender did both. We want to find out the 00:15:24.457-->00:15:29.762 probability that uh 1 uh offender did both. So the first thing we do is define something 00:15:29.762-->00:15:35.034 called a dichotomous dependent variable. That basically means it's just a yes no question and 00:15:35.034-->00:15:39.305 it's the question that we're trying to answer. So in this case it would be, are these 2 00:15:39.305-->00:15:44.577 burglaries linked? Uh and what we want to find out is of those behavioral domains we have, 00:15:44.577-->00:15:49.582 which of them contribute more to linkage or or or not being linked? So these behavioral 00:15:52.518-->00:15:58.024 domains, what do they look like while they? Well an example would be entry behaviors, so for 00:15:58.024-->00:16:03.229 burglary you would look at um how a burglar um enters the property, what tools they use to 00:16:03.229-->00:16:08.267 do that, time of day, you uh separate domain might be property behaviors. SOo you look 00:16:08.267-->00:16:13.673 at what property was taken, what property was damaged. That kind of thing. All of these together 00:16:13.673-->00:16:18.778 are independent variables and we make these dichotomous as well. So we turn these into yes no 00:16:18.778-->00:16:25.685 questions. So was uh was a crowbar used, was a screwdriver used, that kind of thing. Then 00:16:25.685-->00:16:29.989 we apply the similarity coefficient. So in the uh literature, we got in case 00:16:29.989-->00:16:34.260 linkage analysis, uh the most common one used is called Jaccard's similarity 00:16:34.260-->00:16:38.798 coefficient. Uh this is the formula for it, you can see it's pretty basic. So you take 00:16:38.798-->00:16:43.836 account of uh each individual behavior um for each domain that's present in both of the 00:16:43.836-->00:16:49.041 offenses, you then look at uh behaviors present in crime A but not crime B and then the inverse 00:16:49.041-->00:16:54.680 of that and then you end up with uh a figure once you've run it through this formula. So if you 00:16:54.680-->00:16:59.118 get a result, 1, that means the crimes are perfectly similar, uh zero means they're perfectly 00:16:59.118-->00:17:05.825 dissimilar, um now crucially Jaccard's ignores something called joint non-occurrences so 00:17:05.825-->00:17:10.796 if a behavior didn't happen in either crime it's not taken into account when calculating that 00:17:10.796-->00:17:15.635 coefficient. Now that's a concern when you're looking at real-world crime. So like 00:17:15.635-->00:17:19.105 burglary or or where's there's been uh some sort of kind of interaction with the victim 00:17:19.105-->00:17:23.075 because victims don't always accurately report what's happened and the police don't 00:17:23.075-->00:17:27.880 always accurately report what's happened. Um it's less of a concern in this case as you'll 00:17:27.880-->00:17:33.486 see because we're gonna basically record everything. So you put each of those 00:17:33.486-->00:17:39.592 coefficients into a uh direct logistic regression model. Um so a logistic regression is a a way 00:17:39.592-->00:17:44.730 to perform a kind of predictive analysis. So you want to find out to what extent a particular 00:17:44.730-->00:17:50.503 variable contributes to an outcome. So you'd want to look at if there's a similarity in 00:17:50.503-->00:17:56.642 the entry behaviors to what an extent does that predict whether or not those 2 burglaries are 00:17:56.642-->00:18:01.948 linked. And logistic regression also gives us some information; it tells us uh whether a 00:18:01.948-->00:18:06.218 particular variable is positively correlated with the outcome, so whether it it has 00:18:06.218-->00:18:10.423 actual contributed to it, whether it is negatively correlated, so whether it's uh 00:18:10.423-->00:18:15.428 produced the opposite result. Um and it gives us a P-value. So uh in scientific experiences 00:18:18.130-->00:18:22.501 P-value is very important. It basically tells you that the profitability of seeing a 00:18:22.501-->00:18:29.308 particular result if the null hypothesis is true. So a null hypothesis uh is um the uh 00:18:29.308-->00:18:34.313 assumption that the 2 things you're looking at are not in any way related. So the lower the 00:18:34.313-->00:18:38.417 P-value the better. So would run these for each behavioral domain, you then run something 00:18:38.417-->00:18:42.788 called forward stepwise logistic regression. Uh this is where you're trying to workout the 00:18:42.788-->00:18:47.660 optimal combination of behavioral domains. So you start with 1, you add another domain 00:18:47.660-->00:18:53.899 at each step, you do different combinations. If it contributes to the predictive power you keep 00:18:53.899-->00:19:00.539 it, otherwise you get rid of it. And then finally you put those results into uh ROC curves. So 00:19:00.539-->00:19:05.778 as I mentioned, ROC curves are a graphical representation of the probability of a false positive 00:19:05.778-->00:19:10.383 against the probability of a true positive. And it it kinda gives you a more reliable 00:19:10.383-->00:19:14.720 measure than the logistic regression of the predictive accuracy uh the value is based 00:19:14.720-->00:19:18.891 on something called the area under the curve. And I'll show you an example of what I mean by 00:19:18.891-->00:19:23.629 that in a second. Uh it it also overcomes a various statistical issues of using logistic 00:19:23.629-->00:19:28.234 regression, in particular context, which isn't very interesting um but it basically 00:19:28.234-->00:19:33.239 is a measure of the overall predictive accuracy. So this is an example of a ROC curve. Um so 00:19:35.508-->00:19:40.246 uh what you're essentially looking at there is the graphical representation of true 00:19:40.246-->00:19:46.118 positive versus false positive. Uh if you have a diagonal line um across the graph, that 00:19:46.118-->00:19:50.623 basically means your model is performing no better than chance. Um the more area that's 00:19:50.623-->00:19:56.495 under the curve, the better predictive accuracy your model has. So um a kinda 00:19:56.495-->00:20:01.634 categorization has been suggested is if you have an AUC value of 0 point 5 to 0 point 7 00:20:01.634-->00:20:07.073 that's pretty low accuracy, 0 point 7 to 0 point 9 is good, and then anything above 0 point 00:20:07.073-->00:20:12.078 9 is high. So there are some um exceptions to the effectiveness of case linkage analysis, as I 00:20:15.247-->00:20:19.151 mentioned homicide earlier. Uh there's also the issue, obviously this isn't going to be 00:20:19.151-->00:20:24.390 a100 percent guarantee to work um some offenders will show more distinctiveness than others. Um 00:20:24.390-->00:20:30.396 some offenders will show less stability than others. So certain behaviors as well within 00:20:30.396-->00:20:34.800 a particular offense will be less consistent. Uh so for instance, um particularly those 00:20:34.800-->00:20:40.106 uh offender doesn't have control over. So property stolen during a burglary for instance, the 00:20:40.106-->00:20:43.576 offender is not going to be able to control that um to some extent because they don't know 00:20:43.576-->00:20:48.581 necessarily what's in the property. There's also the issue uh that an offender's MO is a 00:20:50.950-->00:20:55.688 learned behavior. So it's going to develop over time as uh offenders speak to other 00:20:55.688-->00:21:00.893 offenders, as, you know, new technologies come out and new practices come out. And 00:21:00.893-->00:21:07.333 crucially, they also change their behaviors in response to events. So this is why CLA is uh 00:21:07.333-->00:21:12.338 more effective which have less victims interaction. Uh because if you take something uh like a 00:21:14.840-->00:21:20.813 robbery, for instance, um where an offender is threatening or using violence against someone, 00:21:20.813-->00:21:25.351 then the victim's response to the offender doing that will then potentially influence the 00:21:25.351-->00:21:31.924 offender's behaviors. Uh and then uh most research with CLA has only be applied to solved 00:21:31.924-->00:21:36.495 crimes, they've been relatively small samples as well and typically it's only been looking 00:21:36.495-->00:21:41.500 at serial offenses. So I want to talk to you now about the uh experiment I did. Um so I wanted 00:21:43.536-->00:21:49.275 to find out if CLA could be applied to cyberattacks, uh specifically in a situation 00:21:49.275-->00:21:54.346 where the attackers has got code execution on a machine. Um so this hasn't been done before. 00:21:54.346-->00:22:00.386 CLA has only previously been applied to real-world crimes um so what I wanted to do was take 00:22:00.386-->00:22:04.823 very granular behaviors, so an attacker's keystrokes and the commands they're executing and 00:22:04.823-->00:22:09.728 the syntax they're using, and the order of switches on commands, uh and work out if 00:22:09.728-->00:22:14.567 that could be used as kinda of an attack signature to link together an attack committed by 00:22:14.567-->00:22:19.572 the same offender. So when um designing this experiment, the uh kinda of common approach in 00:22:23.275-->00:22:28.681 the literature is to use police data, uh crime reports. Uh the issue with that as I mentioned 00:22:28.681-->00:22:32.718 earlier, they may be inaccurate, they may be incomplete, um victim accounts may be 00:22:32.718-->00:22:37.456 inaccurate um because triumph- crimes are often traumatic and trauma can uh distort memory, 00:22:37.456-->00:22:43.229 that kind of thing, it's a also a problem that police may not record all data. And when you're 00:22:43.229-->00:22:47.233 talking about network intrusion attacks, uh it's unlikely that crime reports gonna have the 00:22:47.233-->00:22:54.206 level of granularity needed uh in this instance. Another possible approach was using a 00:22:54.206-->00:23:00.479 Honeypot. So um, you know, exposing an SSH server with a weak password and just kind of 00:23:00.479-->00:23:05.751 sniffing what was coming in and then logging keystrokes. The issue with that is because this 00:23:05.751-->00:23:11.423 this methodology was previously untested for cyberattacks, I needed a kind of ground truth. I 00:23:11.423-->00:23:15.527 needed to know what attacks were linked and what weren't. Um there's also the problem that 00:23:15.527-->00:23:21.700 even if I did get um someone attacking, say 2 servers and trying to match them together. 00:23:21.700-->00:23:26.839 Even if they come the same IP address doesn't guarantee that it's the same individual behind 00:23:26.839-->00:23:32.611 the keyboard. I'd also need to distinguish between bots and humans, which is uh an exercise 00:23:32.611-->00:23:37.249 in itself. And there's also the issue that Honeypots can be fingerprinted, which may um 00:23:37.249-->00:23:42.254 influence an attacker's behavior. So I took um a. open source SSH key logger, written 00:23:46.025-->00:23:52.498 in Python, um the user strace to log keystrokes process, um span up to virtual machines, uh 00:23:52.498-->00:23:58.837 expose them to the internet over SSH, configured 1 account per user per books, uh there are 10 00:23:58.837-->00:24:03.676 users in total. Uh configured each one with uh deliberate privilege escalation 00:24:03.676-->00:24:08.447 vulnerabilities and then put some tasty looking data on there for attackers to exfiltrate. I 00:24:08.447-->00:24:14.253 got uh 10 volunteers to participate, so a mixture of pentesters, and uh enthusiasts, 00:24:14.253-->00:24:19.258 and students. Uh I entered SSH into both machines so they had a low privilege shell. Uh I asked 00:24:21.994-->00:24:27.266 them to try and escalate their privileges, to steal data, uh to try and cover their tracks, and 00:24:27.266-->00:24:31.603 generally just kinda poke around the file system and see what was there. Uh and while they were 00:24:31.603-->00:24:38.210 doing that, I was recording all of their keystrokes using this keylogger. So the hypothesis was 00:24:38.210-->00:24:43.749 that um as attackers are doing that um they will be consistent and distinctive in the same way 00:24:43.749-->00:24:49.054 that other offenders are with other crimes, which will enable me to try and link together 2 00:24:49.054-->00:24:54.059 separate offenses committed by the same attacker. So I ended up with 3 behavioral domains: uh 00:24:56.261-->00:25:02.067 navigation, uh which is how attackers are moving through the file system; uh enumeration, the 00:25:02.067-->00:25:06.271 kind of local reconnaissance on that system; and then exploitation, which covered both 00:25:06.271-->00:25:12.911 privilege escalation attempts and exfiltration attempts. I also look at 3 metadata 00:25:12.911-->00:25:17.783 variables, so um these are not behavioral um but they are looking at the number of 00:25:17.783-->00:25:21.153 milliseconds between each keystroke. The number of milliseconds between each 00:25:21.153-->00:25:26.792 command, and then the number of backspaces uh expressed as a percentage of all keystrokes. So 00:25:26.792-->00:25:30.729 these metadata variables, obviously none dichotomous, they're not yes-no answers, 00:25:30.729-->00:25:35.734 they're just values. Uh the reason I chose to do that is that in other CLA work in 00:25:37.836-->00:25:42.808 addition to that behavioral um uh granular behavior uh domains, people have also looked at 00:25:42.808-->00:25:47.846 things like intercrime distance, temporal proximity, uh that's kind of had some promising 00:25:47.846-->00:25:53.452 results as well. Uh previous research has also looked at things like commands typed per 00:25:53.452-->00:25:57.823 second, which potentially has issues because that's gonna be influenced by the the length of 00:25:57.823-->00:26:04.563 the command time to complete, and that kind of thing. So these are some examples of the kind of 00:26:04.563-->00:26:09.301 behaviors that I was looking at uh once these uh volunteers had finished. Um so you can see 00:26:09.301-->00:26:14.473 they're pretty granular. Um there are um subtle distinctions between some of them. So you 00:26:14.473-->00:26:18.510 have navigation behaviors are the the first 2 columns on the left and then the 2 columns on 00:26:18.510-->00:26:23.515 the right are uh exploitation behaviors. So uh on average, each participation spent about 00:26:27.920-->00:26:32.925 uh 2 hours, just over 2 hours uh on each host, issuing an average of 243 commands on each host. 2 00:26:35.194-->00:26:41.567 of them got root on the first VM and one of them got root on the second. So 10 attackers, 2 00:26:41.567-->00:26:46.972 machines, 100 crime pairs, uh of which 10 were linked and 90 were unlinked. So what I did was 00:26:46.972-->00:26:53.612 compare each attack against the first VM uh against each against on the second VM. Uh calculated 00:26:53.612-->00:26:59.051 the similarity coefficient, uh automatically using a tool I wrote, um that gave me a CSV 00:26:59.051-->00:27:05.290 file, so here are the similarity coefficients. Um so you can see if you look at the first column, 00:27:05.290-->00:27:11.463 which is the mean average um and compare it to the um the variables. You can see that link 00:27:11.463-->00:27:17.569 defenses have a much higher mean similarity coefficient than unlinked defenses, which uh is 00:27:17.569-->00:27:22.574 promising to start with. For the metadata variables, again if you look at that mean column, you 00:27:25.244-->00:27:29.982 can see that linked offenses have slightly lower values um than unlinked offenses, which 00:27:29.982-->00:27:34.653 again is promising because you're looking at um things like the uh similarity between the uh 00:27:34.653-->00:27:39.658 total keystrokes and that kind of thing. So then I reported the results of that into a package 00:27:42.094-->00:27:48.600 called SPSS, which I'm not I don't like um as you might be able to tell. Um and I performed 00:27:48.600-->00:27:53.472 direct logistic regression for each of those behavioral domains and then forwards stepwise 00:27:53.472-->00:27:59.745 logistic regression. So that uh resulted in 6 models in total and then a seventh model which 00:27:59.745-->00:28:04.683 was uh the optimal combination of each domain. So this is a slide you've all been waiting 00:28:07.152-->00:28:12.157 for very patiently. [scattered laughter, claps, and whistles] So yeah uh. [laughter and 00:28:18.797-->00:28:23.802 applause] Thank you, yeah. I had a backup. I genuinely wasn't uh thinking that was going to get 00:28:30.008-->00:28:35.147 applause, so I watched a lot of uh black hat DefCon talks uh in the last couple of years. So I 00:28:35.147-->00:28:39.284 put something in the next slide which I think is probably uh statistically guaranteed to get 00:28:39.284-->00:28:44.289 me a round of applause. [laughter and applause] Okay so that big table that I showed 00:28:52.197-->00:28:57.903 you, what does it tell us? It tells us that those 3 behavioral domains uh are able to classify 00:28:57.903-->00:29:02.407 linked and unlinked offenses uh with a very high level of accuracy. Uh and I'll show some 00:29:02.407-->00:29:08.847 more of the results a bit later. It's a bit easier to see. The um upshot of all this is navigation 00:29:08.847-->00:29:14.686 is the most effective predictor, um then exploitation, then enumeration uh with a really 00:29:14.686-->00:29:21.560 strong correlation to the outcome of linked or unlinked. The uh metadata variable was 00:29:21.560-->00:29:26.431 much less successful. So keystroke and command intervals not reliable at all. Uh 00:29:26.431-->00:29:32.237 backspaces uh percentage of backspaces a very weak negative correlation um but not 00:29:32.237-->00:29:36.508 statistically significant. So that p-value that I mentioned earlier uh was pretty higher for 00:29:36.508-->00:29:41.513 them, uh so you can't really um count that as a result. So then um I put these values into ROC 00:29:44.383-->00:29:48.887 curves, uh and these are the results. So the uh column to focus on or the 2 columns to 00:29:48.887-->00:29:54.760 focus on are the AUC column and the Sig. column. So Sig. is the p-value, AUC is the area under 00:29:54.760-->00:29:58.864 the curve. Remember the closer we are to 1, the greater predictive accuracy this has 00:29:58.864-->00:30:03.702 has, this has got. So you can see the first 3 behavioral domains are very high um 00:30:03.702-->00:30:09.241 navigation 0 point 992 is the best, and exploitation 0 point 964, then enumeration 0 point 00:30:09.241-->00:30:15.280 912. Uh as you can see the metadata variables um keystroke interval and command interval 00:30:15.280-->00:30:20.852 didn't really perform any better than chance. Uh backspaces were okay, 0 point 7, so it's a kind 00:30:20.852-->00:30:25.857 of uh you know, it's it's a medium level of accuracy. So 0 point 992 is great um now I've 00:30:30.796-->00:30:35.801 put that on there um because the cool kids told me that Jay Z is a ROC fella um which uh [light 00:30:39.137-->00:30:44.276 laughter] I assume means he's got an interest in inferential statistics and predictive 00:30:44.276-->00:30:49.548 accuracies. [light laughter] So these are the ROC curve results just to um to reiterate. So the 00:30:49.548-->00:30:54.119 optimal model uh in this particular study at least, if you combine navigation and 00:30:54.119-->00:30:58.690 enumeration, you got predictive accuracy of 100 percent. Now I'm suspicious of anything that's 00:30:58.690-->00:31:04.196 100 percent. Um and I'll come on to the kind of caveat of this research and kinda of thresh the 00:31:04.196-->00:31:10.602 validity uh towards the end. So uh what are the implications of this? What does this actually 00:31:10.602-->00:31:16.241 mean? Well it means that um potentially cyberattacks, network intrusion attacks, where 00:31:16.241-->00:31:22.214 an attacker has command execution through an interactive shell um potentially has high 00:31:22.214-->00:31:28.453 levels of consistency and distinctiveness. Um particularly with navigation and enumeration, 00:31:28.453-->00:31:33.859 um a theory I have around why navigation particularly was so useful is that it's something 00:31:33.859-->00:31:39.131 that we do every day. Okay so. Uh whether we're using our own computers assuming, we use 00:31:39.131-->00:31:43.635 Linux, which is what this one was, uh and which uh I believe most of the participants who 00:31:43.635-->00:31:47.773 took part in this study do, um it's just something you do out of habit. Whereas things like 00:31:47.773-->00:31:51.977 enumeration and exploitation, you only really gonna do that when you're actually attacking a 00:31:51.977-->00:31:56.982 host. Uh the worst high levels of accuracy that have been reported for other crime types 00:32:00.318-->00:32:05.590 in terms of the CLA literature, um and a possible reason again for this would be that the 00:32:05.590-->00:32:10.896 behaviors exhibited in this kind of uh attack, this kind of crime, are less subject to 00:32:10.896-->00:32:17.402 influence um so there aren't any victims directly involved necessarily, um offenders may 00:32:17.402-->00:32:22.507 kind of change um some of their approach depending on, you know, security mechanisms in place, um 00:32:22.507-->00:32:27.979 that kind of thing. But generally their granular command choice is not really gonna 00:32:27.979-->00:32:33.685 differ. It's gonna be quite difficult to uh to influence that. The metadata variables, uh 00:32:33.685-->00:32:40.225 not as good at all. Um suggesting that what you type is much better for trying to link 00:32:40.225-->00:32:45.597 crimes than how you type. Uh now with the uh intervals, the keystroke intervals and command 00:32:45.597-->00:32:50.335 intervals, network latency may have affected some of the results and skewed them. Um but 00:32:50.335-->00:32:53.738 the mistakes and typos potentially show some promise and maybe that's worth a bit of 00:32:53.738-->00:32:59.845 further research. Uh does need some some further exploration. So uh the implications for 00:32:59.845-->00:33:05.784 investigators are that you can potentially link separate offenses to common offenders 00:33:05.784-->00:33:10.188 regardless of whether or not you know who that offender is. Uh without having to rely on atomic 00:33:10.188-->00:33:17.128 IOCs or computed IOCs. But you do need a lot of information. So um you need to get as granular 00:33:17.128-->00:33:21.533 as possible. You essentially need to be in a position to capture commands and keystrokes. 00:33:21.533-->00:33:26.638 So the easiest way to do that would be with something like a high interaction Honeypot, um 00:33:26.638-->00:33:31.476 assuming that um the attacker is not going to become aware that they're on a Honeypot, which 00:33:31.476-->00:33:35.780 would then could then kind of influence rthe esults. Um you could try and do with just 00:33:35.780-->00:33:42.020 really verbose logging and look at aspects other than keystrokes and commands. Um you could also 00:33:42.020-->00:33:46.258 um use something like a backdoors CTF if you wanted to try and do that or vulnerable 00:33:46.258-->00:33:51.529 VMs or something. And potentially, you could try and link attackers who trained 00:33:51.529-->00:33:55.433 together or who have been trained by the same person or who have done the same kind of 00:33:55.433-->00:34:01.473 qualification. Um now that kind of does dilute this assumption that everyone has a distinctive 00:34:01.473-->00:34:06.211 ways of doing things, um but it could still assist and that's uh something that I want to look at 00:34:06.211-->00:34:12.517 uh going forward. Now there are implications for privacy here was well. Um in that you could 00:34:12.517-->00:34:16.688 potentially be linked to separate hosts or separate identities just based on the way 00:34:16.688-->00:34:21.526 you type, regardless of what other measures you have in place and how good your OPSEC is. Just 00:34:21.526-->00:34:25.563 the way you structure commands and use command switches and syntax could potentially 00:34:25.563-->00:34:31.803 influence um that and could lead to you being linked to uh to other things. So like uh 00:34:31.803-->00:34:36.808 forensic linguistics, the whole concept of this is exploiting stable, behavioral traits. Uh 00:34:39.244-->00:34:43.315 and as I mentioned it it shouldn't be a 100 percent accurate um and potentially 00:34:43.315-->00:34:48.920 affect less of the population, so forensic linguistics will uh effect everyone who is literate, 00:34:48.920-->00:34:55.026 this would effect much less people. Um and this study only focused on commands um that 00:34:55.026-->00:34:59.397 attackers were entering. You could kinda of widen this to look at more general typing 00:34:59.397-->00:35:04.336 behaviors. Um so things that people do on keyboards that aren't necessarily um the actual 00:35:04.336-->00:35:08.473 text that they're typing, but just kind of around that, how they kinda of, you know, 00:35:08.473-->00:35:15.180 navigate through a document, that type of thing. So if someone's in a position to log 00:35:15.180-->00:35:19.985 your keystrokes, you've got pretty big issues anyway. And uh if someone wants to try and 00:35:19.985-->00:35:25.190 identify you then they're going to do that without going to this kind of length of uh of uh 00:35:25.190-->00:35:29.728 bother, but this is more about attribution via linkage. So what this means is that you could be 00:35:29.728-->00:35:34.733 linked t historical or future activity that might be done under a different pseudonym or a 00:35:34.733-->00:35:41.706 different identity. So how could you defeat it? Um well it's pretty similar just trying to 00:35:41.706-->00:35:46.711 defeat forensic linguistics, trying to defeat authorship identification. You really want 00:35:46.711-->00:35:53.284 to try and consciously disguise the way that you're um you're approaching a particular task. 00:35:53.284-->00:35:57.022 Now with forensic linguistics, uh there are various solutions that have been proposed, from 00:35:57.022-->00:36:01.226 the very crude, such as putting stuff through Google Translate a number of times to the very 00:36:01.226-->00:36:05.597 sophisticated, where you're actually kind of swapping out punctuation and you're kind of 00:36:05.597-->00:36:09.701 randomly putting punctuation different places. And there have been uh talks about that before 00:36:09.701-->00:36:14.606 and studies on that before. Uh CLA is slightly different. So trying to do this in an 00:36:14.606-->00:36:19.577 automatic way is gonna be pretty difficult um because you can't really predict the commands um 00:36:19.577-->00:36:24.916 that you're gonna use in advance. You could try and kinda of semi-automate it I guess. So 00:36:24.916-->00:36:29.020 uh talking bout Google Translate and uh forensic linguistic. There's a quick sidebar, I 00:36:29.020-->00:36:34.592 wanted to talk about this because I think this is really cool. So this is a bot that my 00:36:34.592-->00:36:38.163 colleague Keith Short created called InsightfulRobot. And it takes famous quotes from books 00:36:38.163-->00:36:42.867 and films and it runs them through Google Translate uh 13 times and then tweets the answer 00:36:42.867-->00:36:48.573 um at 10 a.m. every day. So it's just kinda an illustration of how badly Google Translate kinda 00:36:48.573-->00:36:52.710 mangles the the sense of what you're trying to say. I thought I'd have a go at this as well. 00:36:52.710-->00:36:59.284 So uh this is uh a line of text I put into it. I translated it uh 6 times to various language, 00:36:59.284-->00:37:03.221 ended up with that. Uh which obviously bears kind of no resemblance to what I was 00:37:03.221-->00:37:09.761 initially uh saying. So conscious changes, manual changes are probably the best 00:37:09.761-->00:37:13.832 way to do it. Um so you could do things like randomize the ordering of commands which if 00:37:13.832-->00:37:18.169 you had multiple switches on a particular command. You could try and switch up tools, so you 00:37:18.169-->00:37:22.974 could use wget instead of curl, you could use vi instead of nano, although that might start 00:37:22.974-->00:37:27.979 a war, kind of uh saying that. Um so I mentioned earlier threats to validity, so this was 00:37:30.115-->00:37:34.886 a very small sample of people It was only 10 people. Um because this has never been done before, 00:37:34.886-->00:37:38.690 because kind of limited time resources, that kind of thing. So it's very much a proof of 00:37:38.690-->00:37:45.196 concepts, there wasn't real-world data for the the reasons I explained previously. 00:37:45.196-->00:37:48.700 There's also the fact that the participants were volunteers. And they knew they were 00:37:48.700-->00:37:53.138 participating in an academic experiment. They knew they had permission to attack those 00:37:53.138-->00:37:58.510 machines with no fear of reprisal. It was also Linux only. And I only looked at one 00:37:58.510-->00:38:03.481 scenario so remote access over SSH to a low privilege shell. And crucially, there's also the 00:38:03.481-->00:38:08.253 point that I asked those participants to try and escalate privileges and exfiltrate stuff. 00:38:08.253-->00:38:12.590 And in the world, attackers might not always want or need to escalate their privileges, 00:38:12.590-->00:38:17.595 depending on what their objective is. So to sum up then, um there's uh a lot of future 00:38:21.199-->00:38:25.870 research I think that could be done in this area. Um 1 would be to look at the effect of 00:38:25.870-->00:38:31.810 expertise, the the uh the effect the skill level has on predictive accuracy and and uh 00:38:31.810-->00:38:37.949 linking. Temporal proximity, so looking at an attack uh by 1 attacker now and then looking at 00:38:37.949-->00:38:43.821 it again in 6 months' time. Um looking at real world data, doing further research into 00:38:43.821-->00:38:49.594 those metadata variables. Um stochastic analysis to try and predict uh what an attacker 00:38:49.594-->00:38:56.134 might type next. Looking into more scenario uh scenario diversity. Um so in particular, 00:38:56.134-->00:39:01.539 uh if you can't see my black hat talk, I talked about like false personae online um and different 00:39:01.539-->00:39:06.578 kind of social media profiles corporate by 1 person. This is a potential approach to try and 00:39:06.578-->00:39:11.983 attribute different social media profiles to 1 individual based on the uh granular behaviors 00:39:11.983-->00:39:17.255 that are displayed during the maintenance of that profile. Um and then trying to automate this 00:39:17.255-->00:39:22.260 um because this took a long time to do uh SPSS is not my friend, so um trying to automate this 00:39:24.295-->00:39:29.734 would be really cool as well. So do get in touch if you want to discuss uh, here's my Twitter 00:39:29.734-->00:39:33.371 handle my email address uh if you're interested in collaborating or you just want 00:39:33.371-->00:39:38.877 to find out more, then let me know. So to sum up, uh this is a pretty small study, pretty novel 00:39:38.877-->00:39:43.381 it had never been done before. Some promising results, um potentially some pretty serious 00:39:43.381-->00:39:48.453 implications uh for both investigators from an attribution perspective, and for 00:39:48.453-->00:39:54.525 privacy. Uh does need kind of further research and work. So uh all the references are here in 00:39:54.525-->00:39:58.529 the slide deck that were used in this talk. If you uh want to have look at them, there's a 00:39:58.529-->00:40:03.134 white paper variable if you want to have a look at that as well. Um there's my contact details 00:40:03.134-->00:40:08.139 again if you want to get in touch. Um and that's it from me thank you very much. [applause]