00:00:00.033,00:00:05.072 >>I want to bring up, ah Doctor, and Doctor, who are going to talk about, ah the-the-the Jop 00:00:05.072,00:00:11.511 Rocket. Yeah, let’s give these gentlemen a big round of applause [Applause] Have a good 00:00:11.511,00:00:17.618 time. >>Alright, [Noise] thank you very much. Alright, thank you, um. Welcome everyone, ah as 00:00:17.618,00:00:21.822 mentioned we’re gonna be introducing and talking about the JOP Rocket. Ah, and so in a 00:00:21.822,00:00:28.428 few minutes you’ll learn about the supremely wicked tool for JOP Gadget Discovery. With me is 00:00:28.428,00:00:32.866 Doctor Bramwell Brizendine, he is the creator of the JOP Rocket, ah you’ll find more 00:00:32.866,00:00:39.373 information about the JOP Rocket at JOP Rocket dot com as well as the GitHub and, ah I don’t see 00:00:39.373,00:00:43.176 it here but it’s a link later on in the slide so I’ll get to it in a moment. Ah, Bramwell’s an 00:00:43.176,00:00:47.414 assistant professor at the Dakota State University and, um, you can see his contact 00:00:47.414,00:00:52.052 information at the bottom. My name’s Josh Stroschein, I’m also an assistant professor at Dakota 00:00:52.052,00:00:56.723 State and was the chair for Bramwell’s dissertation, which is where this work was, ah, 00:00:56.723,00:01:01.461 really focused and conducted under. My contact information is also at the bottom of the slide. 00:01:01.461,00:01:05.632 [Pause] A couple of quick acknowledgements, ah Austin Babcock, undergraduate research 00:01:05.632,00:01:11.004 assistant at DSU as well, he’s studying cyber operations and he put together the JOP exploit 00:01:11.004,00:01:15.676 that you’ll see here towards the end of our presentation. Um, he is looking for any opportunities 00:01:15.676,00:01:19.580 for internship and work, so if you’re looking for a very talented student, please feel 00:01:19.580,00:01:23.317 free to contact him, or reach out to Bramwell or myself we-we’ll be happy to put you in 00:01:23.317,00:01:29.356 contact. Ah, we also would like to thank Doctor Jared DeMott of VDA Labs, um he is a part of the 00:01:29.356,00:01:33.493 dissertation committee as well as-as a well renowned security researcher, so a big thanks to 00:01:33.493,00:01:37.431 him. So, what are we gonna to talk about today, quick in twenty minutes? Ah, we’re gonna 00:01:37.431,00:01:41.768 spend a few moments on ROP, ROP’s important to understand in order to understand JOP, ah 00:01:41.768,00:01:45.973 we’re gonna get into JOP Jump-Oriented Programming. More importantly, you’ll get to know 00:01:45.973,00:01:51.178 the JOP Rocket a little bit better, some of the finer points of JOP exploit development and 00:01:51.178,00:01:55.415 then it will be time to take a ride on the JOP Rocket itself. And I’m gonna leave that up to 00:01:55.415,00:02:01.855 Bramwell [Pause] So, this begs the question, ah did this work in Invent JOP, it did not. There 00:02:01.855,00:02:05.659 is some references in the literature that goes back about a decade, however, it was 00:02:05.659,00:02:10.597 sparse. There aren’t a lot of tools or, um other frameworks that are available to help 00:02:10.597,00:02:15.969 further learn, explore or utilize JOP in your-your daily exploit endeavors. Um, so this 00:02:15.969,00:02:20.507 work really endeavors to fill that gap to provide more literature and in-in addition it 00:02:20.507,00:02:25.178 also will do this in a Windows environment, so, um, again not a lot of information there for 00:02:25.178,00:02:31.051 doing JOP on Windows. Ah, what is JOP, well simply put, it creates a side door if your 00:02:31.051,00:02:35.956 having trouble with your exploit chains with ROP and the ROP heuristics being detected, then 00:02:35.956,00:02:42.262 JOP may allow you to bypass those mitigations and ultimately get shellcode to execute. We’re 00:02:42.262,00:02:47.401 not trying to oversell the JOP Rocket though, because JOP is just another category of 00:02:47.401,00:02:53.974 code-reuse attack, it is not another category of exploit. [Pause] A little background, ah 00:02:53.974,00:02:59.746 you can go back to the late 90’s with the Return-to libc, ah ret2libc, ah that opened the 00:02:59.746,00:03:05.218 door for ROP Return-oriented Programming. Um, ROP borrows little chunks of code that end 00:03:05.218,00:03:09.489 in RET’s and there’s a couple of important concepts that come along with this. Ah, we have 00:03:09.489,00:03:13.794 gadgets which are instructions, or a series of instructions that end in a RET and then we have 00:03:13.794,00:03:18.999 our chains and those chains, ah, simply are then a series of gadgets that do something 00:03:18.999,00:03:23.770 practical like call a function in the Windows API. Um, important thing to note here, is 00:03:23.770,00:03:29.576 that these, ah with ROP we’re really dependent upon the stack in order to control the flow, 00:03:29.576,00:03:34.748 the execution of our ROP chain. That changes a little bit with-with JOP. Um, com-some 00:03:34.748,00:03:39.419 prevalent tools, ah ones that-that likely you have all used before. Ah, would be MONA 00:03:39.419,00:03:44.691 by the Corelan team and-and Peter Van Eeckhoutte as well as the ROP gadget. Here’s an 00:03:44.691,00:03:49.362 example of a ROP chain generated by MONA, ah as you can see the addresses that are gonna be 00:03:49.362,00:03:53.233 placed on the stack as part of the payload. Um, those are the addresses that are gonna be 00:03:53.233,00:03:59.306 [Stutters] fetched, um after the gadget itself is executed and ends in a RET. So, again going 00:03:59.306,00:04:05.178 back to the stack in order to control the execution, the flow of that entire chain. So, 00:04:05.178,00:04:11.251 Jump-oriented Programming or JOP, differs, ah in that we’re using JMP and CALL instructions 00:04:11.251,00:04:16.423 in order to control the flow. So, JOP is really just ROP without the RET’s. Ah, while the 00:04:16.423,00:04:22.329 stack is not available for the control flow, it is still, it is still necessary to use the stack 00:04:22.329,00:04:26.533 in order to set up and-and make calls to the Windows API. Because, remember we’re focused 00:04:26.533,00:04:30.403 on the Windows API here. A couple of different paradigms, we have the dispatcher gadget, 00:04:30.403,00:04:34.608 the dispatch table, we’ll get into more details here in just a few minutes. The JOP Rocket does 00:04:34.608,00:04:38.778 use both of those, that’s the approach that’s it’s taken. Um, there’s also some different 00:04:38.778,00:04:43.750 techniques available with JOP that you can use in your everyday ROP. So, ah a Pop Jump, 00:04:43.750,00:04:48.989 where you pop into a register and then jump to that register in order to, ah go back to the 00:04:48.989,00:04:54.327 stack for example, ah, if you’re having trouble finding, ah you know your ROP gadgets. So, you 00:04:54.327,00:05:00.700 can JOP and then go back to ROP. [Pause] So, about those two paradigms that we [Stutters] 00:05:00.700,00:05:05.172 that I mentioned just previously, ah the dispatcher gadget and the dispatch table. 00:05:05.172,00:05:09.776 The dispatcher gadget is the instrument of change, it moves things forward and backwards in 00:05:09.776,00:05:15.315 that dispatch table. It ideally should be short and sweet, and it should also be predictable. 00:05:15.315,00:05:20.987 It should predictably modify the register holding the address to that dispatch table. Ah, the 00:05:20.987,00:05:25.192 dispatch table then has entries that lead to the addresses of the functional gadgets and the 00:05:25.192,00:05:31.698 functional gadgets are what really, um allow us to-to modify registers and set up a stack in 00:05:31.698,00:05:38.605 order to make our Windows [Stutters] API calls. [Pause] Here is a, maybe somewhat over 00:05:38.605,00:05:43.310 simplified control flow diagram. You have the dispatcher gadget, which controls flow into the 00:05:43.310,00:05:47.981 dispatch table, which then dereferences and calls those different dispatch gadgets. Ah, 00:05:47.981,00:05:52.786 or functional gadgets, excuse me. Um, from there instructions are executed that are feel a bit 00:05:52.786,00:05:56.857 like ROP, ah and then you’ll jump or call back to the dispatcher gadget and the cycle 00:05:56.857,00:06:00.994 will continue to repeat until you’ve accomplished whatever functionality that you’re out, 00:06:00.994,00:06:05.999 ah to get. That's, my part was brief, so, ah I’m gonna let Bramwell take it from there. 00:06:09.836,00:06:14.975 [Pause] >>Thank you, Josh. So, all this kind of begs the question is, why is JOP not much 00:06:14.975,00:06:21.381 used? Ah, in fact, ah in 2015, one person even claimed that JOP had never been used in the wild, 00:06:21.381,00:06:26.386 in the wild. Of course, that was wrong, it has been but only very very rarely. So, some of the 00:06:26.386,00:06:31.391 reasons for that, ah probably lack of proper tooling, we just don’t have tools to find JOP and 00:06:33.460,00:06:39.065 if you’re trying to do JOP that-that’s a serious problem. JOP is also much trickier, it’s 00:06:39.065,00:06:44.604 less well understood whereas with ROP it’s very well documented, ah great literature 00:06:44.604,00:06:50.310 that exits, great tools that are available to facilitate that. There’s difficulty in finding 00:06:50.310,00:06:56.916 JOP gadgets. Ah, from a couple of different perspectives. First, ah just the number of JOP 00:06:56.916,00:07:03.256 gadgets relative to ROP gadgets is much-much fewer so that makes it much more challenging to 00:07:03.256,00:07:07.761 find, to find the right gadgets. Ah, secondly if you don’t have a dedicated tool then it can make 00:07:07.761,00:07:12.766 it, um, difficult or even impossible to find enough, ah gadgets, and the reasons for 00:07:14.801,00:07:20.273 that is op-code splitting. So, our-our ROP tools are MONA, so on and so forth, will do the 00:07:20.273,00:07:25.078 op-code splitting. But if you try just use general purpose reverse engineering tools, it’s 00:07:25.078,00:07:31.184 not going to, ah very easily, readily-readily allow you to-to do that. So, then it would be 00:07:31.184,00:07:35.288 kind of a manual process that could be tedious and time consuming. Just like it would, 00:07:35.288,00:07:40.026 the same would be if you try to do it with-with ROP, if you didn’t have a tool such as-as 00:07:40.026,00:07:46.566 MONA. So, you gotta be real grateful for-for those, ah different tools. [Pause] So, 00:07:46.566,00:07:51.604 JOP, yes, it is a little bit more complex. Um, folks don’t-don’t really know too much 00:07:51.604,00:07:55.508 about it, ah don’t know how to use it and it’s-it’s understandable because there’s 00:07:55.508,00:08:00.780 not much, there’s written about it, there’s some that’s written in the academic literature. Ah, 00:08:00.780,00:08:07.587 and additionally there [Pause] I mean, if you try to search for, ah-ah articles on how to use it 00:08:07.587,00:08:12.392 in Windows, you just won’t find anything, ah, for the most part. Ah, so that’s perfectly 00:08:12.392,00:08:16.463 understandable, ah with JOP, you also have to pay attention to registers that are being used 00:08:16.463,00:08:20.734 for the dispatcher gadget, for the dispatch table. And those, if you tie those registers up 00:08:20.734,00:08:26.406 then you can’t use them for other purposes, so that,ah just adds to the complexity, adds to 00:08:26.406,00:08:32.011 the chaos. We need the dispatcher gadget too, it’s a very rare, very scarce gadget, 00:08:32.011,00:08:36.383 if we can’t find it then we can’t do the dispatcher gadget, ah paradigm. So, that could be 00:08:36.383,00:08:41.654 problematic. Of course, you can still try the POP X, the JMP X, ah paradigm, you could even 00:08:41.654,00:08:48.461 temporarily do ROP and then do a little bit of JOP, that’s entirely possible. So, many of 00:08:48.461,00:08:53.299 you are probably familiar with ROP and you may be masters of ROP. The good news is a lot of 00:08:53.299,00:09:00.006 that can carry over, so. Ah, some of those ROP techniques will also apply to JOP as well. 00:09:00.006,00:09:06.046 So, at this point we want to, ah introduce the JOP Rocket. Ah, honor the sacrifice that, ah 00:09:06.046,00:09:11.051 ancient Rocket cats made so many centuries ago to deliver their ma-malicious payload. Ah, so 00:09:13.119,00:09:17.590 we‘ll do a bit of history lesson, I guess in the 1300’s there-there were, ah so called 00:09:17.590,00:09:23.496 rocket cats that would have explosives, ah strapped to their back and they would, um be able 00:09:23.496,00:09:30.036 to, ah sub-subvert ah the defenses of a well defended castle to deliver their payload. 00:09:30.036,00:09:36.109 JOP Rocket tries to do the same thing, ah we can get passed ROP heuristics. Um, so very 00:09:36.109,00:09:41.281 sophisticated tools Python script, ah has dependencies that are required, can run in a 00:09:41.281,00:09:47.887 windows environment, can-can run in, ah Linux. Um, it is static analysis, ah and the only reason 00:09:47.887,00:09:51.257 I did that, is simply from a programming standpoint, it made it more challenging, more 00:09:51.257,00:09:55.462 difficult to-to write it rather than something that would integrate with an active 00:09:55.462,00:10:00.633 process. You can take it an executable or Pee, you’re gonna scan it as well as all the 00:10:00.633,00:10:05.638 associated modules and DLL’s. Ah, the JOP Rocket features, ah [Pause] command line,ah user 00:10:08.641,00:10:15.215 interface. Ah, it accepts brief, ah keyboard shortcuts. Ah, very easy to memorize, very easy to 00:10:15.215,00:10:20.487 quickly utilize them. It also has a convenient get everything option, ah which we’ll talk 00:10:20.487,00:10:26.693 about in a little bit here. So, some of the features of the JOP Rocket, ah tremendous 00:10:26.693,00:10:31.931 flexibility in terms of how we can discover the different gadgets, um both functional and 00:10:31.931,00:10:36.836 dispatcher gadgets. So, there are reasonable defaults but if you’re not finding what you want 00:10:36.836,00:10:42.075 you can enlarge, you can mirror the scope. As it goes through and acquired the gadget, it 00:10:42.075,00:10:47.180 performs classification into dozens of categories based on the operation. For instance, is 00:10:47.180,00:10:53.086 it adding, is it doing SUB and also on the registers that are affected. So, the use, ah the 00:10:53.086,00:10:58.525 user can be very specific [Stutter] about, you know, what you, ah want-want to acquire. 00:10:58.525,00:11:05.198 Also, as an option to get everything, ah printed as a CSV, ah so that can be incredibly 00:11:05.198,00:11:09.235 useful if you want to gain insights into whether or not a spec-specific binary would have 00:11:09.235,00:11:14.240 enough gadgets to perhaps, ah support JOP. [Pause] Ah, it does feature opcode-splitting, ah the 00:11:16.643,00:11:20.613 challenge with opcode-splitting is, if you do it from a [Unknown] program and you go 00:11:20.613,00:11:24.717 for-for the C3 or the [Unknown], or one of the variations disassembled backwards and 00:11:24.717,00:11:29.389 numerate everything. With ROP you’re looking for the, ah OP codes for many different 00:11:29.389,00:11:34.394 indirect calls or indirect jumps. So, there’s a lot more to [Stutters] ah, consider there. 00:11:37.430,00:11:42.969 [Pause] Contributions of the, JOP, ah Rocket just from, ah a standpoint of how its, ah built 00:11:42.969,00:11:47.073 and how its put together, it does a lot of things in kind of an original, unique fashion, and 00:11:47.073,00:11:53.379 the reason for that is just not wanting to ape or mimic the, ah contributions of others but just 00:11:53.379,00:11:57.750 to try to do something, ah in my own fashion. But maybe not particularly interesting in 00:11:57.750,00:12:02.689 terms of how to, ah perform JOP. So, how do we, ah utilize the JOP Rocket? Ah, it is again a 00:12:05.592,00:12:10.597 static analysis tool, ah we do run it from the, ah command line. Ah, it can, ah support any 00:12:12.765,00:12:19.339 platform that has the necessary dependencies, um. Now, since it is targeted towards Windows, if 00:12:19.339,00:12:24.711 you are doing it in a Linux environment, it’s gonna miss out on the ability to scan the, ah 00:12:24.711,00:12:30.550 the modules cause, you know, some of them simply won’t be present. [Pause] Um, now how-how 00:12:30.550,00:12:34.020 do we do it from the command line, we can do, ah Python prog and then the-the file name, if 00:12:34.020,00:12:36.022 it’s a local file, if we do that way, ah it’s just going to get the image executable. Otherwise, 00:12:36.022,00:12:38.024 we want to provide the absolute path, which we can supply in an input text file. Ah, and it 00:12:38.024,00:12:43.029 needs that to in-innumerate the different, ah-ah modules. So, a number of different options, ah 00:12:48.034,00:12:53.039 associated keyboard shortcuts, I won’t spend too much time on that. Um [Pause] and there is 00:12:58.778,00:13:04.684 more as well. So, how do we use the JOP Rocket? Ah, again lots of many-many different features, 00:13:04.684,00:13:09.756 but by design a very minimalist user interface, just to make it a little bit easier to use, a 00:13:09.756,00:13:14.694 little bit more friendly. So, first step, we want to establish the registers of interest and 00:13:14.694,00:13:19.699 we’re looking at EAX and we’re looking at EBX, that’s the first step. Then we establish scope, 00:13:19.699,00:13:25.171 do we want CALL or do we want JMP. Keep I mind, if you do CALL, then you’re adding to-to 00:13:25.171,00:13:29.475 the stack and so if you’re trying to load windows API’s, then that can be problematic. 00:13:29.475,00:13:33.946 But you can compensate for that, of course, ah additionally are you looking for mod-modules and 00:13:33.946,00:13:39.552 DLL’s, which you’re probably are. Or are you just looking at the, ah image, ah executable? 00:13:39.552,00:13:44.991 Once the selections have been made, then we just hit g for go and it will get those gadgets. 00:13:44.991,00:13:51.130 Ah, and then we go to the printing sub menu and we can print the, ah, what it’s found 00:13:51.130,00:13:56.536 to-to files. Ah, many, many different options-options based on classification, based on the 00:13:56.536,00:14:02.742 operation, based on the registers that have been, ah affected. So, you can be very 00:14:02.742,00:14:07.747 specific and very granular. Um, and of course, if you need to, you can, ah enlarge, ah the 00:14:10.116,00:14:15.054 scope or-or narrow it and there. There are many specialized, ah options that would we won’t 00:14:15.054,00:14:21.794 discuss that kind of allow you to, ah kind of [Unknown], ah some of that. [Pause] Again, the 00:14:21.794,00:14:27.100 option to do, ah-ah everything as a CSV, ah just to get a broad overview of whether or not,ah 00:14:27.100,00:14:32.872 binary may support that. So, how do we get the, ah dispatcher gadgets? First up, is to select 00:14:32.872,00:14:37.710 the registers of interest, ah and then d for dispatcher gadgets we’re gonna acquire 00:14:37.710,00:14:42.615 those and then we’re gonna print sub menus, we can print those out. Ah, if you want to use CALL 00:14:42.615,00:14:46.519 on the dispatcher gadget that can be problematic cause it’s constantly, ah interfering with 00:14:46.519,00:14:50.823 the stack. But, you know, it’s an option. So, a couple of screenshots here, ah very 00:14:50.823,00:14:55.828 minimalist, ah UI. Um, now we’re gonna go into discuss a JOP exploit, ah [Stutters] try to 00:15:00.666,00:15:06.572 g-gain kind of an understanding of, ah how all this comes into play. [Pause] So, this is, ah, a 00:15:06.572,00:15:11.577 wave reader, ah prints out or gets the information on a wave file. We p-provide it with 00:15:14.647,00:15:19.619 malformed, ah wave file. Initially we have, ah an overflow just to set things in 00:15:19.619,00:15:26.025 motion and then we set up our, ah JOP gadgets. Ah, we set up the dispatcher gadget, we set up 00:15:26.025,00:15:31.531 the dispatch table and then we do our JOP chain. So, we’re g-gonna bypass DEP, data 00:15:31.531,00:15:36.869 execution prevention. We CALL virtual protect, we CALL right p-process memory. The second one 00:15:36.869,00:15:41.440 is not necessary, but we do it anyway and then we do our NOP sled and then our shellcode and 00:15:41.440,00:15:46.445 then profit. So, some basics here, ah the register for, ah dispatcher address is EDX and 00:15:48.581,00:15:53.686 then EDI will contain the address of the dispatch table and then we serve dispatcher 00:15:53.686,00:16:00.159 gadget instructions. Then we’re adding c or 12 based 10 to the, ah dereferenced, ah EDI. [Pause] 00:16:00.159,00:16:05.164 So, ah we can see the nice little diagram of our exploit that we’re about to-to do 00:16:07.366,00:16:11.671 momentarily. We have the dispatcher gadget, which allows us to advance four by twelve, 00:16:11.671,00:16:17.643 taking us to the dispatch table, ah, and then we up having in-between. Um, and then the 00:16:17.643,00:16:21.948 functional gadgets, which are similar to ROP, and then it swings right on back to the 00:16:21.948,00:16:28.487 dispatcher gadget that then advances, ah to the next entry in the dispatch table. [Pause] 00:16:28.487,00:16:33.459 So, setting things up here, ah, we have the initial overflow. We want to setup the dispatcher 00:16:33.459,00:16:38.464 gadget, ah we’re doing CALL EDX, um [Pause] We do a little bit of exclusive OR action and we 00:16:40.967,00:16:45.905 provide the two different, ah values for EDX and ADI, or dispatcher gadget and dispatch 00:16:45.905,00:16:51.811 table. And then we CALL EDX, the dispatch, ah gadget. Ah, after that, we can then start crafting 00:16:51.811,00:16:56.148 the function CALL’s, to do that we move ESP to the normal location, it just makes things a 00:16:56.148,00:17:00.753 little bit easier. Ah, then we’re [Stutter] callin, ah the API functions, we’re setting up 00:17:00.753,00:17:06.092 Virtual Protect. We-we provide the necessary parameters, that’s good. And then we do Write 00:17:06.092,00:17:11.631 Process Memory, we provide those, ah parameters. Ah, so with Virtual Protect, we can 00:17:11.631,00:17:17.003 then make it so that, ah memories re-write executable rather than just simply, ah 00:17:17.003,00:17:23.709 re-write. [Pause] So, supplying values for those functions, we get ECX to a known value, it 00:17:23.709,00:17:27.847 doesn’t really matter what it is but what we’re gonna is, we’re gonna modify it with exclusive 00:17:27.847,00:17:33.352 OR. Then we pop a value into EAX, we do the exclusive OR on it and then we pop another value 00:17:33.352,00:17:39.558 into EAX. And now we have two values that we can push onto the-the stack, ah and then so we 00:17:39.558,00:17:44.564 do that. Um, and then we need to compensate for, ah ESP. Ah, we do dereference virtual, ah 00:17:46.899,00:17:52.004 ProtoTech Pointer, um so we go ahead and-and do that. And we will utilize that a little bit 00:17:52.004,00:17:57.843 later on. Now, the goal here is to do purely JOP with the dispatcher gadget paradigms. And 00:17:57.843,00:18:02.515 since we’re doing two windows API CALL’s [Stutter] and API CALL is a function, a function 00:18:02.515,00:18:08.254 ends in a RET. So, that takes us out of JOP. So, we do insert one RET to get us right back into 00:18:08.254,00:18:13.960 JOP. Again, we have the option to call, we just need to do provide compensation by 00:18:13.960,00:18:19.632 adjusting the stacks, although that’s not a big of a deal. Ah, getting Write Process Memory, ah 00:18:19.632,00:18:23.269 that one is a little bit more, ah challenging, there’s not a direct pointer to it in the 00:18:23.269,00:18:28.207 binary, unlike with, um Virtual Protect. But since we’ve dereferenced it, we can do a 00:18:28.207,00:18:34.413 little bit of [Unknown] with the, um by analyzing the DLL and do some HexMath and, ah then we 00:18:34.413,00:18:39.418 can, ah thereby reach, reach that. Ah, we can also jump to other registers if we want to 00:18:41.687,00:18:46.792 shuffle around the, ah address of the dispatch, dispatcher gadget, that’s not a problem. 00:18:46.792,00:18:53.332 So, let’s go on and take a look at a demo. So, first we want to establish the registers of 00:18:53.332,00:18:57.436 entry. Ah, we go ahead and do that by typing r and then we’re doing all, so that’s getting all 00:18:57.436,00:19:02.008 registers. Other options, but we’re gonna bypass those, it goes and acquires those, we go 00:19:02.008,00:19:08.147 to the print menu. Ah, then we select the registers to print the registers affected, ah g for 00:19:08.147,00:19:13.853 all, ah we’re looking at all operations under z and then goes and acquires them. Ah, then we 00:19:13.853,00:19:19.025 see some gadgets that it’s found, just one random, ah example here. We see our 00:19:19.025,00:19:24.530 initial, ah overflow, ah we set that up and then we set our dispatcher gadget to EDX and 00:19:24.530,00:19:29.535 then our dispatch table to EDI. Ah, and then we go ahead and get, um get it going there. Now 00:19:33.973,00:19:40.079 we have our, ah the wav-wave file that we’ve read into memory and have some shellcode there. 00:19:40.079,00:19:46.218 Then we have the header just a traditional w-wave header. Ah, and then we’re going to go ahead 00:19:46.218,00:19:51.457 and make our Virtual -Virtual Protect CALL and this is all purely JOP. So, what we wanna do 00:19:51.457,00:19:55.361 is we want to provide it with the necessary, ah JOP parameters, so we go ahead and 00:19:55.361,00:20:01.834 do that. Let’s see that in-in motion there. Okay nice. And then after-after that then it 00:20:01.834,00:20:08.107 takes us to dispatcher gadget with that added EDI,ah c. And that will follow, ah every 00:20:08.107,00:20:14.380 single, um, ah functional gadget. We get ECX to a normal location just so we can do 00:20:14.380,00:20:21.120 exclusive OR action on it. Then we go ahead and um, so we get the first couple of parameters 00:20:21.120,00:20:27.993 for Virtual Protect. Ah, we do some, ah stack adjustments there. Um, then we go ahead and 00:20:27.993,00:20:31.597 dereference Virtual Protect, keep in mind we will be utilizing that a little bit 00:20:31.597,00:20:36.635 later on. Ah, and then we go ahead and do a JMP ESP, which now contains Virtual, ah 00:20:36.635,00:20:42.942 Protect. Ah, and then we have, ah values for the POP instructions, ah that will 00:20:42.942,00:20:48.647 follow, ah subsequently. And this part may be a little bit tricky to understand here, just, 00:20:48.647,00:20:53.652 ah utilizing, ah the stack. So, um there we go and then we go to, ah [Stutters] fix the 00:20:57.590,00:21:04.230 registers after the CALL. [Pause] We do our Write Process Memory, much of this is, ah more 00:21:04.230,00:21:09.635 or less the same providing parameters, ah making stack adjustments, ah nothing too 00:21:09.635,00:21:14.273 earth shatteringly, ah difficult. You can do a little bit of semi-tricky things like 00:21:14.273,00:21:19.345 if you, I guess it’s not really that tricky, but if you want to use a CALL EDX, that’s fine just 00:21:19.345,00:21:23.782 gotta do a little bit of extra, ah stack adjustment, which you see right there, ah, in-in the 00:21:23.782,00:21:30.222 next line. Ah, then we want to get to our Write Process Memory, remember we dereferenced Virtual 00:21:30.222,00:21:36.796 Protect, because Virtual Protect is in kernel32 which, you know, ALSR that can make it, um, you 00:21:36.796,00:21:42.535 know, unpredictable. Ah, so we get the, get that, we add the offset for Write Process Memory, 00:21:42.535,00:21:46.872 so then we can make a CALL to Write Process Memory. Ah, and then we’re all set to go, we 00:21:46.872,00:21:51.677 just need to provide the necessary, ah parameters for that. Ah, and then once we 00:21:51.677,00:21:56.382 provide those parameters, ah make sure that we get the stack values and are ready to go. We 00:21:56.382,00:22:02.555 can then execute Write Process Memory, which [Stutters] going to do and we got a notepad. We 00:22:02.555,00:22:07.560 didn’t do [Unknow] but we got a notepad. So, um, that's it, ah if anybody has any questions, ah 00:22:09.995,00:22:15.000 we’ll be done there. You can go ahead and reach out to us. Thank you. [Applause]