1 00:00:00,000 --> 00:00:09,260 My name is Yanis. I'm here to talk about how to break obfuscators in a bytecode language, Java. 2 00:00:09,920 --> 00:00:13,780 Most of you don't have a lot of respect for that language, that includes me. 3 00:00:14,700 --> 00:00:20,680 But at the same time, it's being used more and more. 4 00:00:21,720 --> 00:00:24,100 Yeah. I still have to cue the slide. 5 00:00:29,160 --> 00:00:29,640 Better? 6 00:00:30,000 --> 00:00:30,540 Yeah? 7 00:00:30,740 --> 00:00:31,200 Yeah. 8 00:00:32,160 --> 00:00:33,180 Okay, brief outline. 9 00:00:39,820 --> 00:00:41,960 A bit of background on what we'll be doing. 10 00:00:42,160 --> 00:00:43,400 Basic Hello World. 11 00:00:43,740 --> 00:00:44,900 What is bytecode? 12 00:00:47,680 --> 00:00:49,840 I don't want to spend too much time on this stuff. 13 00:00:51,240 --> 00:00:53,840 Okay, so how does the whole thing work? 14 00:00:54,080 --> 00:00:56,160 You've got an architecture, something like PowerPC. 15 00:00:56,600 --> 00:00:58,160 You've got the host OS below. 16 00:00:58,960 --> 00:00:59,980 And then below that... 17 00:01:00,000 --> 00:01:00,820 You've got the VM. 18 00:01:01,720 --> 00:01:04,080 That has a class loader, an execution engine, 19 00:01:04,940 --> 00:01:06,680 Sun's infamous sandbox. 20 00:01:08,760 --> 00:01:12,920 And the bytecode sits pretty much between the class loader and the execution engine. 21 00:01:13,720 --> 00:01:16,480 And that's how you run your Java files, class files, etc. 22 00:01:19,420 --> 00:01:21,840 The language is full of security mechanisms. 23 00:01:22,140 --> 00:01:25,480 The LSD group did some work back in 99. 24 00:01:26,520 --> 00:01:29,640 Not a lot of focus has to be spent on the VM. 25 00:01:30,000 --> 00:01:36,160 So, Sun is producing magnificent new releases of the virtual machine. 26 00:01:37,460 --> 00:01:40,200 Locking it down as they go along, more and more. 27 00:01:45,320 --> 00:01:47,760 And then you have the basic scenario. 28 00:01:48,020 --> 00:01:49,160 So, what are we talking about? 29 00:01:49,280 --> 00:01:53,360 You compile a file, you start with a program, you compile that program. 30 00:01:53,740 --> 00:01:56,100 This is really basic, this is why I'm skimming through all this. 31 00:01:56,600 --> 00:01:59,080 You obtain the class file, a few strings there. 32 00:02:00,000 --> 00:02:02,060 The output has the string file. 33 00:02:02,760 --> 00:02:05,620 If you disassemble it again, it's there. 34 00:02:10,760 --> 00:02:13,700 Okay, so the question is how do you go... 35 00:02:15,400 --> 00:02:16,240 Is that okay? 36 00:02:16,680 --> 00:02:17,160 Yeah? 37 00:02:17,680 --> 00:02:20,900 So, the question is how do you go from bytecode to source code? 38 00:02:21,140 --> 00:02:22,720 So, there are two ways. 39 00:02:22,860 --> 00:02:25,060 You can either go through a decompiler. 40 00:02:25,620 --> 00:02:27,220 There are a few popular ones. 41 00:02:27,540 --> 00:02:29,980 And that's where obfuscation becomes part of the problem. 42 00:02:30,000 --> 00:02:33,920 Part of the process of making your life hard in starting reverse engineering. 43 00:02:34,480 --> 00:02:34,560 Okay? 44 00:02:34,660 --> 00:02:44,100 So, the motivation behind this is trying to make code less readable from a human perspective, 45 00:02:44,340 --> 00:02:45,720 more than a machine perspective. 46 00:02:47,420 --> 00:02:49,120 What do obfuscators offer? 47 00:02:52,340 --> 00:02:59,820 Basic operations, remove debug information, change control flow, encrypt constant values. 48 00:03:01,700 --> 00:03:04,160 Inject unnecessary code to confuse you. 49 00:03:05,100 --> 00:03:06,940 And also, there's the usability element. 50 00:03:07,060 --> 00:03:08,500 So, where do we see obfuscators? 51 00:03:09,040 --> 00:03:15,980 Generally, it's Java standard edition applets, client-side applications that have some level of trust. 52 00:03:17,560 --> 00:03:23,560 We don't see it in the J2E sphere a lot, even though SAP will disagree. 53 00:03:25,420 --> 00:03:27,920 And it's applications that are delivered to the user. 54 00:03:30,000 --> 00:03:38,760 In terms of basic obfuscation techniques, you have renaming, extending objects, classes, superclasses, 55 00:03:39,720 --> 00:03:48,360 removing basic debug information, encoding string values, and also splitting loops. 56 00:03:51,520 --> 00:03:58,820 Now, in terms of reverse engineering particulars, you obtain an application code version. 57 00:04:00,080 --> 00:04:09,020 You extract the class files, and you try and establish quickly what level of obfuscation is in place. 58 00:04:09,440 --> 00:04:14,400 This is even being done in terms of scoping for penetration tests. 59 00:04:15,100 --> 00:04:21,880 It's a process that helps you identify how much time you need to reverse engineer a particular component or application. 60 00:04:25,240 --> 00:04:26,800 Who's using obfuscators? 61 00:04:28,080 --> 00:04:29,800 I wanted to bring up a browser. 62 00:04:33,980 --> 00:04:45,420 So, if we do a basic search for Java files that involve trade applications, for example, 63 00:04:46,120 --> 00:04:48,240 you start getting interesting hits. 64 00:04:55,200 --> 00:04:57,480 You would if I typed it correctly. 65 00:05:00,000 --> 00:05:06,340 So, you start getting, this application is containing trade secret information, et cetera, et cetera. 66 00:05:06,660 --> 00:05:10,920 There is some motivation for the work of deobfuscating code out there. 67 00:05:12,380 --> 00:05:23,980 As we're in Vegas, virtually every online gambling casino has a poker client. 68 00:05:24,780 --> 00:05:28,840 Some of them are written in Flash, Java, and they also have a no-download client, 69 00:05:28,840 --> 00:05:32,780 which typically runs as an applet, or it could be Flash. 70 00:05:35,440 --> 00:05:43,640 So, that's a big variety of people using Java client-side security, pretty much. 71 00:05:50,560 --> 00:05:53,260 Okay, so how do we go about attacking this? 72 00:05:53,440 --> 00:05:54,740 What are we trying to do? 73 00:05:55,520 --> 00:05:58,820 So, if we look at what people have done in terms of obfuscation, 74 00:05:58,840 --> 00:06:04,000 try and see what they're using as algorithms and methods. 75 00:06:04,320 --> 00:06:07,140 We can establish a methodology and build on that. 76 00:06:08,300 --> 00:06:10,840 Now, in terms of obfuscating transforms, 77 00:06:11,360 --> 00:06:14,160 so, how do you change the code that's already there? 78 00:06:14,380 --> 00:06:15,800 You can change the data. 79 00:06:16,020 --> 00:06:21,480 You can split variables, int x equals five becomes two plus three. 80 00:06:22,440 --> 00:06:27,300 You can promote scalers to objects, inheritance, split, merge arrays, 81 00:06:27,300 --> 00:06:29,500 and reorder instance variables. 82 00:06:30,280 --> 00:06:35,440 You've got layout obfuscation, so, scramble, identifiers, formatting, et cetera. 83 00:06:37,780 --> 00:06:42,280 You have control flow, if you like, obfuscation, clone methods, 84 00:06:44,500 --> 00:06:48,720 reducible loop and extended loop conditions, outline statements, 85 00:06:49,120 --> 00:06:54,180 and finally, you've got transforms which are in place for people like you and me 86 00:06:54,600 --> 00:06:57,280 to make the process of de-obfuscation work. 87 00:06:57,280 --> 00:06:59,680 So, that makes de-obfuscation harder and a lot more difficult. 88 00:07:05,380 --> 00:07:09,320 So, the way to start off this methodology, 89 00:07:09,560 --> 00:07:12,340 you have to have an entry point, 90 00:07:12,800 --> 00:07:15,800 and in terms of establishing one, 91 00:07:16,800 --> 00:07:20,160 it's a process of putting together a code, a program, 92 00:07:20,420 --> 00:07:24,480 an application that can serve as an identifier 93 00:07:25,140 --> 00:07:26,780 so that when you pass it through, 94 00:07:27,280 --> 00:07:31,300 the obfuscator, you know what the original state is. 95 00:07:31,420 --> 00:07:33,040 This is something we've seen in cryptography, 96 00:07:33,240 --> 00:07:37,120 plain text attacks, ciphertext attacks, et cetera, 97 00:07:37,860 --> 00:07:39,600 and it's not that new. 98 00:07:41,880 --> 00:07:45,200 The basic elements that are working to our advantage 99 00:07:45,200 --> 00:07:47,440 is that obfuscators these days are not, 100 00:07:48,680 --> 00:07:53,160 they're in very beta testing, beta slash testing phase. 101 00:07:54,560 --> 00:07:56,940 Obfuscation is uniform, so if you've got a GUI component, 102 00:07:56,940 --> 00:08:00,420 you know what GUI code is gonna look like. 103 00:08:01,460 --> 00:08:04,500 The same with IO operations. 104 00:08:05,780 --> 00:08:08,580 Design patterns will have a particular structure, 105 00:08:08,780 --> 00:08:11,000 so if they're using LIFOs, FIFOs, et cetera, 106 00:08:11,880 --> 00:08:16,140 and general obfuscators don't have a lot of algorithms 107 00:08:16,140 --> 00:08:20,120 embedded in them as choice of data of operation. 108 00:08:22,720 --> 00:08:24,600 So, the basic attack is, 109 00:08:26,120 --> 00:08:28,900 obfuscation is trying to make code harder to interpret. 110 00:08:29,600 --> 00:08:33,700 If we transform the notion of a plain text attack 111 00:08:33,700 --> 00:08:36,380 to that of having a code base 112 00:08:36,380 --> 00:08:37,800 that we knew what it looked like, 113 00:08:37,880 --> 00:08:39,520 we feed that through the obfuscator, 114 00:08:40,320 --> 00:08:44,980 and then from that, from black box perspective on that, 115 00:08:45,120 --> 00:08:48,540 we try to obtain and see what methodologies and algorithms 116 00:08:48,540 --> 00:08:51,000 that are embedded in terms of the transforms 117 00:08:51,000 --> 00:08:53,840 that I spoke about in the application. 118 00:08:57,140 --> 00:09:00,140 There's talk about encryption in obfuscation. 119 00:09:00,240 --> 00:09:01,080 This is really basic. 120 00:09:03,000 --> 00:09:04,560 It's mainly XOR operations. 121 00:09:04,760 --> 00:09:07,520 It's kind of rude to the crypto folks 122 00:09:07,520 --> 00:09:10,180 to talk about encryption at that level. 123 00:09:11,480 --> 00:09:13,540 There's little benefit, or at this stage, 124 00:09:13,620 --> 00:09:16,660 the word out there in terms of obfuscation 125 00:09:16,660 --> 00:09:19,700 is that there's little benefit in using strong crypto. 126 00:09:21,320 --> 00:09:24,260 There's no public private crypto offered that I've, 127 00:09:24,260 --> 00:09:24,880 I've come across. 128 00:09:25,960 --> 00:09:29,100 And generally, the only main place 129 00:09:29,100 --> 00:09:34,480 that you have obfuscation cryptography supposedly being used 130 00:09:34,480 --> 00:09:36,700 is when you're trying to hide string constants 131 00:09:36,700 --> 00:09:40,300 and values that the user sees, let's say, in the interface. 132 00:09:42,280 --> 00:09:47,100 So, what I've done is put together a fingerprinting tool 133 00:09:47,700 --> 00:09:50,220 that you give it your obfuscated code, 134 00:09:50,380 --> 00:09:53,660 and it tells you who wrote, 135 00:09:53,660 --> 00:09:55,760 wrote the obfuscation software. 136 00:09:56,680 --> 00:10:04,120 The idea is to build a list of particular obfuscators 137 00:10:04,120 --> 00:10:08,860 and then have some key operations that act as fingerprints 138 00:10:11,320 --> 00:10:13,280 through a calibration check. 139 00:10:13,520 --> 00:10:14,800 From those fingerprints, 140 00:10:15,200 --> 00:10:17,360 you can produce results which tell you 141 00:10:17,360 --> 00:10:19,340 what tool is being used. 142 00:10:22,100 --> 00:10:22,900 A tool. 143 00:10:23,300 --> 00:10:23,640 The basic idea, 144 00:10:23,640 --> 00:10:30,180 idea is that you feed a very generic class to an obfuscator. This is something we were 145 00:10:30,180 --> 00:10:37,140 discussing just now. Most of these tools are commercial and have a very high license, but 146 00:10:37,140 --> 00:10:45,240 you can feed one file through and send me the results and I can embed that in Elucidate. 147 00:10:45,460 --> 00:10:52,740 What is Elucidate? Elucidate is a Perl script at this stage. It's not really advanced in 148 00:10:52,740 --> 00:10:57,740 any way in terms of programming that has all these fingerprinting signatures inside it. 149 00:10:58,600 --> 00:11:08,500 You run it against a particular jar or class file that you might have and you check whether 150 00:11:08,500 --> 00:11:15,040 or not the obfuscator used can be fingerprinted through what's already there. There's a big 151 00:11:15,040 --> 00:11:17,300 overlap and we'll come on to that during the demo. 152 00:11:20,640 --> 00:11:22,720 What does this tool do? 153 00:11:22,740 --> 00:11:34,460 The basic idea is, I think it's time to bring up a command prompt. Can you guys see that 154 00:11:34,460 --> 00:11:46,660 okay? No? Maybe? Bigger. This is going to get a bit messy. 155 00:11:53,120 --> 00:12:04,820 Yeah. You've got a few obfuscators that are supported within this application. The basic 156 00:12:04,820 --> 00:12:20,820 idea of Elucidate is take a file as input in a particular directory that you might have. It will 157 00:12:20,820 --> 00:12:22,440 tell you that it's found it to have a 158 00:12:22,440 --> 00:12:27,640 match against the list of obfuscators it's supporting. Now if we do this in a 159 00:12:27,640 --> 00:12:36,020 bit more verbose manner I'll show you exactly what it's doing. So it's picking 160 00:12:36,020 --> 00:12:41,640 up particular bytecode operations in a sequence and interpreting potential key 161 00:12:41,640 --> 00:12:47,040 values and on that basis it's saying well this operation you either have a very 162 00:12:47,040 --> 00:12:52,340 silly developer doing repetitive operations of this sort inside a class 163 00:12:52,340 --> 00:12:57,580 file or the code has been obfuscated using this technique, this tool. 164 00:12:59,040 --> 00:12:59,640 Now 165 00:13:12,320 --> 00:13:16,920 the target deliverables of this little tool is as I said providing 166 00:13:16,920 --> 00:13:21,720 a jar file, identify what obfuscators have been used and recover strings which 167 00:13:21,720 --> 00:13:26,620 are within that file supposedly been encrypted. This is really basic version 168 00:13:26,620 --> 00:13:33,080 0.1 stuff. The main development behind it came from trying to understand here's an 169 00:13:33,080 --> 00:13:36,780 applet, how much time do you need to spend on it in order to reverse this 170 00:13:36,780 --> 00:13:42,200 applet. So you can get an estimate of the complexity, that's the long-term goal, 171 00:13:42,360 --> 00:13:46,760 and also map out particular sections of the code and it's very easy to generate 172 00:13:46,760 --> 00:13:46,900 a 173 00:13:46,900 --> 00:13:52,720 graph around this idea. Now if we look at the particular fingerprints that are 174 00:13:52,720 --> 00:13:59,980 within particular tools you have ZX Class Master is just an example and 175 00:13:59,980 --> 00:14:05,220 they're using string encryption for example. So if you look at the string 176 00:14:05,220 --> 00:14:09,340 values here in the bytecode they definitely don't look like normal ASCII 177 00:14:09,340 --> 00:14:15,460 printable text. They're using special characters again, very rare that you see 178 00:14:15,460 --> 00:14:16,600 those within code. 179 00:14:16,600 --> 00:14:23,480 They're using code written for a particular GUI or I.O. operation. And you have a 180 00:14:23,480 --> 00:14:27,960 particular signature that looks like this. Now if you do a match on this against 181 00:14:27,960 --> 00:14:34,640 the file you have a very high probability of catching an obfuscator. 182 00:14:34,880 --> 00:14:40,580 Okay. This is what I did before. Now the interesting thing is that you can take 183 00:14:40,580 --> 00:14:46,580 this to the next level which is actually get a map of where the code is being used. 184 00:14:46,600 --> 00:14:51,180 This is what the code is within the obfuscated application. But we'll come on to that towards 185 00:14:51,180 --> 00:14:51,540 the end. 186 00:14:53,960 --> 00:15:00,040 It has various modes of operation and again you can build on each one. The fundamental 187 00:15:00,040 --> 00:15:07,380 concept behind catching obfuscation is that it has to run. So it has to run. It has to 188 00:15:07,380 --> 00:15:14,440 be interpreted in terms of machine code language. If we look at another product, Jshrink, it's 189 00:15:15,580 --> 00:15:16,360 doing a 190 00:15:16,360 --> 00:15:23,280 similar thing to string encryption. Okay. So it's calling an i.i method which obviously 191 00:15:23,280 --> 00:15:28,800 has been renamed and then it's passing an integer argument and it's doing it in a static 192 00:15:28,800 --> 00:15:29,760 way as well. 193 00:15:31,440 --> 00:15:37,360 So straight away you have certain contents within the app without even looking at the 194 00:15:37,360 --> 00:15:40,780 bytecode that can tell you what the tool is using. 195 00:15:40,860 --> 00:15:45,260 What these guys have done is they've created an invalid GIF file. They've dumped all the 196 00:15:45,260 --> 00:15:46,240 string literals in 197 00:15:46,240 --> 00:15:54,820 there in obviously nonprintable text and then they're calling a reference point which 198 00:15:54,820 --> 00:16:00,400 is the integer of the array and feeding it through an XOR operation and recovering the 199 00:16:00,400 --> 00:16:01,460 text that they want to use. 200 00:16:04,740 --> 00:16:09,700 Again this is what their code looks like if you put the effort in reverse engineering 201 00:16:09,700 --> 00:16:16,000 it. Basic operations. And the interesting thing if you look at the last line in the 202 00:16:16,000 --> 00:16:24,660 bottom is that they've broken the i.gif call. So if your strings grep for a GIF anywhere 203 00:16:24,660 --> 00:16:31,100 in the source code, you'll have very little luck finding it. At the same time, it's not 204 00:16:31,100 --> 00:16:36,280 that hard to put together that the call to the file is being made somewhere from a static 205 00:16:36,280 --> 00:16:36,820 location. 206 00:16:40,480 --> 00:16:45,980 Again, what I just described. And then you have people looking at the source code and 207 00:16:46,000 --> 00:16:48,620 then you have people who don't really look at string encryption and that's good because 208 00:16:48,620 --> 00:16:56,540 it makes my task a lot harder. I've got to go and look at how the obfuscate for loops, 209 00:16:56,780 --> 00:17:02,900 while loops, etc. And at the same time, there's no deliverable in terms of recovering 210 00:17:03,480 --> 00:17:08,480 key operations that the obfuscator does. If you learn how you can crack string encryption, 211 00:17:08,740 --> 00:17:14,760 you can take that exact same process and see how they've decided to swap around while loops 212 00:17:14,760 --> 00:17:15,340 for example. 213 00:17:16,000 --> 00:17:20,660 Because as I've said, the application, the obfuscator application is using a very limited 214 00:17:20,660 --> 00:17:24,600 and set technique of algorithms to obfuscate. 215 00:17:27,480 --> 00:17:34,900 Now before we come to the conclusions, it's worth showing you what elucidate can do. Again, 216 00:17:35,040 --> 00:17:36,520 let me bring the magnifier up. 217 00:17:40,260 --> 00:17:43,660 Oh, okay. Oh, hold on. Can we do that? 218 00:17:49,040 --> 00:17:58,060 Okay, so if you take a typical application like a jar file and unzip that or pass it 219 00:17:58,060 --> 00:18:05,240 through elucidate, then you have a number of a.class, b.class, c.class files. If you 220 00:18:05,240 --> 00:18:10,580 open those up in a decompiler to follow some basic reverse engineering calls, you see that 221 00:18:10,580 --> 00:18:15,380 they're calling a.a method, a.b method, etc. It's very frustrating. 222 00:18:16,120 --> 00:18:20,760 So, the basic idea is that if you supply a directory, let's say, it does it with files, 223 00:18:21,340 --> 00:18:27,000 directories, that's the easy part. It will pick up... 224 00:18:32,300 --> 00:18:43,820 Yeah, okay. Okay, so if we just see what we're doing here, we're recursing through 225 00:18:43,820 --> 00:18:44,240 the directory. 226 00:18:44,380 --> 00:18:44,680 Okay. 227 00:18:46,000 --> 00:18:50,800 So, if we take a string literals file, the fingerprint is matching that of zelix. Hey, 228 00:18:50,980 --> 00:18:55,680 well, zelix has a set algorithm in terms of string encryption, so we can provide more 229 00:18:55,680 --> 00:19:01,560 information back to the user. The keys change dynamically, so they're not embedded every 230 00:19:01,560 --> 00:19:06,160 time, even though the pseudo algorithm they're using, I don't think it's very solid. And 231 00:19:06,160 --> 00:19:10,940 then if you take the string literals which have been identified within the application, 232 00:19:12,460 --> 00:19:15,900 obviously they've been encrypted. And if we... 233 00:19:15,900 --> 00:19:22,200 We do the XOR operation of the five keys on top of the string literals, we get the 234 00:19:22,740 --> 00:19:26,260 actual values which you can have inside the application. 235 00:19:28,800 --> 00:19:34,760 So it gives you... It fulfills its role in terms of giving you an entry point and a map 236 00:19:35,240 --> 00:19:39,260 towards attacking the application. You'll know what part is a GUI and you'll know what 237 00:19:39,260 --> 00:19:44,920 part is actually something which might be a bit more custom made, a protocol, an algorithm, 238 00:19:45,100 --> 00:19:45,480 etc. 239 00:19:54,960 --> 00:20:03,240 To finish off, we have pretty much obfuscation being at a primitive level today. I think 240 00:20:03,240 --> 00:20:08,380 it's something that we're going to see a lot more. It's very frustrating as an idea for 241 00:20:08,380 --> 00:20:14,000 people that spend time reverse engineering because it's regarding... It's regarded as 242 00:20:14,000 --> 00:20:14,600 a middle tier. 243 00:20:14,960 --> 00:20:15,600 But... 244 00:20:15,900 --> 00:20:25,300 There's both Java and .NET out there, especially .NET 3, that use virtual machines to load 245 00:20:25,300 --> 00:20:25,880 up the code. 246 00:20:27,740 --> 00:20:35,820 An excellent entry point is seeing where the string values are and seeing exactly what 247 00:20:35,820 --> 00:20:36,480 they represent. 248 00:20:37,580 --> 00:20:42,520 And in terms of identifying the crypto used, we can see what tool is being used and we 249 00:20:42,520 --> 00:20:45,880 can see what changes to expect within the obfuscation. 250 00:20:45,900 --> 00:20:49,220 So we're starting to get a feel of the algorithms they're using. 251 00:20:51,040 --> 00:20:56,500 Now in terms of providing a problem, which I think I'm doing here, you can also provide 252 00:20:56,500 --> 00:20:57,040 a solution. 253 00:20:57,840 --> 00:21:05,260 And the solution to this space is... It's an idea. I think it will have a lot of potential. 254 00:21:05,420 --> 00:21:06,880 Maybe it's early days for this. 255 00:21:07,400 --> 00:21:13,380 Is the proposal to use polymorphic obfuscation. What's polymorphic obfuscation? It's not just 256 00:21:13,380 --> 00:21:14,160 a fancy term. 257 00:21:14,260 --> 00:21:14,620 It's... 258 00:21:15,900 --> 00:21:20,220 You need to engage the development team if you want your code not to be easily reverse 259 00:21:20,220 --> 00:21:26,160 engineered and have a heavier hurdle of obfuscation and map out the critical elements. 260 00:21:26,540 --> 00:21:33,600 And then you understand what an obfuscator does and use different elements of the application 261 00:21:34,700 --> 00:21:39,680 will be obfuscated in a different way because you'll be feeding different algorithms to 262 00:21:39,680 --> 00:21:39,920 it. 263 00:21:40,620 --> 00:21:42,900 That's where polymorphic comes in as a notion. 264 00:21:44,960 --> 00:21:50,520 So the... Any user interaction will be treated differently to a protocol implementation in 265 00:21:50,520 --> 00:21:55,000 terms of reversing any part of, let's say, string literals that I just demonstrated. 266 00:21:58,180 --> 00:22:01,940 And the last thing is vary the algorithms a lot more. 267 00:22:02,840 --> 00:22:09,540 This is something that I think we'll be seeing a lot more. At the same time, it's an element 268 00:22:09,540 --> 00:22:10,300 that... 269 00:22:11,100 --> 00:22:12,880 We're nowhere near this... 270 00:22:12,880 --> 00:22:16,360 We're nowhere near this stage because most of the tools out there are not in the public 271 00:22:16,360 --> 00:22:16,660 domain. 272 00:22:16,840 --> 00:22:20,260 So we can't easily provide information around them. 273 00:22:24,980 --> 00:22:25,640 That's it. 274 00:22:25,800 --> 00:22:26,880 Are there any questions? 275 00:22:31,080 --> 00:22:31,840 Gentleman here. 276 00:22:32,260 --> 00:22:32,860 . 277 00:22:38,520 --> 00:22:39,160 Thank you. 278 00:22:39,680 --> 00:22:39,920 Thank you. 279 00:22:40,200 --> 00:22:40,800 Thank you. 280 00:22:40,860 --> 00:22:41,620 Thank you. 281 00:22:42,260 --> 00:22:42,860 Thank you. 282 00:22:45,060 --> 00:22:48,440 You can do that. You're making your life more difficult. 283 00:22:48,760 --> 00:22:59,180 They are really not at the level of doing any advanced operations in terms of deciphering 284 00:22:59,180 --> 00:23:02,620 what the application is doing, the obfuscation application is doing. 285 00:23:02,840 --> 00:23:06,580 So I think in the future, yes, but at this stage, no. 286 00:23:07,980 --> 00:23:08,580 . 287 00:23:08,580 --> 00:23:09,760 . 288 00:23:09,760 --> 00:23:10,700 . 289 00:23:12,260 --> 00:23:12,860 . 290 00:23:30,660 --> 00:23:37,540 This presentation is the tip of a very large iceberg and yes, you've got to avoid a couple 291 00:23:37,540 --> 00:23:41,860 of checksums and you don't want to trigger the sandbox, but you can do real-time patching 292 00:23:41,860 --> 00:23:43,700 in Java and .NET. 293 00:23:45,500 --> 00:23:46,020 Sure. 294 00:24:00,020 --> 00:24:02,680 Well, this is the thing, you have... 295 00:24:02,680 --> 00:24:04,940 This is exactly a very interesting element. 296 00:24:05,060 --> 00:24:11,840 You've got obfuscators that break a while loop in a way that's a known bug in JVM 297 00:24:11,840 --> 00:24:15,720 1.4 is going to be triggered that will generate an infinite loop. 298 00:24:16,980 --> 00:24:25,200 So the element in the IELTS code being passed through the VM is being used for obfuscation, 299 00:24:25,340 --> 00:24:28,060 but it's a very rare instance at this stage. 300 00:24:28,440 --> 00:24:35,320 Do you find cases where the obfuscated code is not allowed to be set up anywhere on the 301 00:24:35,320 --> 00:24:35,880 normal ? 302 00:24:37,960 --> 00:24:38,560 Yeah. 303 00:24:38,660 --> 00:24:38,880 Sure. 304 00:24:39,200 --> 00:24:40,420 You have... 305 00:24:40,420 --> 00:24:41,060 . 306 00:24:41,840 --> 00:24:42,460 You have more than one instance. 307 00:24:42,640 --> 00:24:43,240 Here's an example. 308 00:24:43,400 --> 00:24:44,220 If you're using... 309 00:24:44,220 --> 00:24:44,780 I don't know. 310 00:24:44,860 --> 00:24:51,320 Let's say you're using the Apache Commons HTTP client and you're deploying a little 311 00:24:51,320 --> 00:24:53,620 jar file that does whatever. 312 00:24:54,720 --> 00:25:04,160 If you obfuscate that, then the call to, let's say, the SSL proxy class, which negotiates 313 00:25:04,160 --> 00:25:08,760 SSL, can't be made because that can only be made by reference, by name. 314 00:25:08,940 --> 00:25:11,620 So it breaks the application in real time. 315 00:25:11,840 --> 00:25:14,200 But you'd never see that... 316 00:25:14,840 --> 00:25:19,660 Well, you'll catch it in UAT, but you'll never see it during development. 317 00:25:26,100 --> 00:25:26,940 . 318 00:25:26,940 --> 00:25:27,820 . 319 00:25:27,820 --> 00:25:28,580 . 320 00:25:28,580 --> 00:25:29,700 . 321 00:25:29,700 --> 00:25:31,100 . 322 00:25:31,100 --> 00:25:31,440 . 323 00:25:32,380 --> 00:25:33,220 . 324 00:25:33,220 --> 00:25:33,260 . 325 00:25:38,560 --> 00:25:39,400 . 326 00:25:39,400 --> 00:25:40,640 . 327 00:25:40,640 --> 00:25:40,700 . 328 00:25:40,700 --> 00:25:40,860 . 329 00:25:40,860 --> 00:25:41,820 . 330 00:25:42,840 --> 00:25:43,960 It's a big debate. 331 00:25:44,200 --> 00:25:47,200 You can trust the application, then do you trust the operating system? 332 00:25:47,800 --> 00:25:50,820 It opens another avenue. 333 00:25:51,100 --> 00:25:57,280 The worrying thing is that if you take something elucidate, which as I've said, is a Perl script, 334 00:25:58,140 --> 00:26:04,100 there's not a lot of magic in it, and do the basic googling that I just demonstrated 335 00:26:04,660 --> 00:26:09,680 and run that on jar files, you start getting some results back which are worrying. 336 00:26:10,020 --> 00:26:10,540 . 337 00:26:10,540 --> 00:26:17,800 There are a lot of people putting client-side trust out there in very weird ways in the 338 00:26:17,800 --> 00:26:22,700 name of obfuscation, which is a tick in the box in an IDE environment. 339 00:26:39,180 --> 00:26:47,480 There's an excellent chapter in Hacking Java Exposed about how you can bypass the class 340 00:26:47,480 --> 00:26:49,540 loader that does exactly that. 341 00:26:49,920 --> 00:26:52,680 If you combine profiling the environment you'll get a lot of good data. 342 00:26:52,700 --> 00:26:58,860 the application at a basic level with triggering your own class loader, then even a signed 343 00:26:58,860 --> 00:27:06,460 applet can be, because you have the code in your runtime environment, can open up and 344 00:27:06,460 --> 00:27:10,340 be reverse engineered in a normal kind of way. 345 00:27:39,660 --> 00:27:45,200 A nice analogy is that you're signing for a nail bomb but you're still getting the nail 346 00:27:45,200 --> 00:27:50,080 bomb delivered to you. So, you're signing for a part of code that's potentially trustworthy 347 00:27:50,080 --> 00:27:55,860 and secure, but, and that's really interesting because it's a recent project of mine that 348 00:27:56,340 --> 00:28:01,700 if you take an obfuscated app, no one knows what's inside it. Well, no one really knows 349 00:28:01,700 --> 00:28:05,800 what's inside it. And if you sign that, but if you sign the 350 00:28:05,800 --> 00:28:06,440 original code... 351 00:28:06,440 --> 00:28:11,560 part of the code then you can do a lot more so you can you can tweak you can 352 00:28:11,560 --> 00:28:15,520 reverse the model if you can see what I what I'm saying in there so it can work 353 00:28:15,520 --> 00:28:19,960 you your disadvantage adding all these features which are bypassable the 354 00:28:19,960 --> 00:28:25,160 fundamental problem is client-side security in one way or another you you 355 00:28:25,160 --> 00:28:27,180 can influence that and you can have a huge impact 356 00:28:32,840 --> 00:28:36,240 I mean look okay let's go through the scenario you've got a certificate the 357 00:28:36,240 --> 00:28:41,400 certificate spawns up and says this has been signed by XYZ great it's using 358 00:28:41,400 --> 00:28:46,500 this library this library is obfuscated great and then at runtime you load a 359 00:28:46,500 --> 00:28:52,960 class loader and you patch that library okay okay so but you must have some some 360 00:28:52,960 --> 00:28:57,920 level of influence on the client-side environment the user will still see you 361 00:28:57,920 --> 00:29:00,780 haven't triggered a worm you haven't owned the operating system it's it's 362 00:29:00,780 --> 00:29:05,360 basic stuff the user will still trust the application because of the 363 00:29:05,360 --> 00:29:05,640 certificate 364 00:29:06,740 --> 00:29:13,340 okay but they'll still trigger whatever I want them to trigger so it's it's it's 365 00:29:13,340 --> 00:29:18,700 a two-fold game in a way you can take obfuscation and use it to an attacker's 366 00:29:18,700 --> 00:29:23,020 advantage which is the scary element because no longer do you know 367 00:29:23,020 --> 00:29:27,280 afterwards where the library calls match out in terms of your code you can't even 368 00:29:27,280 --> 00:29:29,680 do memory profiling in an efficient way 369 00:29:37,760 --> 00:29:39,920 okay I think that's all thank you very much 370 00:29:41,100 --> 00:29:41,580 you