1 00:00:30,140 --> 00:00:59,980 Thank you for watching. 2 00:01:00,000 --> 00:01:29,420 Thank you for watching. 3 00:01:42,040 --> 00:01:59,040 Thank you for watching. 4 00:02:00,000 --> 00:02:19,060 Thank you for watching. 5 00:02:32,260 --> 00:02:34,260 Now, most of these systems 6 00:02:34,260 --> 00:02:37,460 here, at least for 7 00:02:37,460 --> 00:02:41,520 today, they're based on signature analysis. 8 00:02:41,960 --> 00:02:45,600 Quite similar to virus scanning technology from 9 00:02:45,600 --> 00:02:49,900 years ago. So they rely on hard-coded 10 00:02:49,900 --> 00:02:53,340 databases that they query for 11 00:02:54,080 --> 00:02:55,320 suspicious patterns. 12 00:02:56,040 --> 00:02:59,160 So, you know, if they see a 13 00:02:59,160 --> 00:03:03,260 an IDS vendor will perform an attack, 14 00:03:04,160 --> 00:03:07,580 log that attack on the wire, and see if they can come up with 15 00:03:07,580 --> 00:03:11,720 a mechanism so that they will be able to identify it at any time. 16 00:03:14,360 --> 00:03:15,640 Some of the drawbacks of this 17 00:03:15,640 --> 00:03:18,560 system is that they require quite frequent updates. 18 00:03:18,940 --> 00:03:23,180 As you can imagine, I mean, splices are written every five minutes, right? 19 00:03:23,340 --> 00:03:27,060 So, you know, you've got to update these things, 20 00:03:27,240 --> 00:03:29,060 keep them current, and that's kind of 21 00:03:29,160 --> 00:03:33,280 an ongoing battle. You know, whenever something comes across bug track, 22 00:03:33,500 --> 00:03:37,900 someone's got to go and, you know, identify whether or not this vulnerability 23 00:03:37,900 --> 00:03:42,880 is actually, you know, real, and then generate some kind of signature for it. 24 00:03:43,880 --> 00:03:48,400 These systems analyze data on the wire in a serial fashion. So, I mean, from 25 00:03:48,400 --> 00:03:50,740 beginning to end, and try and match it against known systems. 26 00:03:56,520 --> 00:03:57,340 Some other 27 00:04:00,820 --> 00:04:04,060 probable ways that they could go about it is protocol analysis. 28 00:04:04,900 --> 00:04:08,160 Now, you've got your intrusion detection system, and it's going to go, 29 00:04:08,260 --> 00:04:13,260 okay, hey, this is my web server. It should only be performing a certain 30 00:04:13,260 --> 00:04:17,140 amount of functions, right? So, when I see my web server, like, connecting back to 31 00:04:17,140 --> 00:04:21,720 the client, you know, that might be something suspicious, right? Depending on, 32 00:04:21,760 --> 00:04:27,740 like, their particular configuration and whatever, right? So, that would be a bad thing. 33 00:04:29,940 --> 00:04:34,580 Also, some things on the horizon appear to be statistical analysis intrusion 34 00:04:34,580 --> 00:04:40,240 detection systems. Now, these systems are primarily engineered with the 35 00:04:40,240 --> 00:04:45,420 assumption that network data over a long period of time is self-similar. And 36 00:04:45,420 --> 00:04:50,100 what that means is that, you know, a finite sample of, like, a week-long worth 37 00:04:50,100 --> 00:04:58,560 of, like, traffic patterns can be extrapolated to, like, you know, an entire year, and it should be 38 00:04:58,560 --> 00:04:59,140 fairly similar. 39 00:04:59,160 --> 00:05:04,380 So, if these systems get going and you're able to identify good traffic throughout the 40 00:05:04,380 --> 00:05:12,460 entire thing or process, in the long run, they should be able to identify any statistical 41 00:05:12,460 --> 00:05:17,000 anomalies based on that baseline. Now, these things are under development, and I really 42 00:05:17,000 --> 00:05:23,640 don't know any IDS vendor that really has something of that kind of quality or what-have-you. 43 00:05:29,720 --> 00:05:38,680 Some of the invasion techniques that are currently employed by people are primarily on the network layer. 44 00:05:39,000 --> 00:05:44,860 Now, this would entail stuff like IP fragmentation to confuse the intrusion detection system as to what 45 00:05:44,860 --> 00:05:52,260 the traffic is going to end up looking like when it arrives at the destination host, as many hosts 46 00:05:52,260 --> 00:05:58,480 reassemble fragments in, you know, various manners, and they might overlap in certain ways. So, 47 00:05:59,640 --> 00:06:04,960 you know, some of the ways to defeat these systems in the past has been just to, like, overlap your packets or 48 00:06:04,960 --> 00:06:10,200 send them out of order, or do what-have-you. A lot of these IDSs, some of them don't even look at 49 00:06:10,600 --> 00:06:14,140 fragmented packets, so that was always like a really good way to get around them. 50 00:06:16,400 --> 00:06:18,120 Oh, sorry. Excuse me. 51 00:06:23,860 --> 00:06:25,620 I'm okay. I got a couple here. 52 00:06:25,820 --> 00:06:26,060 Male Speaker 5. 53 00:06:26,060 --> 00:06:26,260 Male Speaker 6. 54 00:06:28,120 --> 00:06:28,640 Male Speaker 7. 55 00:06:28,640 --> 00:06:28,680 Male Speaker 8. 56 00:06:28,680 --> 00:06:28,960 Male Speaker 10. 57 00:06:28,960 --> 00:06:29,140 Male Speaker 12. 58 00:06:29,160 --> 00:06:35,700 on. Now another invasion technique would probably be something like spoof data, right? Like 59 00:06:35,700 --> 00:06:40,220 if I don't want the IDS sensor to know where I'm coming from, you know, that sure does 60 00:06:40,220 --> 00:06:46,480 aid. Sure, they might see what I'm doing and pick up the data, but it doesn't really matter 61 00:06:46,480 --> 00:06:50,400 if they can't tell where I was coming from, I suppose, right? I mean, that helps out in 62 00:06:50,400 --> 00:06:55,900 certain ways. And also, you could spoof the origin from some ignored host, like a DNS 63 00:06:55,900 --> 00:07:00,900 server or something like that that might have some special properties within the engine 64 00:07:00,900 --> 00:07:04,900 of the IDS, right? So it goes, oh, if there's some traffic from this host, let's just ignore 65 00:07:04,900 --> 00:07:10,200 it because it's so chatty. Some other things that we've got here that have been explored 66 00:07:10,640 --> 00:07:17,260 quite heavily is on the application layer. And this primarily is in the realm of data 67 00:07:17,260 --> 00:07:22,040 obfuscation. And what we're talking about here is, you know, with something like Unicode, 68 00:07:22,180 --> 00:07:25,880 there might be like a half billion ways to print the letter A to the screen. And there 69 00:07:25,900 --> 00:07:30,460 right? So if your exploit depends on the fact that you've got to have an A there, and 70 00:07:30,460 --> 00:07:35,120 the IDS is just kind of geared towards an ASCII character set, which is kind of like 71 00:07:35,120 --> 00:07:41,160 a subset of Unicode anyhow, it might miss some kind of like more advanced encoding mechanisms 72 00:07:41,160 --> 00:07:48,040 that you might use. So again, this is another problem of the IDS, right? I mean, they've 73 00:07:48,040 --> 00:07:55,880 got to account for, you know, God knows what the end system of the attack is going to be. 74 00:07:55,900 --> 00:07:59,580 What is the attack going to do with this data? Does it support Unicode? Is this Unicode? 75 00:07:59,860 --> 00:08:04,940 Or is it just going to interpret it in a different manner? So these are really hard things for 76 00:08:04,940 --> 00:08:11,980 the IDS to kind of understand. You can use things like alternate character sets or what 77 00:08:11,980 --> 00:08:18,520 have you, kind of along the same lines as that. And another technique that you could 78 00:08:18,520 --> 00:08:24,900 possibly use is data encoding on the application layer. And that's pretty much what this particular 79 00:08:24,900 --> 00:08:25,880 utility is doing. 80 00:08:25,900 --> 00:08:34,580 It's all about, you know, we're going to encode the data in a way that every execution 81 00:08:35,190 --> 00:08:42,240 of it coming across the screen is going to be unique. So in essence, your exploits are 82 00:08:42,240 --> 00:08:48,120 always going to be zero-day regardless of signatures, right? Because the signatures 83 00:08:48,120 --> 00:08:54,580 are designed to analyze a specific code and, you know, they're only good once they can 84 00:08:54,580 --> 00:08:55,480 get it into the database. 85 00:08:55,480 --> 00:09:00,840 But if you're able to have new codes every time being generated on the wire, then, I 86 00:09:00,840 --> 00:09:04,620 mean, it seems reasonable that they won't be able to detect it. 87 00:09:10,360 --> 00:09:16,420 Essentially, what this utility is going to do is work with buffer overflow exploits, 88 00:09:16,500 --> 00:09:22,860 and it can possibly be adapted to format strings, any kind of shellcode or binary executing 89 00:09:22,860 --> 00:09:24,680 stuff that you're going to send across the wire. 90 00:09:24,980 --> 00:09:25,460 It's a good thing, though, that the utility's not going to be able to generate an entire 91 00:09:25,480 --> 00:09:26,960 it should probably be able to help you out with. 92 00:09:28,640 --> 00:09:31,320 I assume that most people have a fairly good understanding 93 00:09:31,320 --> 00:09:34,980 of buffer overflows and there are weekly talks on this, 94 00:09:35,160 --> 00:09:39,660 so you can just, I hope that you guys have at least 95 00:09:39,660 --> 00:09:40,820 read a paper or something. 96 00:09:41,200 --> 00:09:44,960 Now, you've got this beast that we all call shellcode, 97 00:09:45,180 --> 00:09:47,220 which is essentially the arbitrary commands 98 00:09:47,220 --> 00:09:49,220 that we're gonna be sending to the target system. 99 00:09:49,640 --> 00:09:52,000 So the shellcode is encoded prior to the launch. 100 00:09:52,800 --> 00:09:54,540 Each encoding, therefore, is unique, 101 00:09:54,540 --> 00:09:57,860 and we're able to bypass signatures. 102 00:10:00,060 --> 00:10:03,620 The decoder, what we have to do is once we encode 103 00:10:03,620 --> 00:10:06,120 the shellcode, obviously, it isn't gonna function 104 00:10:06,120 --> 00:10:07,820 when it lands on the target system, right? 105 00:10:07,900 --> 00:10:11,340 So we have to prepend that with a decoder. 106 00:10:11,660 --> 00:10:16,160 Now, this decoder itself will process the data 107 00:10:16,160 --> 00:10:17,960 after it appears on the target host. 108 00:10:18,300 --> 00:10:22,680 So, unfortunately, a lot of exploits are written 109 00:10:22,680 --> 00:10:23,960 so that when you jump from 110 00:10:23,960 --> 00:10:24,240 the, 111 00:10:24,880 --> 00:10:27,620 into the NOPS section, you know, hopefully, 112 00:10:27,760 --> 00:10:30,780 they wrote it good enough so they're jumping fairly close 113 00:10:30,780 --> 00:10:31,900 to the beginning of these NOPs, 114 00:10:32,080 --> 00:10:34,660 and not just like right at the end, 115 00:10:34,720 --> 00:10:36,040 and they just kind of coded it, and it worked, 116 00:10:36,080 --> 00:10:37,420 and they said, okay, killer, there we go. 117 00:10:38,680 --> 00:10:42,540 Because, you know, we're gonna eat up a small portion 118 00:10:42,540 --> 00:10:44,520 of those available NOPs. 119 00:10:45,300 --> 00:10:47,200 So your shellcode is effectively like, 120 00:10:47,220 --> 00:10:48,320 you know, increased in size. 121 00:10:49,900 --> 00:10:51,840 So, I mean, even if the network intrusion detection 122 00:10:51,840 --> 00:10:54,520 system were on the host that was being exploited, you know, 123 00:10:54,540 --> 00:10:57,560 exploited, it would not be able to detect anything because this is all happening on 124 00:10:57,560 --> 00:11:04,800 the application layer. And again, signature analysis, you know, it should be able to ‑‑ 125 00:11:05,210 --> 00:11:10,720 should be unable to match the shellcode or the decoder or the return addresses that are 126 00:11:10,720 --> 00:11:15,700 normally placed at the tail end of your buffer overflow. This is because I incorporated a 127 00:11:15,700 --> 00:11:21,720 number of primitives to modulate the return addresses based on your tolerances and stuff 128 00:11:21,720 --> 00:11:29,940 like that. The decoder itself also is in a polymorphic form. Now, polymorphic is essentially 129 00:11:29,940 --> 00:11:37,320 the ability to exist in multiple forms and be functionally identical. So, you know, we'll 130 00:11:37,320 --> 00:11:42,880 go into that a bit later on. Oh, by the way, I mean, anybody feel free to pop up and ask 131 00:11:42,880 --> 00:11:45,820 some questions. You know, I love interactive crowds. 132 00:11:46,320 --> 00:11:48,180 What would be the best decoder? 133 00:11:48,700 --> 00:11:50,680 It's extremely polymorphic, you know. 134 00:11:50,840 --> 00:11:51,700 In the simple way that it is. 135 00:11:54,840 --> 00:11:59,920 Well, currently, I only support one decoder because the encoder is in C and it's in the 136 00:11:59,920 --> 00:12:04,960 API and it encodes it and sends it out. And I've just been concentrating on making it 137 00:12:04,960 --> 00:12:10,480 cross-platform rather than adding, like, you know, tons and tons of bells and whistles 138 00:12:10,480 --> 00:12:13,820 to the decoder right now. So I'm trying to get it across the platform. 139 00:12:14,100 --> 00:12:16,540 It is polymorphic, but that's one variation currently? 140 00:12:16,540 --> 00:12:18,800 Well, you'll see. 141 00:12:20,840 --> 00:12:22,940 You're a fucking guy. 142 00:12:23,320 --> 00:12:26,760 Are you going to tell me that you don't have, like, an intelligent decoder based on genetic 143 00:12:26,760 --> 00:12:29,240 algorithms which actually adapt to any execution environment? 144 00:12:29,640 --> 00:12:34,620 Actually, I just added, the question was whether or not I have genetic algorithms 145 00:12:34,620 --> 00:12:42,420 based on, to detect, you know, to breed new decoders which are able to survive in the wild, 146 00:12:43,240 --> 00:12:43,720 right? 147 00:12:44,540 --> 00:12:45,400 Not currently. 148 00:12:45,440 --> 00:12:46,520 You know, this is on the horizon. 149 00:12:47,420 --> 00:12:52,020 Well, this is just the public version, Joey. I mean, come on, okay? 150 00:12:55,340 --> 00:12:56,540 I think we had another question. 151 00:12:56,820 --> 00:12:59,060 How many bytes of Knopsled do you take out? 152 00:12:59,620 --> 00:13:04,820 You can configure that to your particular tolerances, right? So if you've got a 153 00:13:04,820 --> 00:13:10,980 splite that you've only got, like, you know, 200 bytes worth of Knopsled, you can configure 154 00:13:10,980 --> 00:13:15,060 the decoder to, you know, fine-tune how it behaves. 155 00:13:16,540 --> 00:13:20,960 And, you know, I've had decoders as small as, like, you know, 40 bytes and as large 156 00:13:20,960 --> 00:13:21,420 as 400. 157 00:13:21,760 --> 00:13:24,180 So it's fairly, pretty much up to you. 158 00:13:25,800 --> 00:13:26,280 Yes? 159 00:13:26,940 --> 00:13:28,620 Oh, really? 160 00:13:29,520 --> 00:13:31,320 You made me skip my slide, man. 161 00:13:32,960 --> 00:13:33,920 Real men don't. 162 00:13:34,000 --> 00:13:34,700 You know that you don't. 163 00:13:34,840 --> 00:13:35,900 I don't use Knops. 164 00:13:36,100 --> 00:13:36,620 There you go. 165 00:13:37,400 --> 00:13:43,200 Now, the attack payload of a buffer overflow, just a brief overview, typically 166 00:13:43,200 --> 00:13:45,800 consists of these three sections which we've got to... 167 00:13:46,560 --> 00:13:48,320 You know, take a look at. 168 00:13:48,500 --> 00:13:51,100 We've got this Knopsled, which is the initial portion. 169 00:13:51,380 --> 00:13:53,280 We've got the shellcode in the middle. 170 00:13:53,360 --> 00:13:58,760 And we've got these jumps at the back, you know, doing your framer register overwrites 171 00:13:58,760 --> 00:14:04,020 or whatever the hell you're doing that will point back into the Knops somehow. 172 00:14:05,880 --> 00:14:11,740 Now these three individual sections are what the IDSs will, you know, be focusing on, you 173 00:14:11,740 --> 00:14:12,640 know, one of these three. 174 00:14:13,660 --> 00:14:15,500 That was the Canadian beat. 175 00:14:18,320 --> 00:14:21,920 Also format strings again, and we can adopt this for their use later on. 176 00:14:23,080 --> 00:14:23,980 Knop substitutions. 177 00:14:26,480 --> 00:14:32,780 Currently the Knop instructions at the beginning of the shellcode are substituted. 178 00:14:32,860 --> 00:14:38,460 Now we've got an extensible list of possible replacements that can comply to whatever restrictions 179 00:14:38,460 --> 00:14:41,460 that your particular code needs to adhere to. 180 00:14:43,920 --> 00:14:44,860 For instance. 181 00:14:45,500 --> 00:14:49,580 Let's say I need two upper compliant code, two lower compliant in space, or I've got 182 00:14:49,580 --> 00:14:52,820 various band characters which can't appear in the generated shellcode. 183 00:14:53,100 --> 00:14:55,820 This API will automatically generate that for you. 184 00:14:56,140 --> 00:14:58,160 So if you've got... 185 00:14:58,860 --> 00:15:03,080 If you don't really have any skills to, like, write that code yourself and you just want 186 00:15:03,080 --> 00:15:10,900 to cut and paste, you know, you can try and see if it can identify a sequence that will 187 00:15:10,900 --> 00:15:11,840 generate the code for you. 188 00:15:11,960 --> 00:15:14,900 But the more restrictions you place on the encodings. 189 00:15:14,900 --> 00:15:20,880 The more encoded shellcode, the, you know, obviously the less permutations you can actually 190 00:15:20,880 --> 00:15:21,220 form. 191 00:15:21,480 --> 00:15:21,840 Right? 192 00:15:21,960 --> 00:15:27,360 I mean, I've had, you know, anywhere from three and a half billion possible shellcodes 193 00:15:27,360 --> 00:15:32,780 or, you know, packets to send to, you know, 50, right? 194 00:15:32,860 --> 00:15:36,400 Just because of certain restrictions in the exploit. 195 00:15:39,360 --> 00:15:43,020 This note is primarily for Intel, the Intel architecture. 196 00:15:43,420 --> 00:15:43,980 Okay. 197 00:15:44,900 --> 00:15:49,080 So, traditionally, guys coding Intel stuff don't really have to worry about the alignment, 198 00:15:49,620 --> 00:15:52,480 which is, like, where you're going to jump into the nops. 199 00:15:52,820 --> 00:16:01,260 So if you're jumping in there and traditionally it's only a one byte nop instruction, if we 200 00:16:01,260 --> 00:16:09,380 enable, like, multi-byte, you know, instructions to be in that section of the shellcode, you 201 00:16:09,380 --> 00:16:12,280 know, there's the possibility that you're going to jump into the middle of an instruction 202 00:16:12,280 --> 00:16:14,880 and not going to be able to execute in the way that you're going to be able to execute. 203 00:16:14,880 --> 00:16:15,740 In the way that you normally would. 204 00:16:16,220 --> 00:16:22,420 So, but, I mean, I would encourage the use of multi-byte nops because, I mean, this greatly 205 00:16:22,420 --> 00:16:27,640 increases the, you know, the amount of codes that will appear within that section. 206 00:16:27,920 --> 00:16:30,920 I think I've got about 28 right now. 207 00:16:31,340 --> 00:16:34,420 So that's 28 out of a possible 255. 208 00:16:34,600 --> 00:16:40,540 So like a little better than 10% of, you know, character space will be available in that 209 00:16:40,540 --> 00:16:40,980 nop section. 210 00:16:43,140 --> 00:16:44,520 You know, I've heard. 211 00:16:44,580 --> 00:16:44,860 Okay. 212 00:16:44,880 --> 00:16:52,160 From statistics, you know, degree guys, that, you know, this really isn't quite what you 213 00:16:52,160 --> 00:16:56,180 need to have to be statistically resilient to analysis. 214 00:16:56,700 --> 00:17:03,340 So if you enable these multi-byte, you know, features, that will allow you to have virtually 215 00:17:03,340 --> 00:17:06,060 limitless amount of characters appearing within that nop slide. 216 00:17:09,500 --> 00:17:10,100 Okay. 217 00:17:10,340 --> 00:17:11,960 Now, Joy? 218 00:17:13,080 --> 00:17:14,740 I haven't seen any IDS. 219 00:17:14,740 --> 00:17:14,860 Okay. 220 00:17:14,860 --> 00:17:19,240 Any IDS which can actually decipher bytecode encodings to actually see if it's actually 221 00:17:19,240 --> 00:17:19,700 . 222 00:17:20,380 --> 00:17:25,480 I mean, I'm trying to say, like, is there any IDS which is, like, not plain, basic, 223 00:17:25,520 --> 00:17:25,800 stupid? 224 00:17:26,280 --> 00:17:26,720 No. 225 00:17:26,840 --> 00:17:27,400 They're all pretty dumb. 226 00:17:27,620 --> 00:17:35,080 Like, they don't really have the current ability to analyze the instructions right now and 227 00:17:35,080 --> 00:17:39,800 see exactly what they're doing or the data, per se, that I have seen. 228 00:17:40,120 --> 00:17:44,840 Oh, the question was if I have seen any IDSs out there which can actually intelligence. 229 00:17:44,860 --> 00:17:44,880 Yeah. 230 00:17:44,880 --> 00:17:48,680 And, you know, intelligently analyze the data sections of these attacks and actually kind 231 00:17:48,680 --> 00:17:52,460 of understand what they're doing, kind of, you know, maybe similar to some virus scanner 232 00:17:52,460 --> 00:17:57,980 stuff which can actually analyze the data within, like, you know, applications or what 233 00:17:57,980 --> 00:18:02,400 have you and identify a polymorphic attack or identify some kind of virus signature. 234 00:18:03,780 --> 00:18:09,780 Now, the basic assumption that we've got to make is that there's always more than one 235 00:18:09,780 --> 00:18:12,260 way to do it, especially in computer science, right? 236 00:18:12,460 --> 00:18:14,020 I mean, you know. 237 00:18:14,020 --> 00:18:18,080 How many ways can you, like, get that X equivalence there, right? 238 00:18:18,620 --> 00:18:22,320 You know, there's three right there, but I bet you there's, like, at least several billion 239 00:18:22,320 --> 00:18:23,700 more that you can probably do. 240 00:18:24,560 --> 00:18:32,000 So, you know, we're going to embed that into our decoder so that it will be, you know, 241 00:18:32,000 --> 00:18:38,020 stronger, you know, more able to withstand signature analysis, right? 242 00:18:38,560 --> 00:18:44,000 So I mean, if I needed to calculate pi or I needed to calculate X there, I could, you 243 00:18:44,000 --> 00:18:48,720 know, alternatively select, you know, one of these mechanisms, you know, the decoder 244 00:18:48,720 --> 00:18:49,020 itself. 245 00:18:49,440 --> 00:18:51,580 The decoder itself, it isn't just one decoder. 246 00:18:52,140 --> 00:18:57,880 It's like a decoder with, like, a tree kind of system that can alternatively select which 247 00:18:57,880 --> 00:18:59,940 way it's going, you know, on a random basis. 248 00:19:00,240 --> 00:19:05,760 And you can extend that if you feel that you found another way to, like, add one to a register. 249 00:19:05,980 --> 00:19:10,240 You can just kind of, like, add that instruction in there and, you know, it can do that. 250 00:19:12,000 --> 00:19:13,720 There are also alternate instructions. 251 00:19:13,740 --> 00:19:13,980 There are also alternate instructions. 252 00:19:14,000 --> 00:19:14,060 There are alternate paths. 253 00:19:14,760 --> 00:19:22,300 So that, you know, if we need to calculate N, we can use, you know, various values that 254 00:19:22,300 --> 00:19:24,420 we have also to calculate that. 255 00:19:25,520 --> 00:19:28,280 There's a read me with the distribution. 256 00:19:28,820 --> 00:19:32,920 If you read the read me, it goes into, like, a little bit more technical details of exactly 257 00:19:32,920 --> 00:19:33,660 what's going on. 258 00:19:33,880 --> 00:19:38,040 And, of course, you can always just kind of read the source that will tell you exactly 259 00:19:38,040 --> 00:19:38,660 what's going on. 260 00:19:41,360 --> 00:19:43,660 I clicked already, but this thing's kind of lagged out. 261 00:19:44,440 --> 00:19:46,540 But, non-operational code padding. 262 00:19:46,840 --> 00:19:52,900 This is the euphemism that I use to identify this expansion here. 263 00:19:53,360 --> 00:20:00,000 You see L plus A plus M equals E. But, I mean, that's functionally equivalent to, like, 264 00:20:00,000 --> 00:20:05,800 L plus, like, you know, bracket one plus one minus two plus A, you know, all this other 265 00:20:05,800 --> 00:20:09,600 bracket stuff, which, you know, nulls out in the end of the equation and you still wind 266 00:20:09,600 --> 00:20:10,000 up with E. 267 00:20:10,480 --> 00:20:13,560 So, you know, we've got lots of these nulls. 268 00:20:13,560 --> 00:20:13,840 So, you know, we've got lots of these nulls. 269 00:20:13,840 --> 00:20:13,980 So, you know, we've got lots of these nulls. 270 00:20:14,000 --> 00:20:16,280 So, you know, we've got lots of these non-operational padding instructions that will appear in 271 00:20:16,280 --> 00:20:16,420 there. 272 00:20:16,560 --> 00:20:19,940 These are the things that you will tune to your likeness, you know. 273 00:20:20,460 --> 00:20:21,120 I don't know. 274 00:20:21,200 --> 00:20:26,760 On Intel, I've had success with, you know, as much as you want, right? 275 00:20:26,860 --> 00:20:27,460 It's your tolerance. 276 00:20:27,580 --> 00:20:34,180 The more pads that you incorporate, the more space you've got to take up on the knob sled, 277 00:20:34,340 --> 00:20:34,460 right? 278 00:20:34,580 --> 00:20:37,340 So, you've basically got to tune that feature ahead of time. 279 00:20:37,460 --> 00:20:39,700 It's kind of what you were talking about earlier. 280 00:20:42,080 --> 00:20:43,820 Also, this padding is random. 281 00:20:43,820 --> 00:20:47,780 randomly generated based on your specifications 282 00:20:47,780 --> 00:20:49,280 in the API, right? 283 00:20:49,420 --> 00:20:51,720 Like if you say no, again, the same thing. 284 00:20:51,820 --> 00:20:53,600 The two upper, two lower is base kind of stuff 285 00:20:53,600 --> 00:20:54,680 or carriage return, whatever. 286 00:20:55,280 --> 00:20:57,780 You know, you'll ban this stuff in the beginning 287 00:20:57,780 --> 00:21:01,020 and then we'll like add X, X or X, 288 00:21:01,160 --> 00:21:04,160 or like jump nowhere to X location. 289 00:21:04,600 --> 00:21:07,600 Things like that you'll be able to automatically generate. 290 00:21:11,440 --> 00:21:12,520 Man, it's hot here. 291 00:21:14,540 --> 00:21:18,240 Oh yeah, I've got some new functions in this release. 292 00:21:18,840 --> 00:21:22,540 I actually initially released this polymorphic API 293 00:21:22,540 --> 00:21:25,340 at the CanSec conference over in Vancouver. 294 00:21:26,300 --> 00:21:30,780 I guess it's like DerSec also, www.dersec.com. 295 00:21:33,250 --> 00:21:36,240 You can, right now the decoder also can appear 296 00:21:36,240 --> 00:21:41,620 in like a out of order, you know, function. 297 00:21:41,720 --> 00:21:43,780 So, let's see. 298 00:21:43,820 --> 00:21:46,060 So, let's say there's five operations 299 00:21:46,060 --> 00:21:48,880 that you need to have to decode the payload. 300 00:21:50,320 --> 00:21:52,800 What you do ahead of time is kind of like 301 00:21:53,880 --> 00:21:57,520 set up the structure and define like what positions 302 00:21:58,980 --> 00:22:01,520 each instruction can enter into. 303 00:22:02,000 --> 00:22:04,760 In this case, as you can see, one, two, three, four, five, 304 00:22:05,040 --> 00:22:06,760 you know, one, three, two, five, four. 305 00:22:07,800 --> 00:22:09,300 So, you know, if you need to, 306 00:22:09,400 --> 00:22:12,160 so long as you're not altering the algorithm itself, right? 307 00:22:12,160 --> 00:22:15,460 So a lot of instructions can appear in virtually any position. 308 00:22:17,120 --> 00:22:19,140 I also added a weighted nop slide. 309 00:22:19,580 --> 00:22:26,100 So if you have got like a hard-on for like, you know, printable ASCII characters in your 310 00:22:26,100 --> 00:22:31,140 shellcode, you can like weight those nops to like a certain level. 311 00:22:31,340 --> 00:22:32,340 Hey, hey, quiet. 312 00:22:32,720 --> 00:22:33,620 Quiet up front here. 313 00:22:35,380 --> 00:22:38,600 Yeah, I got a real hard-on for printable ASCII shellcode. 314 00:22:41,220 --> 00:22:48,920 No, so you can say, I don't know, like if you had, if you were attacking something over 315 00:22:49,640 --> 00:22:57,900 like a CGI listening on a web server, right, and, you know, HTTP traffic typically has 316 00:22:57,900 --> 00:23:04,260 a lot of these angle brackets and stuff like that and whatever else, quotes and double 317 00:23:04,260 --> 00:23:07,820 quotes and whatever else, right, HTTP, you know. 318 00:23:07,820 --> 00:23:08,880 Those characters. 319 00:23:09,500 --> 00:23:12,640 You can kind of weight those to whatever values you want. 320 00:23:13,180 --> 00:23:17,880 Also this weighting will increase the variance in the API itself, right. 321 00:23:17,960 --> 00:23:22,840 So if you just kind of go in there and randomly weight everything yourself, that will pretty 322 00:23:22,840 --> 00:23:26,900 much mean that yours is a custom copy, right, and the codes that it generates are going 323 00:23:26,900 --> 00:23:32,100 to be like more tuned to your preferences rather than the default ones. 324 00:23:32,320 --> 00:23:37,160 So I mean if anyone, if any IDS vendor actually does create some kind of method to detect 325 00:23:37,160 --> 00:23:37,560 this. 326 00:23:38,100 --> 00:23:42,760 You should be able to effectively weight everything out and, you know, presumably, 327 00:23:43,520 --> 00:23:46,640 you know, to your liking, it'll still be functional, but. 328 00:23:49,580 --> 00:23:55,160 Again, here, you know, we, there's occasionally the requirement for certain shellcode restrictions 329 00:23:55,160 --> 00:23:57,280 in your attack, right. 330 00:23:57,960 --> 00:24:01,340 So you're going to be going along and you find out that your exploit requires too up 331 00:24:01,340 --> 00:24:04,760 or too low a space or like any special cards banned out of this, right, so you just kind 332 00:24:04,760 --> 00:24:05,960 of define that in the. 333 00:24:07,540 --> 00:24:12,060 In this structure, you say, like, you flip some bits and you say, you know, hey, I want 334 00:24:12,060 --> 00:24:16,340 this code to be too up or resilient or too low or resilient, and it'll go ahead and 335 00:24:16,340 --> 00:24:16,960 do that for you. 336 00:24:17,080 --> 00:24:22,780 If it doesn't, you know, then it'll, it'll tell you. 337 00:24:25,480 --> 00:24:30,300 Currently, right now, I've got a 32-bit key that I use to encode everything and that's 338 00:24:30,300 --> 00:24:35,160 just kind of like applied, you know, against everything one at a time. 339 00:24:35,160 --> 00:24:39,120 I don't chain it or anything like that and, like, re, you know, any kind of crazy stuff. 340 00:24:40,340 --> 00:24:41,820 I feel that that's enough. 341 00:24:42,620 --> 00:24:47,080 It allows you to create a lot of permutations of the shellcode and, I mean, it's really 342 00:24:47,080 --> 00:24:47,780 difficult to detect. 343 00:24:49,880 --> 00:24:55,340 Again, I've got return address modulation, right, so, I mean, if you feel that, yeah, 344 00:24:55,480 --> 00:25:00,240 I don't know, if, I mean, if the IDS vendor has a signature that'll detect against that, 345 00:25:02,060 --> 00:25:04,260 you know, you can enable that and that might help out. 346 00:25:04,740 --> 00:25:05,140 Okay. 347 00:25:05,160 --> 00:25:09,680 What I was thinking about, I was, you know, I was thinking about implementing a sliding 348 00:25:09,680 --> 00:25:15,440 key, so, you know, as you kind of encode each section, the key changes and the variants 349 00:25:15,440 --> 00:25:18,700 get increasingly, you know, you get a lot more variants in your encoded shellcode. 350 00:25:21,340 --> 00:25:27,280 You know, possibly can the sliding key be used to generate normalized shellcode to the 351 00:25:27,280 --> 00:25:28,940 protocol which you're attacking? 352 00:25:29,240 --> 00:25:30,500 You know, possibly, right? 353 00:25:30,600 --> 00:25:33,960 I mean, I'm sure there's a way if you could develop an algorithm that can do that. 354 00:25:33,960 --> 00:25:41,020 You know, you, your decoder might be a little bit bloated or big, you know, I don't really 355 00:25:41,020 --> 00:25:41,320 know. 356 00:25:41,820 --> 00:25:46,320 I haven't put too much effort into that right now, but there's definitely the possibility 357 00:25:46,320 --> 00:25:47,240 in the future, right? 358 00:25:47,520 --> 00:25:51,200 No matter what, there's always a way around, you know, any kind of detection mechanism 359 00:25:51,200 --> 00:25:51,960 that anybody has. 360 00:25:52,580 --> 00:25:54,300 I believe, you have a question back here? 361 00:26:01,380 --> 00:26:02,460 Yeah, exactly, right? 362 00:26:02,540 --> 00:26:03,280 So, yeah. 363 00:26:03,560 --> 00:26:03,940 Okay. 364 00:26:03,960 --> 00:26:11,100 So, the default weight of the members of the, like, decoder or the NOP substitutions, 365 00:26:11,100 --> 00:26:12,400 right, is just one. 366 00:26:13,740 --> 00:26:18,780 You know, you should just go in there and modify that yourself and have your own custom 367 00:26:18,780 --> 00:26:19,120 version. 368 00:26:20,020 --> 00:26:20,380 Yeah? 369 00:26:26,440 --> 00:26:28,160 Well, you know, that's a possibility, right? 370 00:26:28,260 --> 00:26:32,640 You know, it could be a little bit weaker, but I mean, like, if you had a protocol which 371 00:26:32,640 --> 00:26:40,620 had, like, a lot of, like, you know, I don't know, hex 99 bytes in it, you know, you could, 372 00:26:40,660 --> 00:26:44,680 like, weight that replacement a little bit more and it might be normalized compared 373 00:26:44,680 --> 00:26:45,920 to the typical patterns. 374 00:26:48,120 --> 00:26:57,060 The current implementation of this API, of this engine, actually, I created an API for 375 00:26:57,060 --> 00:27:02,800 exploit developers, which is extremely easy to integrate into any exploit. 376 00:27:03,100 --> 00:27:12,260 I mean, I took the LSD SNMP Solaris RPC vulnerability and I made, I just, like, called my three 377 00:27:12,260 --> 00:27:12,720 functions. 378 00:27:13,120 --> 00:27:14,440 I mean, you've got to be a little bit intelligent. 379 00:27:14,440 --> 00:27:18,740 You need to be able to figure out exactly, like, where the boundaries are in the shell 380 00:27:18,740 --> 00:27:19,540 code itself, right? 381 00:27:19,680 --> 00:27:22,420 So, I mean, that isn't really too hard to figure out because, I mean, like, you know, 382 00:27:22,420 --> 00:27:24,900 a few lines above that, they're going to be filling all that stuff in for you. 383 00:27:26,980 --> 00:27:32,100 So, you know, it's really easy to integrate in source form, at least, into any exploitation 384 00:27:33,220 --> 00:27:34,520 scripts that you got, right? 385 00:27:35,020 --> 00:27:38,620 And I've also got a filter application for existing exploits. 386 00:27:38,940 --> 00:27:42,580 Let's say you're a kiddie, you know, and you don't really know how to program anything 387 00:27:43,680 --> 00:27:44,140 at all. 388 00:27:44,200 --> 00:27:44,420 Yeah? 389 00:27:44,420 --> 00:27:50,000 So, you can just pipe the output into this filter and then you're going to have to, you 390 00:27:50,000 --> 00:27:50,800 know, select a few options. 391 00:27:50,960 --> 00:27:55,060 You're going to have to tell the filter, like, okay, the NOP used in this exploit is, like, 392 00:27:55,060 --> 00:27:55,520 hex 90. 393 00:27:56,740 --> 00:28:03,380 There are, and then you're going to have to tell it the return address used in that 394 00:28:03,380 --> 00:28:07,020 particular exploit so it knows when to stop encoding the shell code. 395 00:28:07,320 --> 00:28:10,500 So with those two things, it kind of knows, okay, this is how many NOPs I've got, this 396 00:28:10,500 --> 00:28:14,400 is how much shell code I've got to the boundary of, like, the return addresses and whatever. 397 00:28:14,400 --> 00:28:18,620 We currently support IA32, Spark, and HPPA. 398 00:28:19,620 --> 00:28:26,080 I tried to ‑‑ I actually limited all of these to, like, the most basic instruction 399 00:28:26,080 --> 00:28:26,720 sets possible. 400 00:28:27,000 --> 00:28:31,780 So, like, you know, Spark V8 and HPPA risk 1.1. 401 00:28:32,360 --> 00:28:37,560 Just so, I mean, you're going to have the greatest leverage and, you know, potential 402 00:28:37,560 --> 00:28:39,300 to attack target systems. 403 00:28:39,740 --> 00:28:43,000 I'm sort of planning to do some MIPS, PowerPC, and alpha work. 404 00:28:43,240 --> 00:28:43,920 I'm going to try to do that. 405 00:28:44,900 --> 00:28:45,720 I don't know. 406 00:28:45,800 --> 00:28:48,100 It's kind of up in the air right now. 407 00:28:49,000 --> 00:28:52,420 I haven't really been doing too much work on this lately, but, I mean, if anyone wants 408 00:28:52,420 --> 00:28:58,780 to write their own decoder, all you've really got to do is write a decoder, like, you know, 409 00:28:58,800 --> 00:29:05,060 some assembly that does an XOR decode, right, pretty basic, and that's all you got to do. 410 00:29:08,060 --> 00:29:08,420 Countermeasures. 411 00:29:08,500 --> 00:29:09,420 That was the last slide. 412 00:29:10,300 --> 00:29:11,000 I don't know. 413 00:29:11,980 --> 00:29:13,800 There could potentially be some countermeasures. 414 00:29:13,840 --> 00:29:13,900 I don't know. 415 00:29:13,900 --> 00:29:14,580 There could potentially be some countermeasures for this stuff. 416 00:29:14,780 --> 00:29:21,140 I heard some source fire guys or snort guys talking about some specific demons that they 417 00:29:21,140 --> 00:29:25,960 could monitor on the wire, like, to detect all these patterns and what have you. 418 00:29:26,080 --> 00:29:29,080 But, I mean, I'll believe it when I see it. 419 00:29:29,200 --> 00:29:33,080 So, sorry, guys. 420 00:29:36,680 --> 00:29:37,080 Yeah? 421 00:29:38,160 --> 00:29:39,560 Is there a web page or something? 422 00:29:39,780 --> 00:29:40,180 Yeah. 423 00:29:40,620 --> 00:29:41,020 Yeah. 424 00:29:41,360 --> 00:29:41,760 I... 425 00:29:44,520 --> 00:29:45,340 Who's beepin' out? 426 00:29:45,780 --> 00:29:46,220 Yeah. 427 00:29:46,300 --> 00:29:47,000 K2.ca. 428 00:29:49,480 --> 00:29:51,020 www.ktwo.ca. 429 00:29:51,380 --> 00:29:54,920 Apparently this is an older version of my slide presentation. 430 00:29:55,020 --> 00:29:56,400 I knew you used to have that in there. 431 00:29:57,020 --> 00:29:57,460 Sorry. 432 00:29:58,160 --> 00:29:59,100 This guy over here. 433 00:30:00,020 --> 00:30:02,260 This ugly, ugly guy up here. 434 00:30:02,580 --> 00:30:03,720 Well, what's my name? 435 00:30:04,240 --> 00:30:05,220 What's my name? 436 00:30:05,600 --> 00:30:06,480 That's your question, right. 437 00:30:07,140 --> 00:30:10,780 In an antivirus scene, right... 438 00:30:11,220 --> 00:30:11,740 You know, it comes in due. 439 00:30:11,740 --> 00:30:13,920 self-mutating encryption generators and stuff 440 00:30:13,920 --> 00:30:15,280 have been there for a long time. 441 00:30:15,700 --> 00:30:18,960 But for example, if you're doing an enterprise-wide scan, 442 00:30:19,960 --> 00:30:23,420 and an anti-virus scan taking 30 minutes is not a problem, 443 00:30:23,540 --> 00:30:25,700 but an IDSS is more or less real time. 444 00:30:26,600 --> 00:30:29,400 So there is a practical inherent limitation 445 00:30:30,520 --> 00:30:32,960 in modus operandi when it comes to IDSS 446 00:30:32,960 --> 00:30:33,920 and anti-virus software. 447 00:30:34,360 --> 00:30:36,020 So what I'm trying to say is that the techniques 448 00:30:36,020 --> 00:30:39,360 you present here would have actually a practical limit 449 00:30:39,360 --> 00:30:41,900 when it comes to detection in terms of anti-virus 450 00:30:42,420 --> 00:30:43,640 or IDSS software. 451 00:30:44,200 --> 00:30:45,260 What do you think about that? 452 00:30:48,160 --> 00:30:50,560 Man, I've got some serious power problems over here. 453 00:30:51,820 --> 00:30:52,620 Well, I'm sorry. 454 00:30:54,040 --> 00:30:55,340 I just need to... 455 00:30:55,340 --> 00:30:58,200 You can analyze it, but you can't drop brackets, right? 456 00:30:58,920 --> 00:31:00,120 You can, right? 457 00:31:00,220 --> 00:31:04,460 And I mean, another benefit of exploits in the wild 458 00:31:04,460 --> 00:31:06,940 using this kind of technology is that it's gonna increase 459 00:31:06,940 --> 00:31:09,040 the processing power 460 00:31:09,040 --> 00:31:10,900 to identify what's going on here, right? 461 00:31:11,420 --> 00:31:13,640 And I mean, I've got things like... 462 00:31:13,640 --> 00:31:15,100 Holy Jesus, man. 463 00:31:17,480 --> 00:31:19,660 So I mean, I've got things that like, you know, 464 00:31:19,680 --> 00:31:22,700 there's occasionally the need to exploit something 465 00:31:22,700 --> 00:31:25,260 like hundreds of thousands of times per second 466 00:31:25,260 --> 00:31:26,000 or whatever, right? 467 00:31:26,180 --> 00:31:28,000 Like if you need to brute force an offset 468 00:31:28,000 --> 00:31:30,000 of a respawning daemon or whatever, right, 469 00:31:30,060 --> 00:31:31,940 and you've got only a small window to attack in. 470 00:31:33,660 --> 00:31:36,580 I seed the random number generator 471 00:31:36,980 --> 00:31:38,600 with the current time in seconds. 472 00:31:39,040 --> 00:31:45,760 And then I add to that the add that the current, 473 00:31:45,780 --> 00:31:48,600 your tick register or the lower 32 bits 474 00:31:48,600 --> 00:31:50,000 of your tick register or your CPU. 475 00:31:50,660 --> 00:31:52,700 So I mean, if you've got, you know, 476 00:31:52,740 --> 00:31:57,400 I really don't see any way feasible like at all 477 00:31:57,400 --> 00:32:00,120 that anyone could predict what is gonna come down the pipe 478 00:32:00,120 --> 00:32:01,440 if you're seeding with your tick register 479 00:32:01,440 --> 00:32:03,800 because for one, they're not gonna know your time, 480 00:32:03,880 --> 00:32:07,860 and two, like the interval between at which you're gonna 481 00:32:07,860 --> 00:32:08,820 reenter the function. 482 00:32:08,820 --> 00:32:10,940 And you're gonna grab the tick register 483 00:32:10,940 --> 00:32:12,280 is always gonna be slightly different 484 00:32:12,280 --> 00:32:14,720 on a multi-tasking operating system, right? 485 00:32:14,820 --> 00:32:16,580 So I mean, at one time, it might have taken 486 00:32:16,580 --> 00:32:17,860 like 500,000 cycles. 487 00:32:18,060 --> 00:32:20,800 Another time, it took like, you know, 500,001 cycles, 488 00:32:20,920 --> 00:32:23,300 and that's just enough to like generate something different. 489 00:32:24,860 --> 00:32:25,340 Joy? 490 00:32:25,440 --> 00:32:25,900 I have a question. 491 00:32:27,100 --> 00:32:29,700 Like, stuff like virus and anti, 492 00:32:29,780 --> 00:32:31,620 Dr. Solomon and virus has actually 493 00:32:31,620 --> 00:32:34,460 raised these issues in terms of anti-virus in the past. 494 00:32:34,780 --> 00:32:37,840 But in the future, don't you see like there's a fundamental, 495 00:32:38,320 --> 00:32:38,800 you know, there's a fundamental, you know, there's a fundamental, 496 00:32:38,800 --> 00:32:40,000 challenge you have answered here. 497 00:32:40,180 --> 00:32:42,600 When it comes to real time, you can't do this shit anymore 498 00:32:42,600 --> 00:32:45,180 because there's so much processing power involved. 499 00:32:46,300 --> 00:32:48,840 So in other words, you're like, you know, 500 00:32:49,240 --> 00:32:51,920 like strike one for like idea software and... 501 00:32:52,540 --> 00:32:53,380 Yeah, definitely. 502 00:32:53,580 --> 00:32:55,500 I mean, the amount of processing power 503 00:32:55,500 --> 00:32:57,220 that's gonna be required to identify. 504 00:32:58,840 --> 00:33:01,960 Joy was alluding to the fact that this is a paradigm shift 505 00:33:01,960 --> 00:33:04,380 in exploit development, right? 506 00:33:04,480 --> 00:33:08,660 And if currently everybody's relying on these really 507 00:33:08,800 --> 00:33:11,820 stupid, stupid exploits that go out, right? 508 00:33:11,900 --> 00:33:14,460 Like stupid viruses that like, you know, 509 00:33:14,890 --> 00:33:16,260 infect your boot sector and that's it. 510 00:33:16,480 --> 00:33:18,620 You know, sit there memory resident. 511 00:33:18,920 --> 00:33:20,680 But as soon as polymorphism came along, 512 00:33:21,000 --> 00:33:25,140 it's kind of like enabled the viruses to have this endless 513 00:33:25,140 --> 00:33:28,640 cat and mouse game, you know, going around in circles forever. 514 00:33:28,900 --> 00:33:30,760 And, you know, that's still going on today. 515 00:33:31,360 --> 00:33:34,240 So I mean, theoretically, this can go on 516 00:33:34,240 --> 00:33:38,520 for a longer period of time and, you know, the amount of 517 00:33:38,520 --> 00:33:42,160 of processing time that you're going to have to do to analyze the data as it comes across 518 00:33:42,160 --> 00:33:45,320 the wire, especially with high speed, like, what, like, gigabit? 519 00:33:45,460 --> 00:33:48,680 Like, IDSs can just barely handle gigabit right now. 520 00:33:48,860 --> 00:33:54,240 So, I mean, I really can't see them handling gigabit and doing virtually any processing 521 00:33:54,240 --> 00:33:54,940 on the data. 522 00:34:00,120 --> 00:34:00,540 I know. 523 00:34:14,480 --> 00:34:16,720 Put it up here on my box. 524 00:34:16,840 --> 00:34:17,840 We'll detect it right now. 525 00:34:20,000 --> 00:34:20,440 Yeah. 526 00:34:20,940 --> 00:34:21,380 Yeah. 527 00:34:24,340 --> 00:34:24,780 Okay. 528 00:34:25,220 --> 00:34:29,520 And again, everybody, remember to tune your values, so, you know, you all have your custom 529 00:34:29,520 --> 00:34:29,860 copy. 530 00:34:30,480 --> 00:34:30,920 Okay. 531 00:34:32,660 --> 00:34:33,520 It's in the structure. 532 00:34:33,660 --> 00:34:34,540 It's the last member. 533 00:34:34,740 --> 00:34:38,400 It's the last integer in the decoder structure, in the junk structure. 534 00:34:38,520 --> 00:34:40,240 Just as a hint. 535 00:34:41,780 --> 00:34:45,620 I've got a demonstration here that I intend to show. 536 00:34:47,880 --> 00:34:50,360 It might have some surprising results. 537 00:34:50,620 --> 00:34:58,160 I've got real secure, real secure coming here to analyze this. 538 00:34:58,540 --> 00:35:02,740 You'll all really be really secure from now on. 539 00:35:04,360 --> 00:35:05,040 Okay. 540 00:35:07,020 --> 00:35:08,440 Here we've got the... 541 00:35:08,520 --> 00:35:09,860 Here's the real secure console. 542 00:35:14,300 --> 00:35:14,660 Okay. 543 00:35:15,760 --> 00:35:19,280 Whoever the next speaker is, come up here and beat me if you really want to talk, because 544 00:35:19,280 --> 00:35:20,840 I don't know how I'm doing for time. 545 00:35:24,380 --> 00:35:25,100 20 minutes? 546 00:35:25,400 --> 00:35:25,760 Okay. 547 00:35:26,540 --> 00:35:29,400 I'm just going to grandstand for 20 minutes, if I can. 548 00:35:30,140 --> 00:35:30,500 Okay. 549 00:35:30,520 --> 00:35:31,100 I'll just be a second. 550 00:35:31,180 --> 00:35:31,860 I'm going to set this up here. 551 00:35:52,000 --> 00:35:53,520 I'm going to set this up here, and I'm going to go over here, and I'm going to do a couple 552 00:35:53,520 --> 00:36:00,500 of exploit attempts from this Linux box to this Linux box on in this stupid hub down 553 00:36:00,500 --> 00:36:00,780 here. 554 00:36:00,880 --> 00:36:03,140 They're all kind of connected with this real secure box over here. 555 00:36:05,920 --> 00:36:06,360 Stupid. 556 00:36:07,100 --> 00:36:07,540 Stupid. 557 00:36:08,960 --> 00:36:09,520 Okay. 558 00:36:09,660 --> 00:36:10,120 Let's see here. 559 00:36:10,300 --> 00:36:11,080 Oh, okay. 560 00:36:12,360 --> 00:36:22,340 What I'm doing here is I'm going to imitate the IMAP protocol and, you know, some kind 561 00:36:22,340 --> 00:36:30,560 of integer, login, space, login data, quotes. 562 00:36:30,820 --> 00:36:32,440 There's some quotes around that login data. 563 00:36:32,640 --> 00:36:33,760 And then you say pass. 564 00:36:34,520 --> 00:36:38,480 This is what, you know, a typical IMAPs play. 565 00:36:38,480 --> 00:36:41,120 And I mean, I'm sure we've all seen those before. 566 00:36:41,700 --> 00:36:48,160 So I'm going to attack my box over here with my vulnerable IMAP, and we'll see what over 567 00:36:48,160 --> 00:36:50,580 here, what real secure does about it. 568 00:36:52,720 --> 00:36:53,640 Oh, whoops. 569 00:36:54,840 --> 00:36:55,300 Whoops. 570 00:37:05,020 --> 00:37:06,300 This here is the new version. 571 00:37:10,960 --> 00:37:11,600 Okay. 572 00:37:12,660 --> 00:37:15,700 Real secure did its job and secured us. 573 00:37:15,960 --> 00:37:16,840 Thank you, real secure. 574 00:37:19,440 --> 00:37:21,680 This product does actually work. 575 00:37:22,480 --> 00:37:22,920 You know. 576 00:37:23,760 --> 00:37:27,280 Suspicious TCP packet from the address here. 577 00:37:30,280 --> 00:37:37,540 Essentially what I'm going to do is go through ‑‑ here's ‑‑ let me give you a little background 578 00:37:37,540 --> 00:37:40,760 on why I'm, you know, going up against real secure here. 579 00:37:41,080 --> 00:37:51,620 Initially after the CanSec conference, or DERSEC, like www.DERSEC.com, I ‑‑ everyone 580 00:37:51,620 --> 00:37:53,620 started chatting about this a little bit, right? 581 00:37:53,760 --> 00:37:57,480 And they're like, hey, you know, blah, blah, blah. 582 00:37:57,700 --> 00:38:04,280 We are ‑‑ ISS released this big advisory saying, hey, we're not vulnerable. 583 00:38:04,540 --> 00:38:05,420 This doesn't work. 584 00:38:06,540 --> 00:38:09,540 I responded back, and I said, hey, yes, you are. 585 00:38:10,800 --> 00:38:12,140 Could you please send me? 586 00:38:12,180 --> 00:38:13,260 This is my quote up here. 587 00:38:13,620 --> 00:38:18,760 I had asked for some technical details, TCP logs, et cetera, of an attack that was detected, 588 00:38:18,900 --> 00:38:20,320 but none could be provided. 589 00:38:24,160 --> 00:38:28,120 I have put it through some testing, and I have found that it is most definitely vulnerable 590 00:38:28,120 --> 00:38:30,680 to these techniques, okay? 591 00:38:32,680 --> 00:38:34,540 These are kind of taken out of context. 592 00:38:35,000 --> 00:38:35,400 Okay. 593 00:38:35,420 --> 00:38:44,460 And responded back to this ISS.net mailing list here by, let's see here, Tim Farley at 594 00:38:44,460 --> 00:38:44,840 ISS. 595 00:38:46,300 --> 00:38:47,080 Thank you, Tim. 596 00:38:48,220 --> 00:38:49,820 He took me out of context here. 597 00:38:50,260 --> 00:38:57,340 See, later on here, he's going, oh, this guy, me, admits he doesn't know what real 598 00:38:57,340 --> 00:39:01,100 secure is supposed to detect in the first place, hence the request for the TCP logs. 599 00:39:01,200 --> 00:39:01,600 No, Tim. 600 00:39:03,580 --> 00:39:05,100 I'm asking for these logs. 601 00:39:05,100 --> 00:39:09,680 So that I can verify what the hell is going on, and verify that you guys actually did 602 00:39:09,680 --> 00:39:10,020 some work. 603 00:39:10,400 --> 00:39:13,980 But none could be provided, and that's what I meant, that, you know. 604 00:39:14,580 --> 00:39:19,080 He concludes that because it didn't detect something he threw in front of it, it must 605 00:39:19,080 --> 00:39:19,460 be vulnerable. 606 00:39:20,720 --> 00:39:21,320 No, no, no. 607 00:39:22,160 --> 00:39:23,320 Well, yeah, man. 608 00:39:25,380 --> 00:39:26,180 I don't know. 609 00:39:27,480 --> 00:39:29,720 Anyway, he goes on here to, I mean, okay. 610 00:39:29,820 --> 00:39:31,760 This product does detect a lot of stuff, okay? 611 00:39:32,340 --> 00:39:33,900 I don't want to, you know. 612 00:39:33,900 --> 00:39:40,320 Give him too bad of a name here, but, you know, it does detect buffer overflows, just 613 00:39:40,320 --> 00:39:40,920 like he's saying. 614 00:39:41,360 --> 00:39:46,740 It has a generic buffer overflow signature, which attempts to identify hex 90 in your 615 00:39:46,740 --> 00:39:47,540 data. 616 00:39:50,560 --> 00:39:56,100 But as we saw just now over here, it actually has a specific IMAP signature. 617 00:39:56,440 --> 00:39:59,040 It's not the generic Intel signature. 618 00:39:59,260 --> 00:40:00,540 I can show you that in a minute. 619 00:40:02,960 --> 00:40:03,740 Real secure. 620 00:40:03,900 --> 00:40:09,920 is not designed to attack, to detect attacks by recognizing the shell code. Okay, Tim. 621 00:40:10,700 --> 00:40:17,580 Well anyhow, he goes on, I conclude that you use something that we don't have an XPU for, 622 00:40:17,860 --> 00:40:23,760 I don't know what XPU means, but apparently it's something. And then, okay, two days later, 623 00:40:24,720 --> 00:40:28,340 this by the way, this is all going on in a mailing list that I'm not a member of and 624 00:40:28,340 --> 00:40:31,460 I didn't find this out until like months later, so I didn't have a chance to like respond 625 00:40:31,460 --> 00:40:37,740 to any of this. And they're like, fucking A, man. This thing's just beeping like crazy. 626 00:40:38,620 --> 00:40:41,660 So I didn't have a chance to respond to any of this, but luckily I was doing a Google 627 00:40:41,660 --> 00:40:46,580 search of like my name and like mutate, so I was like, yeah, yeah, let's see how popular 628 00:40:46,580 --> 00:40:54,520 I am, and I was like, yeah, yeah, yeah. No, but, no, someone CC'd me this. I disagree, 629 00:40:54,840 --> 00:41:00,760 you've left out these key steps, right? Tim, this is from Tim again, Tim Farley, ISS Atlanta, 630 00:41:01,460 --> 00:41:10,560 tfarley at ISS.net. Apparently his phone numbers have changed, so, I don't know. No, 631 00:41:10,680 --> 00:41:16,120 actually, I've actually heard also that Tim is no longer with ISS after, and this is just 632 00:41:16,120 --> 00:41:20,740 like two months old, so apparently, I don't know, there might have been a little abrasion 633 00:41:20,740 --> 00:41:28,080 there because he's really abrasive towards me. So he left, he concludes that I left 634 00:41:28,080 --> 00:41:30,660 out some key steps that I don't understand the scientific method. 635 00:41:31,460 --> 00:41:37,220 Apparently, right? So, attempt an unmodified attack. Right here with the IMAP overflow. 636 00:41:38,560 --> 00:41:41,220 Verify the IDS response to it. Okay. 637 00:41:45,860 --> 00:41:48,540 Suspicious, yeah, IMAP, okay. 638 00:41:55,100 --> 00:41:58,600 Attempt the modified version of, okay, okay, okay. 639 00:42:01,880 --> 00:42:10,440 Tim, thanks, man. He just like worked himself right into this. Okay. What I'm doing here, 640 00:42:10,480 --> 00:42:17,680 I'm doing the same thing I did before. You can't see that? Here, I'll get a second version 641 00:42:17,680 --> 00:42:29,740 up there for you guys. There you go. As you can see, M7, like my favorite song, anybody 642 00:42:29,740 --> 00:42:30,680 know what, anyone? 643 00:42:34,160 --> 00:42:47,020 Freaking ThinkPad. Anybody know M7? Magnificent 7? Apparently, what you do with it, this is 644 00:42:47,020 --> 00:42:53,180 the filter application, so it's going to take that same EXP that was run up there for, short 645 00:42:53,180 --> 00:42:56,420 for exploit. M7. 646 00:42:57,180 --> 00:42:57,980 That's pretty bad. 647 00:42:58,760 --> 00:43:01,440 Here, I'll give you the help. 648 00:43:06,500 --> 00:43:07,020 Word. 649 00:43:08,340 --> 00:43:08,860 Word. 650 00:43:11,300 --> 00:43:17,520 Apparently, you've got these four options here. I, S, M, or H. Short for Intel, Spark, 651 00:43:17,820 --> 00:43:27,000 MIPS, or HP. The MIPS doesn't even exist in this code. I'll just put it there for fun. 652 00:43:27,220 --> 00:43:29,880 I had the intention of coding that at the time when I wrote this. 653 00:43:31,820 --> 00:43:37,260 And then what you do, so you select your architecture here, as you can see there, I did dash I. 654 00:43:37,400 --> 00:43:43,420 This is the Intel overflow. And then you do dash O, the offset. So you tell the filter 655 00:43:43,420 --> 00:43:54,300 when the offset values are going to, what they are, so it knows when to stop encoding, 656 00:43:54,560 --> 00:43:59,920 because you don't want to encode those. Dash N, Nop. You've got to tell it what particular 657 00:43:59,920 --> 00:44:05,580 knob you used, right? I mean, I know everyone uses 90, which is the official knob, but I mean, 658 00:44:05,600 --> 00:44:10,620 there is the possibility that someone used something like the capital A, like cheese does 659 00:44:10,620 --> 00:44:21,140 all the time. And then you do dash x exploit, or you could run the exploit pipe M7 if you wanted 660 00:44:21,140 --> 00:44:26,480 to, because it accepts standard input if you don't do that. I just did that for fun, you know. 661 00:44:27,560 --> 00:44:34,080 And then some other things here. Dash u, dash l, upper lower code. Dash b, give it a string 662 00:44:34,080 --> 00:44:40,680 that's your string of band characters. Dash c, that'll output a c style array that you can just 663 00:44:40,680 --> 00:44:43,980 kind of embed in some other code, or you can like take and analyze somewhere else. 664 00:44:46,160 --> 00:44:52,340 Dash t will truncate the exploit attempt, because we know everybody's so damned lazy that they don't 665 00:44:52,340 --> 00:44:56,100 actually know like how big the buffer was supposed to be, and they just kind of ram a bunch 666 00:44:56,100 --> 00:44:56,380 of stuff. 667 00:44:56,480 --> 00:45:00,960 down its throat. So you can typically—you can, like, nine times out of ten, truncate 668 00:45:00,960 --> 00:45:04,780 this thing by, like, one or a hundred bytes, and it'll still function. 669 00:45:05,640 --> 00:45:16,520 Dash P is to pad the encode-decode length. What this is, like, say I generated a decoder, 670 00:45:17,080 --> 00:45:23,540 but, like, the jump offset was a banned character, you might have to, like, tell this filter 671 00:45:23,540 --> 00:45:30,380 application to add some more bytes in there in the decoder so that you're not landing 672 00:45:30,380 --> 00:45:34,340 in a banned character, like a too-upper, too-lower is based character. 673 00:45:36,080 --> 00:45:40,960 Dash U is to attempt to modulate the offset back into the NOMSLED. This can be dangerous 674 00:45:41,600 --> 00:45:46,600 because your SPLITE might not work because, you know, you could jump out of range. 675 00:45:48,640 --> 00:45:53,320 So we're going to go through here and run this new SPLITE. 676 00:45:55,500 --> 00:45:59,980 Oh, this guy is not a marketing person, neither is Chris Rowland, for that matter. Chris Rowland 677 00:45:59,980 --> 00:46:06,720 actually made the initial response that ISS isn't vulnerable, you know, and he is an 678 00:46:06,720 --> 00:46:10,940 engineer, apparently, and he has written many of the signatures in ReelSecure, so apparently 679 00:46:10,940 --> 00:46:15,980 this guy is really in the know guy. Oh, it's a two-way street. Well, by the way, I actually 680 00:46:15,980 --> 00:46:19,740 did send this code to ISS ahead of time before the public release, and they had a chance 681 00:46:19,740 --> 00:46:23,460 to analyze it and everything, right? So I kind of see that as a two-way street, and 682 00:46:23,540 --> 00:46:27,020 they didn't provide me with their logs, which I would have seen as a two-way street, so 683 00:46:27,620 --> 00:46:33,600 I see some friction there. Yeah, I don't want to slam them, man, but you didn't have to 684 00:46:33,600 --> 00:46:38,300 flame me without CCing me on the bloody mail, you know? I mean, I didn't even know 685 00:46:38,300 --> 00:46:42,300 this was going on, and I'm getting flamed, so here you go. 686 00:46:45,100 --> 00:46:51,360 So let's do this IMAP overflow and see what ReelSecure has to say about it. 687 00:46:55,360 --> 00:47:07,520 Whoa! What's that? Sensor error. Holy shit. Oh, I didn't know this was going to happen. 688 00:47:07,620 --> 00:47:18,320 I'm sorry. No, I'm kidding. Apparently, we just generated an exception fault in ReelSecure. 689 00:47:18,720 --> 00:47:23,520 Well, I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. I'm sorry. 690 00:47:25,020 --> 00:47:26,820 We all know what that means. 691 00:47:29,820 --> 00:47:37,160 Oh, packet receive exception encountered in function hex 1004E360 692 00:47:37,160 --> 00:47:44,460 in packet hash table, packet proto TCP, packet TCP UDP hash 000143. 693 00:47:44,840 --> 00:47:47,400 So apparently, I don't know. 694 00:47:47,420 --> 00:47:48,320 Let me think about this first. 695 00:47:48,600 --> 00:47:50,160 Oh, okay. 696 00:47:50,160 --> 00:47:54,760 Okay, this appears to be, I don't know, man. 697 00:47:54,920 --> 00:47:56,800 I think for some reason, 698 00:47:56,860 --> 00:48:01,240 RealSecure is attempting to diagnose the essence of the protocol here 699 00:48:02,100 --> 00:48:06,080 and figure out what all this means to it. 700 00:48:06,820 --> 00:48:12,660 No, I feel great that my packets mean a lot more to it than the IMAP did, 701 00:48:12,800 --> 00:48:15,120 and it's thinking a lot harder about what to do, 702 00:48:15,700 --> 00:48:18,460 and it just couldn't handle that, and it caused an exception. 703 00:48:20,160 --> 00:48:20,940 So, okay, let's see. 704 00:48:21,160 --> 00:48:23,740 Peter, you should be thinking more about structured exception handling, man. 705 00:48:23,900 --> 00:48:25,260 I know, I was thinking about that, dude. 706 00:48:26,340 --> 00:48:26,700 Boom. 707 00:48:27,880 --> 00:48:28,720 I flashed myself. 708 00:48:29,800 --> 00:48:30,560 So we'll do it again. 709 00:48:31,000 --> 00:48:31,940 Another sensor error. 710 00:48:32,040 --> 00:48:33,720 So this is a reproducible error, it looks like. 711 00:48:37,060 --> 00:48:41,000 Well, well, I mean, I think this might be exploitable. 712 00:48:43,940 --> 00:48:48,080 You know, it just seems to me, yeah, my laptop thinks so, too. 713 00:48:48,800 --> 00:48:49,460 There you go. 714 00:48:49,600 --> 00:48:50,140 Think back. 715 00:48:50,160 --> 00:48:51,160 He's thinking a lot. 716 00:48:52,540 --> 00:48:56,940 You know, so, this could, you know, that address we saw here, 717 00:48:57,600 --> 00:48:58,480 what was that again? 718 00:48:58,900 --> 00:48:59,840 Let's get the new one. 719 00:49:02,000 --> 00:49:02,360 Okay. 720 00:49:03,220 --> 00:49:05,600 Similar kind of thing, hash table, blah, blah, blah, blah, blah, 721 00:49:05,660 --> 00:49:07,560 exception encountered calling this function. 722 00:49:07,700 --> 00:49:10,020 It can't resolve the name of that, 723 00:49:10,140 --> 00:49:12,460 so I'm assuming that it's overwriting some kind of function pointer, 724 00:49:13,020 --> 00:49:13,720 something like that. 725 00:49:14,340 --> 00:49:17,680 So, you know, if we could make some intelligent use of that 726 00:49:17,680 --> 00:49:19,060 instead of just kind of random. 727 00:49:19,280 --> 00:49:19,980 This is general. 728 00:49:20,160 --> 00:49:21,180 This is designed to be random. 729 00:49:22,060 --> 00:49:24,660 And, I mean, if we made some intelligent use 730 00:49:24,660 --> 00:49:26,960 of what that randomness was coming over here, 731 00:49:27,400 --> 00:49:31,440 you know, we could direct to the instruction flow of real secure. 732 00:49:32,060 --> 00:49:32,640 Possibly, right? 733 00:49:32,700 --> 00:49:33,060 I'm just thinking. 734 00:49:35,400 --> 00:49:37,500 I could, I'll set up another demo here. 735 00:49:38,280 --> 00:49:39,220 Just take a second. 736 00:49:40,660 --> 00:49:41,740 I flashed my other. 737 00:49:42,140 --> 00:49:42,540 Here we go. 738 00:49:57,480 --> 00:49:58,120 Okay. 739 00:49:58,460 --> 00:50:00,300 Let's do it on another port. 740 00:50:01,580 --> 00:50:03,560 I'll explain this in a moment here. 741 00:50:08,860 --> 00:50:10,420 Oh, fucking A. 742 00:50:18,100 --> 00:50:18,740 Tricky. 743 00:50:20,400 --> 00:50:21,980 I'm going to send it to port 110. 744 00:50:22,980 --> 00:50:23,680 Okay, wait a minute. 745 00:50:23,980 --> 00:50:24,720 Tim, Tim. 746 00:50:24,900 --> 00:50:25,680 Okay, right. 747 00:50:25,780 --> 00:50:26,940 Send an unmodified version. 748 00:50:27,500 --> 00:50:28,200 Hold on a second. 749 00:50:32,780 --> 00:50:33,140 Okay. 750 00:50:33,140 --> 00:50:33,160 Okay. 751 00:50:37,320 --> 00:50:37,680 Okay. 752 00:50:48,260 --> 00:50:48,620 Okay. 753 00:50:49,160 --> 00:50:49,500 Okay. 754 00:50:49,500 --> 00:50:49,620 Okay. 755 00:51:03,660 --> 00:51:05,780 I just put that up there for the guys in the back. 756 00:51:05,880 --> 00:51:06,140 Come on. 757 00:51:06,260 --> 00:51:06,900 Give me a break. 758 00:51:07,100 --> 00:51:08,620 Okay, so here's the unmodified exploit. 759 00:51:10,900 --> 00:51:11,640 Wait a second. 760 00:51:13,840 --> 00:51:14,200 Oh. 761 00:51:17,240 --> 00:51:17,600 Huh. 762 00:51:18,960 --> 00:51:19,640 Real secure. 763 00:51:21,800 --> 00:51:22,520 I'm sorry. 764 00:51:23,680 --> 00:51:24,040 . 765 00:51:27,180 --> 00:51:32,080 I have to restart it. 766 00:51:32,820 --> 00:51:34,180 It didn't have to be restarted, you think? 767 00:51:34,820 --> 00:51:36,980 I tried it before and it didn't have to be restarted. 768 00:51:37,060 --> 00:51:40,540 I think the deal with all this is crushing is, like, you know, shit's resolved when 769 00:51:40,540 --> 00:51:42,660 it's processing and it's going to handle it. 770 00:51:42,920 --> 00:51:43,980 Let me just try one more time. 771 00:51:44,520 --> 00:51:47,200 Let me get rid of this quote here. 772 00:51:47,440 --> 00:51:48,780 By the way, if you're making a . 773 00:51:48,780 --> 00:51:49,620 And by the way if you're making a pop 3 access to this. 774 00:51:49,620 --> 00:52:02,600 put a quote there and RealSecure is blind? No, I don't know. Do you think I can just 775 00:52:02,600 --> 00:52:05,660 stop it from the console or do you think I have to reboot or something stupid like that? 776 00:52:05,660 --> 00:52:18,280 I don't know. Okay, let's try that. Stop. Stop. Stop. Sorry for this lag, everybody, 777 00:52:18,480 --> 00:52:35,460 but you know, this is NT I'm dealing with here. Bless you. Where? Oh, yeah. I mean, 778 00:52:35,660 --> 00:52:42,320 I thought this was NT 4 for a second. There we go. Okay. 779 00:52:51,900 --> 00:53:05,220 Okay, we restarted that. Okay. We'll come back in real...REAL 780 00:53:05,220 --> 00:53:05,600 SECURE! 781 00:53:05,660 --> 00:53:25,400 secure. Monitor, monitor, monitor. What the? Oh, fine. I don't know. Can you imagine what 782 00:53:25,400 --> 00:53:32,640 kind of hassle this would be if you were running a live real secure? Okay, okay, let's see. 783 00:53:34,860 --> 00:53:44,180 Connecting active. Connected, okay. So, I mean, you can all see what this does. User, 784 00:53:44,840 --> 00:53:51,520 exploit code, going to port 110 of the vulnerable system that we saw events happening before, 785 00:53:51,740 --> 00:54:02,620 so bless you. Okay, okay, I don't know. Whatever. We'll just call it quits on, we'll call it 786 00:54:02,640 --> 00:54:07,140 it quits. Oh, I know what it might be. Here, I think we might need a space in there, another. 787 00:54:17,020 --> 00:54:31,260 It did actually catch this before. It was, it, let me try a different port. Okay, so, 788 00:54:41,840 --> 00:54:43,400 We'll try the FTP port. 789 00:54:48,620 --> 00:54:50,040 Okay, ah, whatever. 790 00:54:51,460 --> 00:54:56,540 Apparently real secure is having a hard time and we'll just let it have that hard time 791 00:54:57,420 --> 00:55:01,100 on a four meter wide screen. 792 00:55:02,720 --> 00:55:09,920 As you can see, I would have demoed, if it would have detected something, I would have 793 00:55:09,920 --> 00:55:16,440 shown how it would have not detected something following that, but yeah, I'm having some 794 00:55:16,440 --> 00:55:16,740 problems. 795 00:55:17,980 --> 00:55:24,780 I could do it, I could like, here, what I can do, I'll do the IMAP one again just so 796 00:55:24,780 --> 00:55:26,520 you can, all of you guys can see it. 797 00:55:26,520 --> 00:55:31,000 You can see that the scanner is actually functional. 798 00:55:38,100 --> 00:55:38,840 Was that it? 799 00:55:39,200 --> 00:55:39,560 Yeah. 800 00:55:40,780 --> 00:55:41,460 There we go. 801 00:55:42,220 --> 00:55:47,680 Okay, so, you know, I don't know why those other ones weren't being seen whatsoever, 802 00:55:50,120 --> 00:55:51,200 but who knows. 803 00:55:52,360 --> 00:55:53,920 Let me do them a favor. 804 00:55:54,220 --> 00:55:56,500 Let me check my policy and make sure that I'm clear. 805 00:55:56,500 --> 00:55:57,780 I've got all the policies going on here. 806 00:56:00,320 --> 00:56:03,120 Okay, let's see, apply to sensor. 807 00:56:05,260 --> 00:56:08,560 Let's just, I'll just do this in front of everybody so that there's no question in 808 00:56:08,560 --> 00:56:10,120 anybody's mind what it's doing. 809 00:56:10,520 --> 00:56:12,580 This is version six, by the way. 810 00:56:13,440 --> 00:56:14,940 So it just came out the other day. 811 00:56:16,540 --> 00:56:20,440 Seriously, I was trying to like run my demo and then they like released a new version 812 00:56:20,440 --> 00:56:21,580 on me and I was like, oh no. 813 00:56:23,480 --> 00:56:23,880 Okay. 814 00:56:25,500 --> 00:56:31,560 It is, it's like, apply to sensor. 815 00:56:31,820 --> 00:56:32,420 Click, click, click. 816 00:56:36,040 --> 00:56:36,560 What's that? 817 00:56:41,840 --> 00:56:45,160 I don't know, it's not, it's not letting me click apply to sensor. 818 00:56:48,080 --> 00:56:49,560 Does anyone know how to use Real Secure? 819 00:56:50,420 --> 00:56:50,820 . 820 00:56:53,860 --> 00:56:54,440 Reboot it, yeah. 821 00:56:54,720 --> 00:56:56,380 Okay, this thing could just be foobar. 822 00:56:56,540 --> 00:56:58,360 I mean, we could have just crashed enough stuff 823 00:56:58,360 --> 00:57:00,380 so that it just can't handle what's going on anymore. 824 00:57:00,980 --> 00:57:01,880 I don't know, right? 825 00:57:02,000 --> 00:57:03,840 I mean, I'm trying to apply this stuff. 826 00:57:05,920 --> 00:57:08,140 Any other questions as to how this is going to function 827 00:57:08,140 --> 00:57:08,940 or anything like that? 828 00:57:11,400 --> 00:57:11,760 Okay. 829 00:57:12,140 --> 00:57:12,660 Oh, yep. 830 00:57:13,520 --> 00:57:16,420 How much randomness do you really expect to have out of that? 831 00:57:17,000 --> 00:57:18,120 Oh, good question. 832 00:57:19,540 --> 00:57:23,020 In terms of the decoder section itself, 833 00:57:25,060 --> 00:57:26,800 he asked how much randomness 834 00:57:26,800 --> 00:57:28,720 do I expect to have out of the decoder. 835 00:57:29,200 --> 00:57:30,820 Well, here. 836 00:57:31,080 --> 00:57:32,340 If you see right here, 837 00:57:32,760 --> 00:57:35,980 when I ran this code just now, 838 00:57:38,500 --> 00:57:41,960 it deduced that this here is the original payload 839 00:57:41,960 --> 00:57:45,160 and all of those blocks there are hex 90. 840 00:57:46,480 --> 00:57:47,460 Over here, 841 00:57:48,120 --> 00:57:49,740 we've got the fabled bin SH. 842 00:57:51,060 --> 00:57:52,860 So, anyone can see that? 843 00:57:54,700 --> 00:57:56,340 It figured out, okay, 844 00:57:56,400 --> 00:57:58,280 I've got this much to encode, blah, blah, blah, blah, blah. 845 00:58:00,340 --> 00:58:03,400 Almost nearly 3 billion keys. 846 00:58:04,420 --> 00:58:07,920 So, nearly 3 billion possible outcomes. 847 00:58:10,040 --> 00:58:12,300 So, that's 3 billion parts of 848 00:58:13,600 --> 00:58:16,480 3 billion shellcode permutations, at least. 849 00:58:16,900 --> 00:58:18,100 Here's the encoded shellcode. 850 00:58:21,460 --> 00:58:23,480 This monitor isn't working in front of me, 851 00:58:23,500 --> 00:58:24,580 so I gotta go off the big one here. 852 00:58:24,940 --> 00:58:30,480 But here's the key we used, A2, blah, blah, blah, blah, blah. 853 00:58:31,140 --> 00:58:34,000 And here's the encoded shellcode here, 54 bytes long. 854 00:58:35,200 --> 00:58:40,020 The order of everything went 0, 1, 2, 3, 4, 5, 6, 855 00:58:40,280 --> 00:58:44,520 oh, 6, 8, 9, 10, 11, 12. 856 00:58:44,760 --> 00:58:46,900 I guess I can't see where 7 went either. 857 00:58:47,160 --> 00:58:47,180 But. 858 00:58:47,180 --> 00:58:50,560 As you can see, it's off to the side. 859 00:58:50,680 --> 00:58:51,840 As you can see, it's out of order. 860 00:58:52,040 --> 00:58:54,220 If I were to do this again, it could be in a different order. 861 00:58:54,500 --> 00:58:57,580 And the hard-coded value that I used is, 862 00:58:57,640 --> 00:59:02,480 I hard-coded a 42, a D, and this and that. 863 00:59:02,700 --> 00:59:04,960 You see that the D there is a character 864 00:59:04,960 --> 00:59:06,920 that you might have had to use that P option 865 00:59:06,920 --> 00:59:08,600 to pad all this out with. 866 00:59:10,000 --> 00:59:13,540 Here is the decoder engine itself, 73 bytes long. 867 00:59:14,260 --> 00:59:17,120 And here is the actual polymorphic shellcode. 868 00:59:17,180 --> 00:59:22,060 So this down here has this up here pre-pended 869 00:59:22,060 --> 00:59:24,360 to the front of the stuff. 870 00:59:24,660 --> 00:59:26,000 So let's run another one really quick. 871 00:59:26,620 --> 00:59:29,180 And we'll see, see that the last one was 73, 872 00:59:29,420 --> 00:59:33,140 this one is 66, so I mean, that's a fair difference. 873 00:59:33,500 --> 00:59:37,060 And the order here is 0, 1, yeah, the other one went, 874 00:59:37,500 --> 00:59:42,880 if I look up here, it went 0, 1, 2, 3, 875 00:59:42,920 --> 00:59:47,160 it, oh, yeah, I don't know. 876 00:59:47,160 --> 00:59:50,320 I mean, real secure, didn't cache it or something. 877 00:59:51,460 --> 00:59:54,780 But 0, 1, 3, 2, so now you see the 3 and the 2 878 00:59:54,780 --> 00:59:58,020 are out of order, 4, 5, 7, 8, and the 7, 8 are in order, 879 00:59:58,140 --> 01:00:00,100 and the 6 is out of order, all this stuff. 880 01:00:00,260 --> 01:00:01,560 So you can see it's kind of out of order, 881 01:00:01,680 --> 01:00:02,760 the hard-codes are all different, 882 01:00:02,980 --> 01:00:04,420 the length of this stuff is all different. 883 01:00:04,900 --> 01:00:06,060 You can go in here. 884 01:00:09,120 --> 01:00:09,780 Yeah, question? 885 01:00:11,820 --> 01:00:13,120 When you code the shellcode, 886 01:00:13,220 --> 01:00:14,180 what algorithm are you using? 887 01:00:14,300 --> 01:00:15,700 Are you just using a simple XOR with the key? 888 01:00:15,820 --> 01:00:16,980 I'm using a simple XOR, 889 01:00:16,980 --> 01:00:17,400 with the key. 890 01:00:17,620 --> 01:00:21,500 Question, could an IDS take a simple XOR 891 01:00:21,500 --> 01:00:23,280 checksum of an even number of bytes 892 01:00:23,760 --> 01:00:25,780 to identify the X-boy? 893 01:00:26,960 --> 01:00:28,720 Because then the key would drop out. 894 01:00:29,420 --> 01:00:31,160 X, what was that again? 895 01:00:31,480 --> 01:00:34,520 Okay, okay, if they took the first 10 bytes of, 896 01:00:34,640 --> 01:00:36,780 or if they took a particular 10 bytes of the shellcode, 897 01:00:36,920 --> 01:00:38,080 right, and XORed them all together, 898 01:00:38,660 --> 01:00:40,600 your key would drop out, no matter what the key was. 899 01:00:40,860 --> 01:00:41,360 Why is that? 900 01:00:42,080 --> 01:00:44,020 Because there's an even number of it in the XOR. 901 01:00:44,540 --> 01:00:46,140 There's an even number of? 902 01:00:48,080 --> 01:00:49,520 I mean, are you guys familiar at all 903 01:00:49,520 --> 01:00:51,440 with the SMEG wire thing, 904 01:00:51,540 --> 01:00:54,040 where they used to generate a lot of multiple encryption 905 01:00:54,040 --> 01:00:56,140 generators and a lot of garbage instructions? 906 01:00:57,800 --> 01:01:00,060 Okay, I see where you're coming from, but you can... 907 01:01:00,060 --> 01:01:02,340 Is the same key that's XORed against every four-byte block? 908 01:01:02,400 --> 01:01:03,240 Every four-byte block, yeah. 909 01:01:03,600 --> 01:01:05,080 Against the same key XORed against it? 910 01:01:05,140 --> 01:01:07,520 Yeah, I'm thinking about using a sliding key. 911 01:01:07,680 --> 01:01:09,360 I mean, that's kind of the reason for that, 912 01:01:09,460 --> 01:01:11,340 but I mean, this is just to evade current 913 01:01:11,340 --> 01:01:12,700 and network intrusion detection. 914 01:01:12,740 --> 01:01:15,480 So I mean, in the future, if anyone does detect it 915 01:01:15,480 --> 01:01:16,960 by a mechanism like that, I mean, that's a good idea. 916 01:01:16,960 --> 01:01:19,360 I mean, we can go ahead and add a couple extra instructions. 917 01:01:19,580 --> 01:01:21,260 The problem is, is I really didn't want to take up 918 01:01:21,260 --> 01:01:23,280 too much of the nop sled, right? 919 01:01:23,440 --> 01:01:26,140 And I mean, every additional instruction I use, 920 01:01:26,280 --> 01:01:29,120 potentially, is like another few bytes of space, right? 921 01:01:29,280 --> 01:01:31,820 And I mean, this space is at a little bit more 922 01:01:31,820 --> 01:01:34,200 of a premium than it is even in the virus coder world, 923 01:01:34,400 --> 01:01:36,140 right, I mean, because like, you know, 924 01:01:36,240 --> 01:01:38,060 one byte could mean the difference of getting root 925 01:01:38,060 --> 01:01:39,480 and not getting root. 926 01:01:40,440 --> 01:01:42,760 So I mean, I just don't want to make it too overly complex 927 01:01:42,760 --> 01:01:45,200 to start, to begin with, right, so. 928 01:01:45,200 --> 01:01:47,460 I guess they could do that. 929 01:01:48,020 --> 01:01:49,280 Give it a shot, see how it goes. 930 01:01:50,320 --> 01:01:52,540 See, right here, we say the maximum amount 931 01:01:52,540 --> 01:01:54,360 of non-operational instructions. 932 01:01:55,540 --> 01:01:57,260 By default, I use a four. 933 01:01:58,820 --> 01:02:02,120 For Intel CISC CPUs, I found that three to 10 934 01:02:02,120 --> 01:02:04,080 works really good, but for risks, you should probably 935 01:02:04,080 --> 01:02:06,860 try and keep it to two to four, because in the risk systems, 936 01:02:06,960 --> 01:02:08,660 it's always a 32-bit value. 937 01:02:08,940 --> 01:02:10,660 So I mean, that's four bytes at a time. 938 01:02:13,140 --> 01:02:13,860 Down here. 939 01:02:22,880 --> 01:02:23,820 Here, let me test this here. 940 01:02:23,820 --> 01:02:27,640 Here is the, this function itself is, 941 01:02:28,500 --> 01:02:30,900 this here are the NOP replacements, 942 01:02:31,500 --> 01:02:33,520 so basically this is a regular NOP, 943 01:02:34,000 --> 01:02:37,380 this is a multi byte NOP that you can replace it with, 944 01:02:37,580 --> 01:02:38,860 this is a single byte one. 945 01:02:39,160 --> 01:02:42,060 These values here are all defined in the other header file, 946 01:02:42,060 --> 01:02:43,600 You can look them up and figure out what it means. 947 01:02:43,820 --> 01:02:45,840 But this last value here is the weight. 948 01:02:46,520 --> 01:02:59,180 So this one is like a two, and this might be an old version, anyhow, this is the weight 949 01:02:59,180 --> 01:03:07,480 here, or this is the weight, I don't know, whatever, look at the other header file and 950 01:03:07,480 --> 01:03:10,760 it defines what everything is and you can figure out what all those integers mean and 951 01:03:10,760 --> 01:03:14,400 then you can just go in there and tweak these values to your liking. 952 01:03:15,740 --> 01:03:16,640 Any other questions? 953 01:03:24,460 --> 01:03:26,280 You want to compare them and see if they're identical? 954 01:03:28,780 --> 01:03:30,440 You would prefer that they're different? 955 01:03:34,600 --> 01:03:37,680 Yeah but there are some sections of this code that are static. 956 01:03:38,620 --> 01:03:39,880 So I mean, they are. 957 01:03:42,140 --> 01:04:02,160 Okay, 1,004, E, 6, 0, is it the same, 1,004, 1,004, E, 6, 0, oh, whoops, yeah, it looks 958 01:04:02,160 --> 01:04:02,800 like it's the same. 959 01:04:06,860 --> 01:04:09,360 Okay, well, yeah, yeah, I mean, that could be right, right? 960 01:04:09,360 --> 01:04:14,580 But I mean, there's a lot of static data also, and I mean, it could be reading the, 961 01:04:14,700 --> 01:04:20,480 you know, offset section, which is the same every time, or it could be, I don't know 962 01:04:20,480 --> 01:04:21,080 what it's doing, right? 963 01:04:21,160 --> 01:04:25,360 I mean, I haven't like fully debugged it, but apparently we're smashing something, right? 964 01:04:26,020 --> 01:04:29,920 And if we're smashing something, then that usually isn't the best thing to have go on. 965 01:04:32,140 --> 01:04:36,020 Especially in the IES, yeah, yeah, as you said, duly noted. 966 01:04:36,500 --> 01:04:37,420 Any other questions? 967 01:04:37,640 --> 01:04:38,000 Questions? 968 01:04:38,240 --> 01:04:38,440 Yes? 969 01:04:42,040 --> 01:04:42,360 . 970 01:04:50,860 --> 01:04:52,260 Yeah, hey, I'm going to give that a go. 971 01:04:53,440 --> 01:04:57,020 The question was, you know, hey, are we going to have lots of stuff that will generate a 972 01:04:57,020 --> 01:05:00,660 exploit and exploit the target system and the IDS simultaneously? 973 01:05:01,780 --> 01:05:05,040 You know, hey, that's definitely a way we might want to move. 974 01:05:06,560 --> 01:05:06,880 . 975 01:05:07,760 --> 01:05:08,080 . 976 01:05:08,080 --> 01:05:08,180 . 977 01:05:10,100 --> 01:05:10,500 . 978 01:05:12,700 --> 01:05:13,100 . 979 01:05:13,100 --> 01:05:15,740 Recode any binary, I don't know man, I don't think too hard. 980 01:05:15,880 --> 01:05:20,700 I mean, everything's pretty modular and tight, you know, anyone fairly familiar with C should 981 01:05:20,700 --> 01:05:23,200 be able to like, you know, do whatever they want with the code. 982 01:05:24,600 --> 01:05:27,480 I like to think that it isn't too sloppily written. 983 01:05:28,260 --> 01:05:33,060 You know, there's a couple global variables that like my teach, my profs at some school 984 01:05:33,060 --> 01:05:37,360 get pissed at me about, but I kind of need those, I like globals. 985 01:05:37,520 --> 01:05:37,920 . 986 01:05:37,920 --> 01:05:38,480 Anybody else? 987 01:05:39,920 --> 01:05:41,460 Yeah, I'm just wrapped up. 988 01:05:41,500 --> 01:05:42,480 I'm just doing Q&A. 989 01:05:43,680 --> 01:05:44,220 Yep. 990 01:05:45,860 --> 01:05:46,540 Pardon me? 991 01:05:47,860 --> 01:05:48,740 K2.ca 992 01:05:49,520 --> 01:05:51,140 slash security.html 993 01:05:51,840 --> 01:05:52,700 Anybody else? 994 01:05:54,440 --> 01:05:55,200 Five dollars. 995 01:05:55,740 --> 01:05:57,460 Going once, going twice. 996 01:05:57,560 --> 01:05:58,100 Okay, thank you.