1 00:00:00,000 --> 00:00:17,120 My name is Scott Miller and I am here with Offensive Computing and I'm going to be presenting a new bioinformatics inspired binary analysis toward coding style and motif identification and there's a lot of people who are helping me up here. 2 00:00:17,120 --> 00:00:28,440 I was NSF Scholarship for Student Service recipient and there's a number of people here, some of which are in the crowd heckling me now even as we speak. 3 00:00:29,620 --> 00:00:39,320 So the big thing that motivated this particular speech, there's a member who couldn't be with us this year at DEF CON, he was here last year, so this is dedicated to that B guy. 4 00:00:39,920 --> 00:00:45,800 I'm going to be talking about the concept of what I did for my thesis work and then how it was extended. 5 00:00:45,800 --> 00:00:52,980 It's a technique or a suite I'm deeming binblast after the basic local alignment and search tool. 6 00:00:53,060 --> 00:00:56,880 I'll be talking a bit about that and then I'm going to look at two separate applications. 7 00:00:57,420 --> 00:01:09,480 One is in version analysis which is very important if you're trying to protect your own networks and systems and I'm going to work on or then follow that up with a discussion on the application for automatic signature generation for viruses. 8 00:01:10,360 --> 00:01:15,660 All of this, everything you're going to see in this presentation is just in preliminary work. 9 00:01:15,800 --> 00:01:28,520 It's the actual development of the system was highly theoretical, required a lot of testing, proving and validation, but even at the end of all of that, unfortunately right now the code is just at a prototype stage. 10 00:01:28,700 --> 00:01:32,540 So I'm in the process of stepping this up and going a number of different directions. 11 00:01:32,800 --> 00:01:39,640 So at the end, if I don't get to field your question directly, I'll be down in the corner over there and I'd more than like to hear your input. 12 00:01:40,940 --> 00:01:45,780 So as I kind of started off this speech, our current policy data is that we're going to look at a number of different approaches. 13 00:01:45,800 --> 00:01:53,420 One of them is the data defense, at least on a larger scale, is that we have various policies, software, and hardware that are trying to keep our systems clean and secure. 14 00:01:53,860 --> 00:02:04,120 The bad thing about this is that when a new exploit or new threat or something new comes out, if it's done well, it's going to require some patch to that system. 15 00:02:04,320 --> 00:02:06,060 It's going to require a change in policy. 16 00:02:06,240 --> 00:02:09,060 It's going to require changes in firewalls. 17 00:02:09,060 --> 00:02:10,940 It's going to require changes in hardware. 18 00:02:11,220 --> 00:02:15,780 And the problem with this is that any time you make a change in a very complicated system, 19 00:02:15,800 --> 00:02:20,660 you're going to have to verify that this patch on the system has actually done two things. 20 00:02:21,080 --> 00:02:24,180 One, fix the problem that it was supposed to fix. 21 00:02:24,440 --> 00:02:28,260 And two, actually not create any additional problems. 22 00:02:28,540 --> 00:02:32,780 And as I'm sure all of you know, this is a very, very difficult proposition. 23 00:02:33,700 --> 00:02:36,820 And worse than that, not only do you have to do all of this on your own, 24 00:02:36,900 --> 00:02:44,240 but the time that you have to be able to verify and validate all of these patches is decreasing very, very quickly, 25 00:02:44,280 --> 00:02:45,780 as motivated things are. 26 00:02:45,800 --> 00:02:49,020 And these threats, I suppose dominantly by monetary concerns, 27 00:02:49,300 --> 00:02:55,240 are basically finding profit in your inability to fix and repair your system. 28 00:02:55,760 --> 00:03:02,740 Long and the short of it, the very tools that we're using ourselves right now to defend ourselves are contributing to the very problem. 29 00:03:03,720 --> 00:03:05,600 So, well, what can we do about this? 30 00:03:05,720 --> 00:03:07,540 Well, there's a number of things we can do. 31 00:03:07,780 --> 00:03:11,760 One approach, I suppose, is just stick our head in the ground and ignore it. 32 00:03:12,480 --> 00:03:15,520 Another one is to actually start trying to take a more proactive approach 33 00:03:15,800 --> 00:03:17,000 to the defense of our security networks. 34 00:03:17,480 --> 00:03:21,020 So, as far as being able to do this, we need to start considering, 35 00:03:21,160 --> 00:03:24,620 when we bring code onto our system, what sort of function does it have? 36 00:03:25,220 --> 00:03:30,640 And fortunately for us, this sort of functional analysis from various codes is nothing new. 37 00:03:31,460 --> 00:03:35,460 In the biology world, they've been having to deal with this for many, many years now. 38 00:03:35,740 --> 00:03:42,160 And a lot of our new cancer drugs and research is the result of some very, very good work that was done in the early 90s. 39 00:03:43,140 --> 00:03:44,860 So, kind of fun here to draw. 40 00:03:44,860 --> 00:03:49,140 This is the analog that actually I was using for all of this work that you're seeing today. 41 00:03:49,540 --> 00:03:58,040 And that we have the code, your genetic code in every one of your cells is eventually transcribed from DNA to RNA. 42 00:03:58,260 --> 00:04:02,180 And then it's translated from RNA into various proteins that allow you to stand. 43 00:04:02,560 --> 00:04:06,760 And furthermore, these proteins enable you to form bones and all sorts of stuff like that. 44 00:04:07,580 --> 00:04:11,740 What's very interesting is that this is not, in the least bit, a conservative process. 45 00:04:12,040 --> 00:04:14,600 At every step, when you go from DNA to RNA, 46 00:04:14,600 --> 00:04:16,740 there is a lot of information that gets cut out. 47 00:04:16,880 --> 00:04:18,620 And when you move from RNA to proteins, 48 00:04:18,800 --> 00:04:21,280 there is, again, a lot of information that gets cut out. 49 00:04:21,580 --> 00:04:25,020 So, with respect to functional analysis in a biology domain, 50 00:04:25,780 --> 00:04:26,780 you're given a protein. 51 00:04:27,120 --> 00:04:32,620 Alright, well, what section of my genetic code actually coded for this protein? 52 00:04:32,940 --> 00:04:34,380 Well, geez, that's a good question. 53 00:04:34,580 --> 00:04:36,220 It's a very difficult question, too. 54 00:04:37,260 --> 00:04:42,280 But it's kind of interesting because we've got the same sort of situation when you're compiling source code. 55 00:04:42,600 --> 00:04:44,540 Because when you go from source to object code, 56 00:04:44,600 --> 00:04:45,960 well, you're losing something. 57 00:04:46,220 --> 00:04:49,940 And when you go from object code to linking into an executable binary, 58 00:04:50,220 --> 00:04:52,260 that process, too, loses a lot of information. 59 00:04:52,580 --> 00:04:57,700 And that linking step may be compounded by additional packers and encryptors and all of this stuff, 60 00:04:57,820 --> 00:05:01,200 which basically serve only to remove more and more information. 61 00:05:01,560 --> 00:05:07,040 So, it becomes harder and harder to sort of look at the original function given the final product. 62 00:05:07,520 --> 00:05:13,760 So, one of the ways that the biology domain has come up to address this particular problem 63 00:05:13,760 --> 00:05:19,200 is, as I said earlier, a tool by the name of the Basic Local Alignment and Search Tool, 64 00:05:19,360 --> 00:05:23,920 which was developed by Dr. Carlin and Dr. Altschul back in 1994, 65 00:05:24,220 --> 00:05:25,160 was when the paper was done. 66 00:05:25,580 --> 00:05:29,920 And superficially, all it is, is it's a scored string matching algorithm. 67 00:05:30,240 --> 00:05:32,640 So, we've got a quick example at the bottom here. 68 00:05:32,760 --> 00:05:35,300 And you can see we're going to do an alignment of two words. 69 00:05:35,400 --> 00:05:37,720 Let's say if the characters match, we're going to add one. 70 00:05:37,860 --> 00:05:39,460 If the characters differ, we subtract one. 71 00:05:39,600 --> 00:05:43,040 So, it goes along and we're adding stuff up until we reach, 72 00:05:43,040 --> 00:05:48,280 what appears to be a local maximum of four, because THES and THES match. 73 00:05:48,480 --> 00:05:50,440 And after that, it starts to taper down. 74 00:05:51,580 --> 00:05:54,640 So, this kind of brings up a couple of important points. 75 00:05:54,900 --> 00:05:57,740 The BLAST algorithm is actually an approximation. 76 00:05:58,140 --> 00:06:00,900 It's trying to come up with a local minima for this, 77 00:06:01,000 --> 00:06:03,880 basically find the string that has the highest match. 78 00:06:04,240 --> 00:06:08,940 But it's also important that it doesn't try to match everything in the entire string, 79 00:06:09,080 --> 00:06:12,020 because then you basically get back trivial answers. 80 00:06:12,220 --> 00:06:12,660 You'd say, 81 00:06:13,040 --> 00:06:14,560 well, does this file match this file? 82 00:06:14,760 --> 00:06:16,900 And it would come back and say, yes. 83 00:06:17,780 --> 00:06:20,340 Which is not unto itself entirely useful. 84 00:06:21,620 --> 00:06:29,520 So, under the covers, the entire process is funded on a first order Markov chain model, 85 00:06:29,700 --> 00:06:33,240 which makes an assumption that is not up on this slide, 86 00:06:33,340 --> 00:06:34,440 but it's kind of important to know. 87 00:06:34,600 --> 00:06:38,160 And that assumption is made, because it is a first order Markov model, 88 00:06:38,380 --> 00:06:42,960 that the choice of the next instruction is not dependent on the choice of the previous instruction. 89 00:06:42,960 --> 00:06:46,180 I have very, very good reason to believe that this is not the case. 90 00:06:46,340 --> 00:06:50,580 There are certain sections, compilers have automatically generated code, 91 00:06:50,940 --> 00:06:53,900 so it handles certain sections like structures and this and that. 92 00:06:54,000 --> 00:06:55,740 And every compiler has its own little way of saying, 93 00:06:55,860 --> 00:06:58,100 all right, I'm going to take this particular structure access, 94 00:06:58,240 --> 00:07:00,000 and I'm going to use this set of opcodes, 95 00:07:00,420 --> 00:07:02,720 fill in the memory offsets, fill in the registers. 96 00:07:02,820 --> 00:07:03,840 It's a template. 97 00:07:04,280 --> 00:07:07,920 So, the assumption, superficially, it seems as though the assumption 98 00:07:08,860 --> 00:07:10,900 that using this sort of technique is flawed. 99 00:07:11,120 --> 00:07:12,760 Ooh, I've got this problem. 100 00:07:12,760 --> 00:07:17,320 Because, you know, the choice of instructions is not strictly independent. 101 00:07:17,820 --> 00:07:22,780 However, this is also a similar, there's a similar problem in the biology domain as well. 102 00:07:23,320 --> 00:07:27,500 So, the kind of over, what I was trying to do here, 103 00:07:27,640 --> 00:07:29,600 is just get the start of this concept. 104 00:07:29,820 --> 00:07:33,280 Because once the, I get this first blast approach working, 105 00:07:33,480 --> 00:07:37,380 there's a number of variations on the blast algorithm in the biology domain 106 00:07:37,380 --> 00:07:39,400 that can handle this sort of repetition. 107 00:07:40,160 --> 00:07:42,580 And I'm only going to briefly talk about those. 108 00:07:42,760 --> 00:07:44,280 So, how did I come up with all this? 109 00:07:44,460 --> 00:07:47,520 Well, I looked at what DistroWatch said at the time 110 00:07:47,520 --> 00:07:48,900 were the top five Linux installations. 111 00:07:49,460 --> 00:07:52,680 I stripped out all of the binary packages they had on there, 112 00:07:52,740 --> 00:07:53,860 looked at all of their instructions, 113 00:07:54,080 --> 00:07:57,440 which came up to half a billion instructions. 114 00:07:58,100 --> 00:08:00,960 And then came up with a little storage format, 115 00:08:02,060 --> 00:08:05,100 which reduced it into a four, a common four byte format. 116 00:08:06,100 --> 00:08:08,540 So, there's the first two letters of the mnemonic 117 00:08:08,540 --> 00:08:09,760 were used in the operator class. 118 00:08:09,760 --> 00:08:13,120 And there, that choice, two instead of three, 119 00:08:14,240 --> 00:08:16,180 actually maximizes a particular name space, 120 00:08:17,560 --> 00:08:20,220 which is kind of beyond the scope of this presentation, unfortunately. 121 00:08:20,980 --> 00:08:25,080 And then I went and truncated the operator to one byte, 122 00:08:25,220 --> 00:08:27,200 and then had the operands to two bytes. 123 00:08:27,340 --> 00:08:31,480 So, this is kind of making the assumption that in a system, 124 00:08:31,660 --> 00:08:33,940 the operands are the most likely to change. 125 00:08:34,200 --> 00:08:37,860 And I think this is a fairly safe assumption to make in the x86 system. 126 00:08:38,600 --> 00:08:39,740 So, what can we do about this? 127 00:08:39,760 --> 00:08:42,880 Well, I'm working on getting together 128 00:08:42,880 --> 00:08:44,520 a suite of all of these programs 129 00:08:44,520 --> 00:08:46,260 in more of a production code setting, 130 00:08:46,420 --> 00:08:52,100 which does not have perhaps the tedium of my thesis, 131 00:08:52,200 --> 00:08:53,840 where I was actually sitting with a piece of paper 132 00:08:53,840 --> 00:08:56,080 next to my computer, writing out offsets. 133 00:08:57,140 --> 00:08:59,220 So, where it's going so right now, 134 00:08:59,240 --> 00:09:00,400 or where it's going right now, 135 00:09:00,520 --> 00:09:03,240 is I've developed a couple major analysis tools. 136 00:09:03,480 --> 00:09:05,860 I've got a quick little program 137 00:09:06,340 --> 00:09:08,740 to help build your libraries and indexes. 138 00:09:08,740 --> 00:09:12,220 Basically, reducing everything into that four-byte format 139 00:09:12,220 --> 00:09:13,460 that I was talking about earlier. 140 00:09:13,840 --> 00:09:16,940 And then, after that, we have the actual comparison engine. 141 00:09:17,300 --> 00:09:20,160 And then, kind of as a nasty side effect, 142 00:09:20,260 --> 00:09:22,180 it's necessary to filter the output. 143 00:09:22,560 --> 00:09:25,180 And this relates to the statement I made earlier. 144 00:09:25,980 --> 00:09:29,080 Because the input is not random, 145 00:09:29,300 --> 00:09:30,760 the input choices are not random, 146 00:09:30,840 --> 00:09:34,080 there's a lot of extra interesting stuff that comes out of it, 147 00:09:34,120 --> 00:09:36,800 which is something that needs some work in the future. 148 00:09:36,880 --> 00:09:37,700 I'll get to that in a bit. 149 00:09:37,700 --> 00:09:39,560 And then, there's also a program 150 00:09:39,560 --> 00:09:41,780 that helps with some visualizations. 151 00:09:42,140 --> 00:09:43,780 It does some side-by-side disassembly, 152 00:09:44,740 --> 00:09:47,360 helps generate some tables necessary for other tools, 153 00:09:47,460 --> 00:09:48,280 things along those lines. 154 00:09:48,520 --> 00:09:51,060 So, this is kind of the overview of what I have so far. 155 00:09:53,220 --> 00:09:55,440 The general process I've kind of thought of 156 00:09:55,440 --> 00:09:57,760 is basically you use MakeLib to build up your library, 157 00:09:58,000 --> 00:10:00,840 you perform a comparison, you pipe the output through it, 158 00:10:00,940 --> 00:10:04,740 and after that, you run that through MatchOutput 159 00:10:04,740 --> 00:10:06,420 to get the result that you want. 160 00:10:08,100 --> 00:10:10,300 The kind of unfortunate thing of this is 161 00:10:10,300 --> 00:10:14,640 any time you're starting to go from prototype to production code, 162 00:10:15,400 --> 00:10:18,140 your definition of what you need to do functionally changes. 163 00:10:18,440 --> 00:10:20,660 I spent a lot of time working on a web interface, 164 00:10:21,300 --> 00:10:23,740 which unfortunately does not have the utility 165 00:10:23,740 --> 00:10:25,080 that I'd hoped it to have. 166 00:10:25,580 --> 00:10:27,620 So, instead, now I'm going to focus a bit more 167 00:10:27,620 --> 00:10:28,420 on the command line tools. 168 00:10:28,580 --> 00:10:32,400 But this is kind of a sample of what I was able to come up with, 169 00:10:32,500 --> 00:10:35,200 where you can see the raw results are in the lower right window 170 00:10:35,200 --> 00:10:37,680 and some of the same things. 171 00:10:37,700 --> 00:10:40,380 Similarity and coverage tools are in the upper left corner. 172 00:10:40,560 --> 00:10:42,460 That's kind of hard to see. I apologize about that. 173 00:10:42,840 --> 00:10:47,120 So, with that said, here's one particular application 174 00:10:47,120 --> 00:10:49,220 that I kind of see for this technique, 175 00:10:49,480 --> 00:10:50,800 and that is in version analysis. 176 00:10:51,040 --> 00:10:55,340 So, we have here, we're going to do a version analysis of SendMail. 177 00:10:55,420 --> 00:10:57,700 So, you've got four versions of SendMail and two controls. 178 00:10:57,840 --> 00:11:01,160 The negative control, which is completely as far away 179 00:11:01,160 --> 00:11:05,540 from the mail transfer agent that's server and socket based 180 00:11:05,540 --> 00:11:06,100 that I could get, 181 00:11:06,100 --> 00:11:09,820 which is a graphics side scroller by the name of Chromium. 182 00:11:09,940 --> 00:11:11,460 And then I have a positive control, 183 00:11:11,700 --> 00:11:14,640 which is a sort of competitor mail transport agent 184 00:11:14,640 --> 00:11:16,100 to SendMail post fix. 185 00:11:16,380 --> 00:11:18,580 Now, it's kind of interesting here. 186 00:11:18,740 --> 00:11:22,180 I want to point out that the last entry, SendMail891, 187 00:11:22,300 --> 00:11:27,020 is the only one that was compiled with a pre-GCC3 compiler, 188 00:11:27,340 --> 00:11:29,900 which this shows up a little bit later. 189 00:11:31,000 --> 00:11:34,000 So, as far as what you actually get out of this technique 190 00:11:34,000 --> 00:11:35,440 are these fairly... 191 00:11:36,100 --> 00:11:38,160 confusing raw results where you get a score. 192 00:11:38,860 --> 00:11:40,880 It's that integer score I was talking about, 193 00:11:41,020 --> 00:11:42,180 how long the score is, 194 00:11:42,380 --> 00:11:45,680 and two offsets where it basically matched in both sets. 195 00:11:46,040 --> 00:11:49,040 So, you get a sort of what's called an alignment, 196 00:11:49,280 --> 00:11:52,100 a scored alignment of two sections of code. 197 00:11:52,400 --> 00:11:56,540 And dominantly, the major alignments that you see right off the top 198 00:11:56,540 --> 00:11:58,360 are these huge sections of code in the beginning, 199 00:11:58,920 --> 00:12:02,900 which are responsible for resolving all of the external library dependencies. 200 00:12:03,760 --> 00:12:05,260 So, this is something that... 201 00:12:06,100 --> 00:12:07,180 It's very, very repetitive. 202 00:12:07,360 --> 00:12:09,740 It goes on and on and on about the same thing. 203 00:12:09,920 --> 00:12:13,180 So, I'm sure most of you in the back can't read this, unfortunately. 204 00:12:13,380 --> 00:12:15,460 But basically, it starts off at the top. 205 00:12:15,540 --> 00:12:16,740 You have a typical entry point. 206 00:12:17,020 --> 00:12:19,920 And then after that, you have all of your symbol resolutions, 207 00:12:20,120 --> 00:12:24,180 which is this continuous repetition of three or... 208 00:12:24,180 --> 00:12:29,160 In GCC 3.0, it was anywhere from a three to five code opcode sequence 209 00:12:29,160 --> 00:12:31,140 that was repeated over and over and over and over. 210 00:12:32,100 --> 00:12:33,600 So, what can you do with this? 211 00:12:33,700 --> 00:12:34,660 Well, all right. 212 00:12:34,660 --> 00:12:35,140 We go through. 213 00:12:35,360 --> 00:12:38,220 And instead of considering the individual matches, 214 00:12:38,400 --> 00:12:40,580 let's group them into a coverage. 215 00:12:40,900 --> 00:12:42,620 So, okay, I have file A, 216 00:12:42,700 --> 00:12:45,300 and I have some other file I'm going to compare it against. 217 00:12:45,860 --> 00:12:49,240 And instead of trying to figure out all of the possible matches, 218 00:12:49,300 --> 00:12:53,520 just say, well, how much of file A is included in matches to file B? 219 00:12:53,760 --> 00:12:56,600 So, you can compute a similarity measure. 220 00:12:56,880 --> 00:13:00,100 And from this, you can compute a distance measure 221 00:13:00,100 --> 00:13:02,480 and use, again, a biology, 222 00:13:02,680 --> 00:13:04,640 a very, very well-established biology tool, 223 00:13:04,660 --> 00:13:05,760 by the name of PHILIP, 224 00:13:05,840 --> 00:13:08,300 which is the phylogenetic inference package. 225 00:13:08,540 --> 00:13:11,140 So, all of these graphs are directly generated 226 00:13:11,140 --> 00:13:13,260 using biology domain tools, 227 00:13:13,440 --> 00:13:15,460 which was very, very, very convenient. 228 00:13:16,040 --> 00:13:17,940 You'll note from this graph right off the top, 229 00:13:18,100 --> 00:13:20,000 you'll see that sendmail 891 230 00:13:20,660 --> 00:13:23,640 is very, very distant from everything else. 231 00:13:23,880 --> 00:13:25,140 In this particular graph, 232 00:13:25,320 --> 00:13:28,820 which is an unweighted pair group method with arithmetic mean, 233 00:13:29,560 --> 00:13:33,300 this graph, the horizontal distance is significant, 234 00:13:33,300 --> 00:13:36,100 and the vertical distance is just to show association. 235 00:13:36,460 --> 00:13:38,780 So, what this says is that sendmail 891 236 00:13:39,280 --> 00:13:41,800 is very distant from a common ancestor, 237 00:13:42,080 --> 00:13:44,980 where the other five programs 238 00:13:44,980 --> 00:13:47,640 are very close to some intermediate ancestor. 239 00:13:49,300 --> 00:13:52,480 So, this is kind of an interesting graph 240 00:13:52,480 --> 00:13:55,340 from the standpoint that in the biology domain, 241 00:13:55,540 --> 00:13:57,160 there is very, very, very hot debate 242 00:13:57,160 --> 00:14:00,380 over the graph on the left and the graph on the right. 243 00:14:00,560 --> 00:14:02,740 Now, superficially, it might seem as though 244 00:14:02,740 --> 00:14:04,620 they're kind of conveying the same information. 245 00:14:04,980 --> 00:14:08,420 However, the graph on the left, in the biology domain, 246 00:14:08,660 --> 00:14:11,560 has been hotly contested because it is associated 247 00:14:11,560 --> 00:14:13,880 with what's called a molecular clock, 248 00:14:14,180 --> 00:14:15,420 where there's an assumption made 249 00:14:15,420 --> 00:14:17,740 that mutation rates happen at a constant interval. 250 00:14:18,140 --> 00:14:19,540 And in the biology domain, 251 00:14:19,760 --> 00:14:21,740 there's been increasing research to support 252 00:14:21,740 --> 00:14:23,620 that says this is not an assumption that you can make. 253 00:14:23,780 --> 00:14:25,800 And I think it would be safe to make, 254 00:14:25,900 --> 00:14:28,080 to not make, rather, the same assumption 255 00:14:28,080 --> 00:14:29,120 in the computer science domain, 256 00:14:29,300 --> 00:14:32,260 because the way malware is adapting and evolving, 257 00:14:32,740 --> 00:14:35,800 I pretty much think has no really deterministic 258 00:14:35,800 --> 00:14:37,760 sort of mutation rate. 259 00:14:37,960 --> 00:14:39,920 So, the graph on the right 260 00:14:39,920 --> 00:14:41,560 is what's called the nearest neighbor method. 261 00:14:42,120 --> 00:14:44,060 So, basically, it's a graph, 262 00:14:44,600 --> 00:14:46,700 as opposed to the left, which is a tree. 263 00:14:46,880 --> 00:14:49,540 And it basically shows the current relative distance 264 00:14:49,540 --> 00:14:50,040 from everything. 265 00:14:50,320 --> 00:14:51,840 So, what that graph says is that 266 00:14:51,840 --> 00:14:55,420 sendmail 8.13.4 and 8.13.5 267 00:14:55,420 --> 00:14:56,760 are really close together, 268 00:14:56,980 --> 00:15:00,980 followed in a close second by sendmail 8.12.9. 269 00:15:01,180 --> 00:15:02,600 And then the negative control 270 00:15:02,740 --> 00:15:05,640 is slightly closer, or the positive control post-fix 271 00:15:05,640 --> 00:15:08,320 is slightly closer than the negative control chromium. 272 00:15:08,980 --> 00:15:11,900 So, this is, again, this reflects kind of intuitively, 273 00:15:12,140 --> 00:15:14,660 well, duh, this is what we were expecting to see happen. 274 00:15:14,820 --> 00:15:15,900 But that's a good thing. 275 00:15:16,020 --> 00:15:17,700 I think it indicates that this technique 276 00:15:17,700 --> 00:15:19,700 has a great strength. 277 00:15:20,440 --> 00:15:22,000 And this is something that I've applied 278 00:15:22,000 --> 00:15:25,280 against some other malware approaches. 279 00:15:26,000 --> 00:15:27,440 Have I quite gotten to the approach 280 00:15:27,440 --> 00:15:31,180 where I've considered 20, 30, 40, 50 pieces of malware 281 00:15:31,180 --> 00:15:32,420 and tried to put them in the same graph? 282 00:15:32,740 --> 00:15:33,820 No, not yet. 283 00:15:34,020 --> 00:15:37,160 And again, this comes from the ongoing development 284 00:15:37,160 --> 00:15:38,720 of production code to automate 285 00:15:38,720 --> 00:15:41,440 and produce these results with little interaction. 286 00:15:43,040 --> 00:15:44,760 So, I'm going to talk now... 287 00:15:44,760 --> 00:15:46,180 Okay, so there was one thing, version analysis, 288 00:15:46,360 --> 00:15:47,820 which is, again, very important 289 00:15:47,820 --> 00:15:51,240 if you're trying to receive and update your system 290 00:15:52,060 --> 00:15:54,280 and be able to keep up with those updates 291 00:15:54,280 --> 00:15:56,180 and say, okay, yeah, yeah, this is... 292 00:15:56,180 --> 00:15:58,140 I've got this version of code that came in 293 00:15:58,140 --> 00:16:01,140 and, oh, yeah, it's this new DLL, 294 00:16:01,200 --> 00:16:02,720 and, oh, yeah, it looks pretty good. 295 00:16:02,740 --> 00:16:03,800 It's pretty much like the last one, 296 00:16:03,920 --> 00:16:06,160 but it seems to have... 297 00:16:06,740 --> 00:16:08,920 Whoa, it has something that looks like a rootkit. 298 00:16:09,200 --> 00:16:10,740 Whoa, that shouldn't be in there. 299 00:16:10,900 --> 00:16:12,820 So that's the sort of thing that I'm hoping to address 300 00:16:12,820 --> 00:16:13,800 with version analysis. 301 00:16:14,160 --> 00:16:15,720 Now, as far as signature generation, 302 00:16:16,000 --> 00:16:19,480 again, this is kind of going towards 303 00:16:19,480 --> 00:16:22,600 a proactive self-network defense 304 00:16:22,600 --> 00:16:25,200 where basically you as a network administrator, 305 00:16:25,560 --> 00:16:26,940 you as a person with your own computer, 306 00:16:27,060 --> 00:16:30,120 can verify and validate your own systems. 307 00:16:30,520 --> 00:16:32,020 So how does this work? 308 00:16:32,740 --> 00:16:35,300 Step one, again, talking about the coverage 309 00:16:35,300 --> 00:16:36,940 of various programs, 310 00:16:37,160 --> 00:16:40,040 we start off with comparing the file, 311 00:16:40,450 --> 00:16:42,020 you know, some malicious malware 312 00:16:42,020 --> 00:16:43,980 against other malicious malware, 313 00:16:44,720 --> 00:16:45,340 against... 314 00:16:45,340 --> 00:16:48,880 It's pretty much your candidate generation set. 315 00:16:49,040 --> 00:16:51,720 So you're asking the question, 316 00:16:51,960 --> 00:16:54,680 what makes this particular program unique 317 00:16:54,680 --> 00:16:55,980 in a set of other programs? 318 00:16:56,180 --> 00:16:58,160 And after this point, you're going to get 319 00:16:58,160 --> 00:17:01,520 a collection of fragments that are included 320 00:17:01,520 --> 00:17:03,060 in the partial or fuzzy matches. 321 00:17:03,360 --> 00:17:06,200 And then after that, you can take the negation 322 00:17:06,200 --> 00:17:07,160 of that particular set 323 00:17:07,160 --> 00:17:10,420 and get the fragments that weren't included in any match. 324 00:17:10,560 --> 00:17:12,900 And at this point, the third line down, 325 00:17:13,080 --> 00:17:14,440 this is where you're actually working 326 00:17:14,440 --> 00:17:15,820 with the sections of code 327 00:17:16,280 --> 00:17:19,160 that make the file A unique. 328 00:17:19,660 --> 00:17:22,740 And ideally, to make this system robust 329 00:17:22,740 --> 00:17:25,000 and avoid, you know, if you're using this 330 00:17:25,000 --> 00:17:27,080 to do antivirus signature generation, 331 00:17:27,360 --> 00:17:30,060 ideally, to avoid this matching particular things 332 00:17:30,060 --> 00:17:31,840 in your host system, 333 00:17:32,040 --> 00:17:33,860 in your host operating system, your own applications, 334 00:17:34,260 --> 00:17:36,120 you're going to need to do a negative selection 335 00:17:36,120 --> 00:17:39,460 where basically you take all of these candidates set 336 00:17:39,460 --> 00:17:42,900 and you run against some universal self-set. 337 00:17:43,120 --> 00:17:45,380 In this way, you basically remove the candidates 338 00:17:45,380 --> 00:17:47,100 that match yourself, and you end up with 339 00:17:47,100 --> 00:17:50,020 a selection of programs that... 340 00:17:50,020 --> 00:17:52,820 a selection of signatures that match 341 00:17:52,820 --> 00:17:55,880 this particular nasty or good thing 342 00:17:55,880 --> 00:17:57,180 or whatever as unique. 343 00:17:58,440 --> 00:18:00,040 So here's a quick example 344 00:18:00,060 --> 00:18:02,840 and I'm going to do a really brief demo here. 345 00:18:03,340 --> 00:18:05,020 And so let's pose the question, 346 00:18:05,280 --> 00:18:07,320 what makes Borland compiled code unique? 347 00:18:08,020 --> 00:18:10,080 So the way we're going to go about doing this 348 00:18:10,780 --> 00:18:14,680 is first I'm going to use a very, very simple code program 349 00:18:14,680 --> 00:18:18,000 that will exercise a number of compiler constructs. 350 00:18:18,040 --> 00:18:19,980 And then after that, we're going to go ahead 351 00:18:19,980 --> 00:18:22,820 and compile this against a number of compilers, 352 00:18:22,900 --> 00:18:24,520 Borland, Visual C, GCC, 353 00:18:25,120 --> 00:18:28,240 to basically get some set to compare it against. 354 00:18:28,600 --> 00:18:30,020 What I'm not going to do is 355 00:18:30,060 --> 00:18:31,780 actually run that final candidate generation 356 00:18:31,780 --> 00:18:32,900 and negative selection. 357 00:18:33,200 --> 00:18:36,300 That is something that hasn't been quite reached yet. 358 00:18:36,780 --> 00:18:41,160 So we go over here, and we're cheating already. 359 00:18:41,360 --> 00:18:42,100 We have the answers. 360 00:18:42,600 --> 00:18:43,760 So we'll start again. 361 00:18:43,940 --> 00:18:46,780 So we have basically the output of the bin blast program 362 00:18:46,780 --> 00:18:48,940 after it's run through bin compare. 363 00:18:49,200 --> 00:18:51,780 So unfortunately, this is very tiny. 364 00:18:52,980 --> 00:18:54,840 We will go ahead this way, 365 00:18:54,980 --> 00:18:57,460 and that does not make it any less tiny. 366 00:18:57,780 --> 00:18:59,260 Oh, unfortunate. 367 00:18:59,260 --> 00:19:01,060 But basically what this is showing 368 00:19:01,060 --> 00:19:04,420 is it's just showing this sort of four tuple of results 369 00:19:04,420 --> 00:19:07,080 and how they have, how they match up. 370 00:19:07,240 --> 00:19:09,420 So we're going to run this through a brief program 371 00:19:09,420 --> 00:19:11,100 that will run that candidate generation 372 00:19:11,100 --> 00:19:12,500 that I was talking about, 373 00:19:12,640 --> 00:19:15,220 because that previous result set basically says 374 00:19:15,220 --> 00:19:17,100 these are the sections of code 375 00:19:17,100 --> 00:19:20,380 that were included in matches to other files. 376 00:19:20,740 --> 00:19:22,020 So we're going to run this against, 377 00:19:22,220 --> 00:19:24,320 through the candidate generation program, 378 00:19:24,480 --> 00:19:27,340 and we're going to get out a bunch of possible candidates. 379 00:19:27,340 --> 00:19:33,160 So of the three, of the three compilers that I compared, 380 00:19:33,360 --> 00:19:36,440 the three executables that were generated, 381 00:19:36,680 --> 00:19:38,160 these are all of the difference, 382 00:19:38,680 --> 00:19:39,780 according to this technique, 383 00:19:39,900 --> 00:19:41,500 these are all of the differences that were reported. 384 00:19:41,700 --> 00:19:44,040 And you can see this list is not very long at all, 385 00:19:44,080 --> 00:19:44,940 not very long at all. 386 00:19:45,360 --> 00:19:47,100 And by the way, if you were kind of curious 387 00:19:47,100 --> 00:19:48,460 as to what the code was, 388 00:19:49,040 --> 00:19:52,460 this was some example code that Chris Eagle had come up with, 389 00:19:52,600 --> 00:19:55,720 which basically it's just a short series of comparisons 390 00:19:55,720 --> 00:19:58,440 and just some Boolean operations 391 00:19:58,440 --> 00:20:01,660 to exercise various if-then-else constructs, 392 00:20:01,660 --> 00:20:04,420 switch constructs, very simple code. 393 00:20:04,820 --> 00:20:06,800 So let's go ahead and say, all right, 394 00:20:06,840 --> 00:20:09,040 so we've got this, all right, what's it here? 395 00:20:09,340 --> 00:20:11,200 It's DEC9DB. 396 00:20:11,420 --> 00:20:13,760 It seems to be a unique, unique code. 397 00:20:13,880 --> 00:20:14,940 So we're going to pop over here, 398 00:20:15,760 --> 00:20:18,060 and we're going to go ahead and look that up. 399 00:20:19,220 --> 00:20:20,980 DEC9, so that's just the start of it. 400 00:20:21,040 --> 00:20:22,340 So what does this actually look like? 401 00:20:22,760 --> 00:20:24,340 Well, and it looks like we're matching 402 00:20:24,340 --> 00:20:25,840 on a floating point multiply. 403 00:20:26,380 --> 00:20:27,760 Well, geez, that's kind of odd. 404 00:20:27,900 --> 00:20:29,940 I wonder why Borland's spitting out floating point code 405 00:20:29,940 --> 00:20:33,060 when working with just some simple integer operations. 406 00:20:34,000 --> 00:20:35,080 Kind of something interesting. 407 00:20:35,280 --> 00:20:37,080 Unfortunately, as I said, 408 00:20:37,140 --> 00:20:39,380 the code is moving forward towards production code, 409 00:20:39,520 --> 00:20:41,780 so this hasn't gone through a very thorough analysis. 410 00:20:42,120 --> 00:20:44,200 And as I said, I was borrowing this example 411 00:20:44,200 --> 00:20:46,440 from some of Chris Eagle's examples, 412 00:20:46,620 --> 00:20:49,180 so I don't have access to a Borland compiler right now. 413 00:20:49,280 --> 00:20:51,360 So this is just kind of a quick overview 414 00:20:52,300 --> 00:20:54,320 of what sort of things you can do with this. 415 00:20:56,980 --> 00:21:01,380 So back to the beginning of the presentation, 416 00:21:01,660 --> 00:21:04,820 which is not quite where I want it to be. 417 00:21:06,300 --> 00:21:07,860 So we were here, 418 00:21:08,000 --> 00:21:12,400 and so we were able to very quickly 419 00:21:12,400 --> 00:21:16,140 generate a signature, as it were, 420 00:21:16,240 --> 00:21:18,980 for what makes or may make Borland code unique. 421 00:21:20,820 --> 00:21:23,340 So at this point in time, 422 00:21:23,340 --> 00:21:26,640 I have just flown through my presentation. 423 00:21:27,900 --> 00:21:30,680 So let's look at some additional information here. 424 00:21:33,660 --> 00:21:35,200 So I mentioned earlier 425 00:21:35,200 --> 00:21:36,960 that I'd done some phylogenetic analysis 426 00:21:36,960 --> 00:21:42,020 against a couple, anyways, malware codes. 427 00:21:42,260 --> 00:21:44,480 So I was looking at three versions here, 428 00:21:45,130 --> 00:21:46,720 MyDooms A, L, and Q, 429 00:21:46,860 --> 00:21:49,000 and I had for comparison 430 00:21:49,000 --> 00:21:50,540 both the packed and unpacked versions. 431 00:21:51,860 --> 00:21:53,180 So again, 432 00:21:53,340 --> 00:21:54,340 running it through this technique, 433 00:21:54,500 --> 00:21:55,820 it refers to something that, 434 00:21:56,180 --> 00:21:58,660 it creates something that infers 435 00:21:58,660 --> 00:22:00,460 the same sort of technique 436 00:22:00,460 --> 00:22:02,400 or what you would intuitively expect. 437 00:22:02,740 --> 00:22:03,520 So this is pretty much, 438 00:22:03,640 --> 00:22:04,400 all right, well, 439 00:22:04,540 --> 00:22:06,380 we know that MyDoom A, L, and Q 440 00:22:06,380 --> 00:22:07,340 are very closely related. 441 00:22:07,540 --> 00:22:08,180 And indeed, 442 00:22:08,280 --> 00:22:09,920 you run it through this particular technique, 443 00:22:10,040 --> 00:22:11,100 it comes out with the same answer. 444 00:22:11,920 --> 00:22:12,820 What's kind of interesting 445 00:22:12,820 --> 00:22:15,460 on the nearest neighbor graph on the right, 446 00:22:15,600 --> 00:22:19,320 that MyDoom A and the packed version of MyDoom A 447 00:22:19,320 --> 00:22:20,840 are very close to each other. 448 00:22:21,340 --> 00:22:23,080 I still have yet to actually sit down 449 00:22:23,080 --> 00:22:24,620 and look at quite exactly why that is. 450 00:22:25,220 --> 00:22:26,440 It's a bit of an enigma. 451 00:22:27,320 --> 00:22:28,920 It may be that the packer 452 00:22:28,920 --> 00:22:32,140 was used a bit more judiciously later on. 453 00:22:32,500 --> 00:22:36,060 It could be that the MyDoom A code 454 00:22:36,060 --> 00:22:38,960 just didn't go through the UPX packer very well. 455 00:22:39,300 --> 00:22:41,000 So these are all questions that, 456 00:22:41,100 --> 00:22:42,520 who knows? 457 00:22:44,280 --> 00:22:48,600 So kind of in summary, 458 00:22:51,220 --> 00:22:53,060 what I've talked about 459 00:22:53,060 --> 00:22:57,000 so far is that basically by making a simple analog, 460 00:22:57,220 --> 00:22:58,760 I was able to pull over a technique 461 00:22:58,760 --> 00:22:59,860 from the biology domain. 462 00:23:00,480 --> 00:23:02,640 And it seems to be working very well, 463 00:23:02,680 --> 00:23:04,980 at least in the test cases I've evaluated so far, 464 00:23:05,320 --> 00:23:06,900 that it seems to work well on binaries. 465 00:23:07,500 --> 00:23:10,160 And I'm developing an open source suite, 466 00:23:10,780 --> 00:23:13,460 and it seems to be sensitive to compiler code generation. 467 00:23:13,980 --> 00:23:16,420 Well, there's some other benefits to this as well. 468 00:23:17,360 --> 00:23:19,680 Because it is a very simple technique, 469 00:23:19,800 --> 00:23:21,780 it has some excellent runtime characteristics, 470 00:23:21,780 --> 00:23:24,380 which is something that I'm hoping to exploit 471 00:23:24,380 --> 00:23:25,900 in some of the future work. 472 00:23:26,200 --> 00:23:28,240 As I said, production is, 473 00:23:28,380 --> 00:23:31,060 I'm working right now on moving this to production code, 474 00:23:31,220 --> 00:23:32,940 and the people at Offensive Computing 475 00:23:32,940 --> 00:23:35,400 are helping quite a bit with this movement. 476 00:23:35,580 --> 00:23:37,220 And moving towards things, 477 00:23:37,820 --> 00:23:39,320 helping out greatly with their 478 00:23:39,320 --> 00:23:40,800 automatic malware classification 479 00:23:40,800 --> 00:23:43,720 is the big project that I'm pursuing right now. 480 00:23:44,760 --> 00:23:46,460 However, I'm hoping to, 481 00:23:46,540 --> 00:23:48,400 in cooperation with their 482 00:23:49,400 --> 00:23:51,200 collaborative reverse engineering environment, 483 00:23:51,780 --> 00:23:54,820 start to use this to identify those particular motifs. 484 00:23:55,420 --> 00:23:56,840 As I'd said earlier, 485 00:23:57,060 --> 00:23:58,760 that when you run this code, 486 00:23:58,880 --> 00:24:02,460 if there's not randomness in the data, 487 00:24:02,640 --> 00:24:04,980 you end up with a lot of repetitions in the output. 488 00:24:05,400 --> 00:24:07,000 Well, one of the ways that, 489 00:24:07,080 --> 00:24:09,340 in the biology domain, they've actually solved this, 490 00:24:09,420 --> 00:24:11,460 is by identifying particular motifs, 491 00:24:11,980 --> 00:24:13,820 which is kind of a fun concept, 492 00:24:14,000 --> 00:24:15,640 in that you can go through and say, 493 00:24:15,740 --> 00:24:17,700 alright, well, I've done some reverse engineering, 494 00:24:17,880 --> 00:24:18,980 and I've come up with this. 495 00:24:19,480 --> 00:24:21,480 This is a ROT13 decoder. 496 00:24:21,960 --> 00:24:24,160 Alright, and I've looked at it, 497 00:24:24,260 --> 00:24:25,720 and so I add it back into 498 00:24:25,720 --> 00:24:27,060 the reverse engineering database, 499 00:24:27,220 --> 00:24:29,820 and I say, alright, this particular section of code here 500 00:24:30,380 --> 00:24:32,120 is a ROT13 decoder. 501 00:24:32,380 --> 00:24:33,080 And then, 502 00:24:33,920 --> 00:24:35,900 any time that particular code sequence 503 00:24:35,900 --> 00:24:37,680 shows up again, you have a database of, 504 00:24:37,760 --> 00:24:38,480 this is the motif. 505 00:24:38,820 --> 00:24:41,820 So let's say you get something brand new, 506 00:24:41,900 --> 00:24:44,160 like you've never seen MyDoom Assume for a moment, 507 00:24:44,220 --> 00:24:45,840 you haven't seen MyDoomD before. 508 00:24:46,440 --> 00:24:48,040 So you run it through the algorithm, 509 00:24:48,200 --> 00:24:49,420 and all of a sudden you get a match 510 00:24:49,420 --> 00:24:51,300 to this particular library you have 511 00:24:51,780 --> 00:24:52,600 of existing code motifs, 512 00:24:52,640 --> 00:24:55,480 of stuff that you've spent a lot of time to develop, 513 00:24:55,640 --> 00:24:57,420 and a lot of time to consider. 514 00:24:57,720 --> 00:24:59,260 And, well, lo and behold, 515 00:24:59,480 --> 00:25:01,440 all of a sudden you're getting a large number of matches 516 00:25:01,440 --> 00:25:03,780 to this ROT13 decoder. 517 00:25:04,920 --> 00:25:06,260 Well, what might that indicate? 518 00:25:06,600 --> 00:25:08,460 Well, perhaps this particular virus 519 00:25:08,460 --> 00:25:10,660 is using some sort of encoding scheme like that. 520 00:25:10,940 --> 00:25:11,980 So, from the standpoint, 521 00:25:12,220 --> 00:25:13,600 I'm sort of approaching this as 522 00:25:13,600 --> 00:25:15,600 not only an automated tool, 523 00:25:15,720 --> 00:25:17,080 but an interactive tool 524 00:25:17,080 --> 00:25:18,700 that will allow you to database 525 00:25:18,700 --> 00:25:20,920 your previous reverse engineering experience, 526 00:25:21,780 --> 00:25:24,220 and extend it to your new work. 527 00:25:24,480 --> 00:25:27,360 Because, as I keep on saying 528 00:25:27,360 --> 00:25:28,260 over and over again, 529 00:25:28,580 --> 00:25:30,360 the time that you have 530 00:25:30,360 --> 00:25:31,940 for identifying patches to your system 531 00:25:31,940 --> 00:25:34,120 is going to go down to almost zero. 532 00:25:34,380 --> 00:25:35,760 And so you need to be able to have 533 00:25:35,760 --> 00:25:36,820 some way to defend yourself. 534 00:25:38,800 --> 00:25:40,900 And soon this will all be available 535 00:25:40,900 --> 00:25:43,540 at the offensivecomputing.net site. 536 00:25:44,240 --> 00:25:45,260 Unfortunately, as I said, 537 00:25:46,080 --> 00:25:47,900 it's kind of a tedious process 538 00:25:47,900 --> 00:25:49,260 of trying to find new functionality, 539 00:25:49,760 --> 00:25:51,000 refining the program analysis, 540 00:25:51,200 --> 00:25:51,760 and moving it to the next step. 541 00:25:51,780 --> 00:25:52,260 Moving forward. 542 00:25:53,200 --> 00:25:54,920 So, at this point in time, 543 00:25:55,620 --> 00:25:57,300 I'm running well ahead of schedule, 544 00:25:57,460 --> 00:25:58,440 but I'd like to open it up 545 00:25:58,440 --> 00:25:59,580 to any questions in the audience. 546 00:25:59,980 --> 00:26:02,040 Now, there is a microphone in the center, 547 00:26:02,260 --> 00:26:04,280 so if you have any questions, 548 00:26:04,520 --> 00:26:06,480 go out and use that. 549 00:26:07,200 --> 00:26:08,960 Are there any questions right off the bat? 550 00:26:15,820 --> 00:26:17,680 I was just curious 551 00:26:17,680 --> 00:26:20,120 how your analysis 552 00:26:20,120 --> 00:26:21,680 would handle polymorphic code. 553 00:26:22,440 --> 00:26:23,980 Well, that is an excellent question, 554 00:26:24,200 --> 00:26:24,720 and there was, 555 00:26:25,240 --> 00:26:26,620 very, very early on, 556 00:26:26,700 --> 00:26:27,780 there was a great consideration 557 00:26:27,780 --> 00:26:30,420 as to how might this technique 558 00:26:30,420 --> 00:26:33,780 be robust against such a problem. 559 00:26:35,120 --> 00:26:36,460 And one of the ways 560 00:26:36,460 --> 00:26:37,840 in which it does this 561 00:26:37,840 --> 00:26:41,820 is that it tries to make 562 00:26:41,820 --> 00:26:42,620 the assumption that, 563 00:26:42,700 --> 00:26:42,920 all right, 564 00:26:43,020 --> 00:26:44,340 so every architecture 565 00:26:44,340 --> 00:26:45,840 has some sort of move operation 566 00:26:45,840 --> 00:26:46,480 of some sort, 567 00:26:46,500 --> 00:26:47,480 some sort of memory management, 568 00:26:51,780 --> 00:26:52,560 your pushes, your pops, 569 00:26:52,660 --> 00:26:53,920 well, depending upon your architecture. 570 00:26:54,840 --> 00:26:57,020 So instead of just strictly considering, 571 00:26:57,200 --> 00:26:58,480 all right, this is the instruction, 572 00:26:58,640 --> 00:26:59,920 I'm going to do an exact string match, 573 00:27:00,080 --> 00:27:01,940 I'm going to do a fuzzy string match. 574 00:27:02,080 --> 00:27:05,080 So if I match just the operator class, 575 00:27:05,420 --> 00:27:07,100 so I've grouped all the operators 576 00:27:07,100 --> 00:27:08,180 into a class, 577 00:27:08,320 --> 00:27:10,100 if I match just the operator, 578 00:27:10,300 --> 00:27:10,940 I'll add four. 579 00:27:11,440 --> 00:27:13,340 If I match the entire operator, 580 00:27:13,460 --> 00:27:14,320 not just the class, 581 00:27:14,640 --> 00:27:16,760 I'll assign that, I'll add five to the score. 582 00:27:16,960 --> 00:27:19,860 And if I match the entire operator 583 00:27:21,780 --> 00:27:22,600 I'll add six to the score. 584 00:27:22,920 --> 00:27:24,800 And if there's no match at all, 585 00:27:24,820 --> 00:27:25,480 it subtracts four. 586 00:27:25,640 --> 00:27:27,000 And this was the result of the 587 00:27:27,000 --> 00:27:29,000 analysis mentioned here. 588 00:27:29,220 --> 00:27:29,980 So in this way, 589 00:27:30,120 --> 00:27:32,800 it has some resistance to polymorphic code 590 00:27:32,800 --> 00:27:35,200 in that it's looking not only at 591 00:27:35,200 --> 00:27:36,880 the specific operators, operands 592 00:27:36,880 --> 00:27:37,640 that are being issued, 593 00:27:37,800 --> 00:27:40,240 but kind of sort of the general gist of things 594 00:27:40,240 --> 00:27:41,100 is what it was going for. 595 00:27:41,500 --> 00:27:43,160 Additionally, because this is doing 596 00:27:43,860 --> 00:27:44,660 subalignment matches, 597 00:27:45,060 --> 00:27:48,780 it's resistant to code reordering. 598 00:27:51,780 --> 00:27:52,620 So if I shift those around the file, 599 00:27:52,820 --> 00:27:55,060 it will say, oh, you have, 600 00:27:55,680 --> 00:27:57,880 it will match that first part 601 00:27:57,880 --> 00:27:59,000 and the second part. 602 00:27:59,220 --> 00:28:00,820 So in that way, it does, 603 00:28:01,080 --> 00:28:03,140 or it was designed to 604 00:28:03,640 --> 00:28:05,460 hopefully deal with polymorphic code in mind. 605 00:28:06,320 --> 00:28:07,600 Unfortunately, as I said, 606 00:28:07,780 --> 00:28:09,060 it's one of those 607 00:28:09,060 --> 00:28:10,480 exciting things, actually, 608 00:28:10,560 --> 00:28:12,480 to be able to have something that's just 609 00:28:12,480 --> 00:28:13,240 kind of at the start. 610 00:28:14,900 --> 00:28:16,640 There was part of the design 611 00:28:16,640 --> 00:28:18,620 that it would be resistant against that. 612 00:28:18,780 --> 00:28:21,000 But as far as how it actually does, 613 00:28:21,780 --> 00:28:22,180 that's a good question. 614 00:28:22,440 --> 00:28:24,020 I haven't quite gotten to that yet. 615 00:28:24,160 --> 00:28:25,140 Does that answer your question? 616 00:28:25,520 --> 00:28:25,980 Excellent. 617 00:28:26,280 --> 00:28:27,540 Do we have any other questions? 618 00:28:30,540 --> 00:28:31,640 Have you ever used 619 00:28:31,640 --> 00:28:33,100 or heard of a tool called Bindiff? 620 00:28:33,420 --> 00:28:34,420 Yes, yes. 621 00:28:34,500 --> 00:28:36,140 This differs quite a bit from Bindiff 622 00:28:36,140 --> 00:28:38,340 in that Bindiff is looking at 623 00:28:38,340 --> 00:28:39,620 a sort of function block level, 624 00:28:39,760 --> 00:28:41,080 and basically it is looking 625 00:28:41,080 --> 00:28:42,580 and going through and cataloging 626 00:28:42,580 --> 00:28:44,500 the various function calls that are made 627 00:28:46,040 --> 00:28:48,380 and basically sort of doing analysis 628 00:28:51,780 --> 00:28:53,840 and this is actually going one level lower 629 00:28:53,840 --> 00:28:55,100 and actually doing instruction 630 00:28:55,560 --> 00:28:56,620 sequence level analysis. 631 00:28:57,000 --> 00:28:57,900 Yes, yes. 632 00:28:58,300 --> 00:28:59,540 Haver's work is actually, 633 00:28:59,700 --> 00:29:01,240 I looked at it very closely 634 00:29:01,240 --> 00:29:02,640 in the development process. 635 00:29:04,260 --> 00:29:07,080 It may actually have superior performance to this 636 00:29:07,080 --> 00:29:08,720 in terms of runtime analysis. 637 00:29:09,520 --> 00:29:10,940 This is a bit more heavyweight approach. 638 00:29:12,900 --> 00:29:13,620 This is, 639 00:29:13,720 --> 00:29:14,260 as I said, 640 00:29:14,380 --> 00:29:16,900 this has the potential to possibly 641 00:29:16,900 --> 00:29:17,640 have a better 642 00:29:19,220 --> 00:29:20,880 resistance to polymorphic code. 643 00:29:22,000 --> 00:29:23,440 The long and the short of it, 644 00:29:23,480 --> 00:29:24,900 does that, first of all, 645 00:29:24,920 --> 00:29:26,420 does that answer your question reasonably? 646 00:29:28,480 --> 00:29:29,980 The long and the short of it, 647 00:29:30,060 --> 00:29:30,940 it was mentioned in 648 00:29:31,620 --> 00:29:32,560 Danny and Anthony, 649 00:29:32,700 --> 00:29:35,060 or Danny and Val Smith's speech earlier 650 00:29:35,780 --> 00:29:38,100 that everyone needs to collaborate. 651 00:29:38,320 --> 00:29:39,140 We all need to collaborate 652 00:29:39,660 --> 00:29:41,700 as far as trying to 653 00:29:41,700 --> 00:29:43,280 go against reverse engineering 654 00:29:43,280 --> 00:29:44,160 and malware analysis. 655 00:29:44,660 --> 00:29:47,260 So is there any one singular solution 656 00:29:47,550 --> 00:29:49,680 to all of the problems that we're facing now? 657 00:29:49,980 --> 00:29:50,980 I think not. 658 00:29:51,780 --> 00:29:53,360 It's trying to come up with a general solution. 659 00:29:53,620 --> 00:29:55,240 There may be some general solution 660 00:29:55,240 --> 00:29:55,840 to this approach. 661 00:29:56,440 --> 00:29:57,140 Who knows? 662 00:29:58,180 --> 00:30:01,060 But I think it's kind of interesting 663 00:30:01,060 --> 00:30:02,580 and important that everybody collaborate 664 00:30:02,580 --> 00:30:04,500 and say, oh, okay, well we've got this tool. 665 00:30:04,680 --> 00:30:05,940 I've got it to a point where it's working well. 666 00:30:06,040 --> 00:30:06,780 How well does it work? 667 00:30:06,880 --> 00:30:08,760 How well does it work against Bindiff? 668 00:30:08,920 --> 00:30:10,220 And that's actually something that 669 00:30:10,220 --> 00:30:12,220 I've not really had a chance to get my hands on yet. 670 00:30:13,100 --> 00:30:15,020 I have an evaluation copy now 671 00:30:15,020 --> 00:30:17,460 which I'm going to look at and play with 672 00:30:17,460 --> 00:30:18,480 and see how it does. 673 00:30:22,540 --> 00:30:23,880 It's a paper napkin idea. 674 00:30:24,040 --> 00:30:25,120 What can I do with this? 675 00:30:25,980 --> 00:30:27,480 And it's kind of going from there. 676 00:30:30,280 --> 00:30:30,680 Incidentally, 677 00:30:30,680 --> 00:30:31,700 he made reference 678 00:30:31,700 --> 00:30:33,940 to a program 679 00:30:33,940 --> 00:30:35,320 called Bindiff 680 00:30:35,320 --> 00:30:37,000 which is the 681 00:30:37,720 --> 00:30:39,340 third from the bottom reference 682 00:30:39,340 --> 00:30:39,960 that I have here. 683 00:30:40,160 --> 00:30:42,080 He had a paper by the name of 684 00:30:42,080 --> 00:30:46,120 Structural Comparison of Executable Objects 685 00:30:46,120 --> 00:30:48,160 which was one of his earlier papers. 686 00:30:48,400 --> 00:30:49,980 He's done a lot of work since then. 687 00:30:50,100 --> 00:30:51,560 I believe there's even a new version out. 688 00:30:51,780 --> 00:30:53,600 Yes, I'm very interested 689 00:30:53,600 --> 00:30:54,280 in looking at that. 690 00:30:55,550 --> 00:30:57,120 Again, does that answer your question? 691 00:30:57,400 --> 00:30:57,920 Excellent. 692 00:30:58,160 --> 00:30:59,540 Do we have any more questions? 693 00:31:01,180 --> 00:31:03,960 How does it handle 694 00:31:03,960 --> 00:31:05,300 code that is designed to 695 00:31:06,000 --> 00:31:07,880 generate instruction offsets 696 00:31:07,880 --> 00:31:08,920 at one time and then 697 00:31:08,920 --> 00:31:11,000 use indirect jumps or calls 698 00:31:11,000 --> 00:31:13,060 to obfuscate 699 00:31:13,060 --> 00:31:14,460 the actual code locations? 700 00:31:14,880 --> 00:31:15,760 That's a good question. 701 00:31:18,580 --> 00:31:19,240 Let's see. 702 00:31:19,300 --> 00:31:20,800 Do I even have an example of that here? 703 00:31:21,880 --> 00:31:22,880 No, I'm not going to. 704 00:31:22,960 --> 00:31:24,640 That's going to be probably a bad idea. 705 00:31:25,160 --> 00:31:26,600 As far as that, unfortunately, 706 00:31:26,740 --> 00:31:28,160 all of the work that you've seen up here 707 00:31:28,160 --> 00:31:30,000 on the screen today 708 00:31:30,000 --> 00:31:32,920 has been based off of an assembly 709 00:31:32,920 --> 00:31:34,480 generated by the obj.util 710 00:31:34,480 --> 00:31:37,520 which is a spanning search type disassembler 711 00:31:37,520 --> 00:31:38,580 where it basically starts at the beginning 712 00:31:38,580 --> 00:31:39,800 of the code section 713 00:31:39,800 --> 00:31:41,520 and starts to produce opcodes. 714 00:31:42,620 --> 00:31:44,000 Incidentally, this particular approach 715 00:31:44,000 --> 00:31:46,080 does a very poor job of 716 00:31:46,080 --> 00:31:47,600 what you were describing 717 00:31:47,600 --> 00:31:50,060 where basically it has code that will jump 718 00:31:51,780 --> 00:31:51,920 into a fragment 719 00:31:51,920 --> 00:31:54,080 within the existing code. 720 00:31:54,500 --> 00:31:56,580 As it stands now, 721 00:31:56,740 --> 00:31:57,640 using objdump 722 00:31:58,600 --> 00:32:00,880 it does an incredibly poor job of that. 723 00:32:01,500 --> 00:32:03,600 However, I'm looking at 724 00:32:03,600 --> 00:32:05,860 actually making use of some better disassemblers 725 00:32:05,860 --> 00:32:07,420 looking at linking into 726 00:32:07,420 --> 00:32:08,100 IDAPro 727 00:32:08,100 --> 00:32:11,640 which has kind of an interactive disassembly approach 728 00:32:11,640 --> 00:32:12,980 where you can walk through and say, 729 00:32:13,040 --> 00:32:13,900 okay, well, 730 00:32:14,700 --> 00:32:16,500 if I do a static disassembly 731 00:32:16,500 --> 00:32:18,740 straight up, this is what it's going to look like. 732 00:32:18,840 --> 00:32:20,940 However, there's a lot of stuff in here 733 00:32:21,780 --> 00:32:23,440 that's ultimately fooling the disassembler. 734 00:32:23,540 --> 00:32:24,840 So if I step through and say, 735 00:32:24,960 --> 00:32:26,840 well, no, no, this is not quite the alignment 736 00:32:26,840 --> 00:32:27,480 you were expecting. 737 00:32:27,700 --> 00:32:29,160 Let's go back and start that again. 738 00:32:29,980 --> 00:32:31,840 So that's one approach to doing it. 739 00:32:32,260 --> 00:32:33,580 Another approach to doing that 740 00:32:33,580 --> 00:32:34,540 that I have considered 741 00:32:34,540 --> 00:32:36,080 is kind of related to 742 00:32:37,220 --> 00:32:39,320 another interesting way that this might go 743 00:32:39,320 --> 00:32:40,740 which is actually looking at 744 00:32:40,740 --> 00:32:42,560 just straight dumps off the network. 745 00:32:42,680 --> 00:32:43,680 Straight dumps from memory. 746 00:32:44,280 --> 00:32:46,900 And in much the same way that the encoding process 747 00:32:46,900 --> 00:32:48,280 with DNA works 748 00:32:51,780 --> 00:32:52,560 or a reading frame 749 00:32:52,560 --> 00:32:54,580 before you can actually begin this process, 750 00:32:55,280 --> 00:32:56,500 much the same way, 751 00:32:57,160 --> 00:32:58,640 consider all reading frames. 752 00:32:59,160 --> 00:33:01,240 So, okay, I start a static disassembly at this byte. 753 00:33:01,360 --> 00:33:02,640 I generate some disassembly. 754 00:33:02,680 --> 00:33:04,340 Well, how did it turn out? 755 00:33:04,540 --> 00:33:07,400 Okay, and then just move one byte forward 756 00:33:07,400 --> 00:33:08,920 as opposed to trying to 757 00:33:09,560 --> 00:33:11,580 go through the instruction directives 758 00:33:11,580 --> 00:33:12,880 or the 759 00:33:13,800 --> 00:33:14,320 rather 760 00:33:14,320 --> 00:33:16,780 move one byte forward instead of moving 761 00:33:16,780 --> 00:33:18,000 two or three bytes forward 762 00:33:18,000 --> 00:33:21,200 as one might expect given the particular instruction 763 00:33:21,780 --> 00:33:22,020 executed. 764 00:33:22,220 --> 00:33:23,600 So that's another way to do it. 765 00:33:24,800 --> 00:33:26,820 So, yes, yes, unfortunately 766 00:33:26,820 --> 00:33:29,240 what you see up here does not do well with that. 767 00:33:29,500 --> 00:33:31,640 But I'm looking at some ways to try to be able to 768 00:33:31,640 --> 00:33:32,600 address that in the future. 769 00:33:32,720 --> 00:33:33,800 Does that answer your question? 770 00:33:34,320 --> 00:33:35,080 Excellent, excellent. 771 00:33:35,220 --> 00:33:36,260 Do we have any other questions? 772 00:33:38,640 --> 00:33:40,820 Do you think this is applying equally well to 773 00:33:41,300 --> 00:33:43,020 assembly language from all different architectures 774 00:33:43,020 --> 00:33:44,280 or is this X86 specific? 775 00:33:45,820 --> 00:33:46,960 It's an excellent question. 776 00:33:47,940 --> 00:33:49,620 As I kind of 777 00:33:49,620 --> 00:33:50,320 was a little quiet. 778 00:33:51,780 --> 00:33:52,620 Is this cross platform? 779 00:33:52,940 --> 00:33:54,660 Is this applicable to other architectures? 780 00:33:55,340 --> 00:33:55,860 Yes. 781 00:33:56,000 --> 00:33:58,640 Okay, as far as that, yes. 782 00:33:59,280 --> 00:34:01,580 The way the hashing algorithm was 783 00:34:01,580 --> 00:34:03,120 developed to do the code classes 784 00:34:03,580 --> 00:34:05,400 or do the operand classes 785 00:34:05,400 --> 00:34:07,460 it's an automatic system that 786 00:34:07,460 --> 00:34:09,520 regardless of what your disassembler fits out 787 00:34:09,520 --> 00:34:11,520 spits out, it will be able to do 788 00:34:11,520 --> 00:34:13,260 that sort of analysis and it will be able to match 789 00:34:13,680 --> 00:34:15,400 the moves, adds, and what nots. 790 00:34:15,780 --> 00:34:16,300 Unfortunately 791 00:34:18,100 --> 00:34:19,720 different architectures have some 792 00:34:19,720 --> 00:34:21,660 major differences in the way 793 00:34:21,780 --> 00:34:22,840 their code is actually generated. 794 00:34:23,280 --> 00:34:24,220 For example, 795 00:34:25,320 --> 00:34:27,300 whereas the X86 architecture 796 00:34:27,300 --> 00:34:29,020 is a stack based architecture, 797 00:34:29,560 --> 00:34:31,940 memory to memory instruction architectures 798 00:34:31,940 --> 00:34:33,300 something like 799 00:34:33,300 --> 00:34:35,560 maybe a power PC type 800 00:34:35,560 --> 00:34:37,580 architecture, the code that's going to be generated 801 00:34:37,580 --> 00:34:39,720 is probably going to look quite a bit different. 802 00:34:40,880 --> 00:34:41,400 However, 803 00:34:41,600 --> 00:34:43,540 the kind of corollary to that is that there are 804 00:34:43,540 --> 00:34:45,220 a number of systems out there now 805 00:34:45,580 --> 00:34:47,900 which are including virtual machines 806 00:34:47,900 --> 00:34:49,520 and trying to do cross 807 00:34:49,520 --> 00:34:50,280 platform development. 808 00:34:51,780 --> 00:34:53,860 By the very nature of trying to develop 809 00:34:53,860 --> 00:34:55,900 code that works on many different architectures 810 00:34:55,900 --> 00:34:57,840 I'm hoping that this technique 811 00:34:57,840 --> 00:34:59,740 will actually improve 812 00:34:59,740 --> 00:35:01,340 its detection of that type of stuff. 813 00:35:01,860 --> 00:35:02,940 Does that answer your question? 814 00:35:03,550 --> 00:35:03,840 Excellent. 815 00:35:08,260 --> 00:35:09,720 Have you seen 816 00:35:09,720 --> 00:35:11,600 much striation in your output 817 00:35:11,600 --> 00:35:13,600 based on the breadth of opcodes used 818 00:35:13,600 --> 00:35:15,160 for different instruction sets or 819 00:35:15,160 --> 00:35:17,620 special purpose opcodes for specific 820 00:35:17,620 --> 00:35:18,340 processors? 821 00:35:19,780 --> 00:35:21,480 Your question is basically 822 00:35:21,780 --> 00:35:23,500 Does it separate out based on 823 00:35:23,500 --> 00:35:25,460 the instruction sets compiled with 824 00:35:25,460 --> 00:35:27,960 and if they're using 825 00:35:27,960 --> 00:35:29,160 anything that like say 826 00:35:29,160 --> 00:35:31,800 the C language won't represent in an opcode? 827 00:35:32,220 --> 00:35:33,420 That's a good question. 828 00:35:34,040 --> 00:35:35,580 No, I haven't looked at that yet. 829 00:35:35,760 --> 00:35:37,660 I haven't quite looked at 830 00:35:37,660 --> 00:35:39,120 a broad spectrum consideration 831 00:35:39,120 --> 00:35:41,220 of a great variation. 832 00:35:42,120 --> 00:35:43,820 The dominant compiler that was 833 00:35:43,820 --> 00:35:45,920 used in this work was GCC 834 00:35:46,740 --> 00:35:47,720 because that's 835 00:35:47,720 --> 00:35:49,840 just what the distributions that I was using. 836 00:35:50,080 --> 00:35:51,700 How well does it hold up against 837 00:35:51,780 --> 00:35:52,580 other platforms? 838 00:35:53,300 --> 00:35:54,200 No clue yet. 839 00:35:54,460 --> 00:35:56,720 That is something that is most certainly on my to-do list 840 00:35:56,720 --> 00:35:59,100 and it kind of relates to not having 841 00:35:59,100 --> 00:36:00,500 the full up production code yet. 842 00:36:01,140 --> 00:36:02,460 That's a direction I'd like to go. 843 00:36:02,580 --> 00:36:03,580 Does that answer your question? 844 00:36:04,120 --> 00:36:04,480 Good. 845 00:36:08,240 --> 00:36:09,680 Well, the question was 846 00:36:09,680 --> 00:36:10,820 for those of you who couldn't hear 847 00:36:10,820 --> 00:36:13,700 he asked how is that helping to clear the tubes? 848 00:36:14,440 --> 00:36:14,740 Well, 849 00:36:14,860 --> 00:36:16,820 you must understand 850 00:36:17,500 --> 00:36:18,480 it's not a truck. 851 00:36:18,660 --> 00:36:20,060 You can't just put anything on it. 852 00:36:21,780 --> 00:36:22,360 You can take a racehorse 853 00:36:22,360 --> 00:36:23,500 and put it through the tubes. 854 00:36:23,760 --> 00:36:25,160 Does that answer your question? 855 00:36:25,920 --> 00:36:26,400 Okay. 856 00:36:26,480 --> 00:36:26,840 Alright. 857 00:36:30,700 --> 00:36:31,980 Question back there. 858 00:36:34,680 --> 00:36:35,280 So 859 00:36:35,280 --> 00:36:37,340 the kind of graph you've shown 860 00:36:37,340 --> 00:36:39,160 the phylogenetic tree 861 00:36:41,720 --> 00:36:43,640 so you would get those 862 00:36:44,340 --> 00:36:45,980 especially the one on the left 863 00:36:45,980 --> 00:36:47,780 with any kind of a hierarchical 864 00:36:48,500 --> 00:36:50,000 clustering scheme, correct? 865 00:36:50,560 --> 00:36:51,160 Yes. 866 00:36:51,780 --> 00:36:53,260 With Huffman clustering you would get that. 867 00:36:53,880 --> 00:36:55,540 Provided that you have the distance. 868 00:36:56,460 --> 00:36:57,540 Same thing applies 869 00:36:57,540 --> 00:36:59,960 to the nearest neighbor 870 00:36:59,960 --> 00:37:00,960 or key nearest neighbor. 871 00:37:01,300 --> 00:37:03,980 Again, provided that you have a distance 872 00:37:04,580 --> 00:37:05,780 you will get 873 00:37:05,780 --> 00:37:07,200 that sort of a picture for 874 00:37:07,200 --> 00:37:08,840 any distance that makes sense. 875 00:37:09,660 --> 00:37:11,860 So now I understand that you're using BLAST 876 00:37:11,860 --> 00:37:13,620 as a means of 877 00:37:13,620 --> 00:37:15,100 obtaining that distance 878 00:37:15,620 --> 00:37:17,700 between two stretches of code 879 00:37:17,700 --> 00:37:19,560 between two passages of code, right? 880 00:37:19,760 --> 00:37:20,020 Yes. 881 00:37:21,780 --> 00:37:22,760 According to your 882 00:37:25,160 --> 00:37:25,920 bitwise 883 00:37:25,920 --> 00:37:26,740 sorry 884 00:37:27,460 --> 00:37:29,160 opcode compression classes, right? 885 00:37:29,560 --> 00:37:29,580 Yeah. 886 00:37:29,920 --> 00:37:31,700 So these being your features. 887 00:37:31,960 --> 00:37:35,120 But have you tried simpler distances 888 00:37:35,500 --> 00:37:35,880 perhaps? 889 00:37:36,220 --> 00:37:37,620 Something like 890 00:37:37,620 --> 00:37:41,240 a naive 891 00:37:41,780 --> 00:37:43,260 Markov first order model 892 00:37:43,780 --> 00:37:45,540 this opcode predicting 893 00:37:45,540 --> 00:37:46,740 the next opcode 894 00:37:46,740 --> 00:37:49,400 that's a lot less sophisticated than BLAST 895 00:37:49,400 --> 00:37:51,680 but how well would that do? 896 00:37:51,780 --> 00:37:53,220 Well that's a good question. 897 00:37:53,340 --> 00:37:55,200 Wouldn't that produce the same kind of thing 898 00:37:55,200 --> 00:37:57,620 or would that be all over the place? 899 00:37:58,840 --> 00:37:59,940 Honestly, I don't know. 900 00:38:00,700 --> 00:38:01,620 It's a way 901 00:38:01,620 --> 00:38:03,380 actually in the 902 00:38:03,380 --> 00:38:05,220 number of presentations that I've given 903 00:38:05,780 --> 00:38:06,900 kind of leading up to this 904 00:38:07,880 --> 00:38:08,860 black hat presentation 905 00:38:08,860 --> 00:38:11,720 that has been something that has come up a number of times 906 00:38:12,340 --> 00:38:12,800 and 907 00:38:13,900 --> 00:38:15,340 I have no answer. 908 00:38:15,440 --> 00:38:17,340 I've not actually pursued that particular 909 00:38:18,140 --> 00:38:18,760 sort of 910 00:38:19,840 --> 00:38:20,960 not sidetracked but 911 00:38:21,780 --> 00:38:22,540 parallel to this research 912 00:38:22,540 --> 00:38:25,000 does a simpler model 913 00:38:25,000 --> 00:38:26,560 actually produce the same results? 914 00:38:26,860 --> 00:38:29,160 Well what I'm proposing here is that 915 00:38:29,160 --> 00:38:30,820 we step back and take 916 00:38:30,820 --> 00:38:33,080 a wider view at this 917 00:38:33,960 --> 00:38:34,560 formalism 918 00:38:34,560 --> 00:38:36,020 and what this really 919 00:38:36,020 --> 00:38:38,380 what this formalism really means 920 00:38:38,380 --> 00:38:40,760 is that you are defining a distance 921 00:38:41,440 --> 00:38:43,200 between two stretches of code. 922 00:38:43,460 --> 00:38:45,580 BLAST does not have to be that distance. 923 00:38:45,900 --> 00:38:47,200 It can be something 924 00:38:47,980 --> 00:38:48,940 based on 925 00:38:49,720 --> 00:38:50,920 naive Markov, 926 00:38:51,780 --> 00:38:52,720 hidden Markov modeling 927 00:38:52,720 --> 00:38:54,080 and so on and so forth. 928 00:38:54,280 --> 00:38:54,720 Okay. 929 00:38:56,460 --> 00:38:59,220 It's not like BLAST is 930 00:38:59,520 --> 00:39:01,540 so it would be really interesting to see 931 00:39:01,540 --> 00:39:03,820 whether code is like the genome 932 00:39:04,680 --> 00:39:05,480 or maybe 933 00:39:05,480 --> 00:39:07,360 code is somewhat different from the genome 934 00:39:07,360 --> 00:39:09,540 and a different distance would give you a better measure. 935 00:39:10,020 --> 00:39:10,580 Right? 936 00:39:10,780 --> 00:39:12,580 That is an excellent question. 937 00:39:12,760 --> 00:39:14,660 Actually, while you were 938 00:39:16,520 --> 00:39:17,700 presenting your question 939 00:39:17,700 --> 00:39:18,900 I came up with 940 00:39:18,900 --> 00:39:21,420 kind of some related research that I've gone over. 941 00:39:21,780 --> 00:39:23,580 I'm not the only one who has 942 00:39:23,580 --> 00:39:25,480 I'm not the only one who's been 943 00:39:25,480 --> 00:39:26,960 considering trying to do this sort of 944 00:39:27,690 --> 00:39:28,980 nearest neighbor type analysis. 945 00:39:29,560 --> 00:39:30,700 And actually 946 00:39:31,500 --> 00:39:33,580 there's two people out of 947 00:39:33,580 --> 00:39:34,300 I think Italy, 948 00:39:34,760 --> 00:39:36,860 Ero Carrera and 949 00:39:36,860 --> 00:39:39,300 I unfortunately can't say his colleagues 950 00:39:39,300 --> 00:39:40,280 name just 951 00:39:41,840 --> 00:39:43,340 my language skills 952 00:39:43,340 --> 00:39:45,320 are not sufficient to be able to do all that. 953 00:39:45,460 --> 00:39:47,800 So Ero Carrera and others 954 00:39:47,800 --> 00:39:49,660 had a paper back in 2004 955 00:39:49,660 --> 00:39:51,140 it was digital genome mapping 956 00:39:51,780 --> 00:39:53,420 where they used a slightly different measure 957 00:39:53,420 --> 00:39:54,520 for determining the distance. 958 00:39:55,240 --> 00:39:56,480 And it showed again 959 00:39:56,480 --> 00:39:58,660 it was not the same 960 00:39:58,660 --> 00:40:00,880 but they were able to get the same sort of graphs. 961 00:40:01,240 --> 00:40:02,400 So you could get 962 00:40:03,840 --> 00:40:05,560 mutual information between bytes 963 00:40:05,560 --> 00:40:07,580 at different distances, right? 964 00:40:08,160 --> 00:40:08,240 Yes. 965 00:40:08,820 --> 00:40:10,700 I think this is what they used. 966 00:40:11,340 --> 00:40:13,320 I think this is the sort of thing that they used. 967 00:40:13,440 --> 00:40:14,660 You could use 968 00:40:17,020 --> 00:40:18,620 we can take this offline. 969 00:40:18,980 --> 00:40:19,780 Okay, excellent. 970 00:40:21,780 --> 00:40:23,700 Yeah, it was a great idea to use BLAST 971 00:40:23,700 --> 00:40:24,020 in it. 972 00:40:24,700 --> 00:40:27,360 It was kind of the underlying approach 973 00:40:27,360 --> 00:40:29,640 was alright, well we've got a similar 974 00:40:29,640 --> 00:40:31,580 problem. What tools work for that 975 00:40:31,580 --> 00:40:33,740 similar problem? Well hey, here's sort of 976 00:40:33,740 --> 00:40:35,540 the Swiss Army knife. Does it work here? 977 00:40:35,680 --> 00:40:37,620 Yeah, it does. Well how far can we 978 00:40:37,620 --> 00:40:38,360 extend that analogy? 979 00:40:39,660 --> 00:40:41,420 But you do bring up a good point. 980 00:40:42,140 --> 00:40:43,500 This sort of research 981 00:40:43,500 --> 00:40:45,680 would probably benefit from a sort of cross analysis 982 00:40:45,680 --> 00:40:47,700 to other sorts of distance measures. 983 00:40:48,380 --> 00:40:49,640 Because is this 984 00:40:49,640 --> 00:40:51,320 the only way to develop a distance measure? No. 985 00:40:52,220 --> 00:40:53,400 It's just the one that I've 986 00:40:53,400 --> 00:40:55,840 kind of been looking at for now. So thank you for your question. 987 00:40:55,960 --> 00:40:56,220 Thank you. 988 00:40:58,120 --> 00:40:58,980 Any other questions? 989 00:41:01,480 --> 00:41:01,800 Alright, 990 00:41:01,880 --> 00:41:03,420 again, thank you. You've been a great audience. 991 00:41:03,620 --> 00:41:05,340 I appreciate your time and 992 00:41:05,340 --> 00:41:06,160 thanks much.