Okay, now we're going to have Mickey and Jesse discuss the UEFI exploitation of the annoying BIOS stuff that I know I personally hate. So, give it up. Can you hear me okay? All right. I'm Mickey. That's Jesse. We work for a company called Eclipseum. So, for introductions. By the way, that's our Twitter handles. Feel free to ask any questions. DM us. Pester us. Catch us in the hallway. Anything. Just feel free. During our talk, we're going to talk about a few things. The big picture is we're going to have to bring you up a little bit on what it is to set up a debug environment. What is the UEFI exploitation techniques? Specifically, the... Exploit that we found, the vulnerability that we find and we exploit it, and a few more things that we recommend you do. Basic acronyms. Anyone here does not know what BIOS stands for? I assume everyone does. UEFI is basically the newest name for BIOS. DCI is the acronym for Direct Connect Interface. There's been a lot of research about that in the last year and a half. Interesting stuff. I recommend you read up on it. SMM is a privileged mode that the CPU runs in, and you should read up on that, too. And out of band, obviously. A couple of people you should really follow and read up on the research in this field. The ones that have an apple on them and a censored mark, they work for Apple now. You don't see a lot of research coming out of people that go work for Apple, but they do have a lot of past research. And the reason we've added and more... ...is because once you start looking into these names, you'd see more and more names pop up. For example, not necessarily UEFI, but some DMA in UEFI. I'd like to point out Ulf Risk, sitting right there. Check out his research. Just pester him later. He'll tell you everything he does. He's awesome. And Joe Grand also asks him stuff. But why should we care? Well, I don't know what to say about BIOS and UEFI, right? So, someone did this study about who actually cares about their firmware security. And it turns out that a lot of people don't really care or mind it. You know, you power on your system, like if you're a consumer. It boots up. There's a fancy logo. And then you go do your thing in Windows, and everyone's freaking out. Every time ransomware comes out. No one thinks about that little piece of code that runs first when you boot up your machine and owns everything. And sets up everything and configures everything and hands it off to the OS. This is a very convoluted diagram for how this works. Complex. I'm going to simplify this. The little BIOS window there, it's where the stage where you go into BIOS and do settings. Anyone here done, went into BIOS and changed their setting because they had to? Isn't that fun? Right? So, that's where that does. That stage where that happens. And the Windows logo over there, it's where the operating system is at. So, you can see there's a lot of stuff happening before runtime or operating system. From an attacker's perspective, when you want to attack this piece of firmware, you target whatever stage you want according to your payload. If you want to implant a piece of firmware, you want to have some persistency, there are known backdoors, the SMM, the famous Dimas SMM backdoor and GitHub and others, and Hacking Team and Vault 7, I can go on. And you just implant it in the firmware and you're good. If you want to do in the operating system stage, when you're in, when you're in, when you're in, when you're in, when you're in, when you're in, when you're in, when you're in, in runtime, it's a different, it's a different attack surface for the firmware. There's different stages where the BIOS and firmware go at since you power on the machine and until it hands off to the OS. And that's, like, really simplified. Again, as an attacker, I care about two things. Let's say, let's all imagine that we want to hack someone. Like, and we're nation state or not nation state or we know how to get into this person's hotel room and get their hack. And they should be having their hands on their laptop for ten minutes. There's two ways we can do this. One, we can open the laptop, get all the covers in the back, flash the chip, read it, flash it, change it, whatever, put it back together, the classic e-vomit attack. Or we can do this with the laptop closed. So that's an interesting attack vector we can do with debug enabled in Intel's case. There are scenarios where if debug is enabled, you can have USB access. That's all you need. Just plug in a USB cable, and you can do a lot of interesting things we're going to show in a bit. Let's see. Now I'm going to show you a video, and I hope I can show it with this. Okay, we have audio. That's a shortened video of our evil maid attack. So we have a laptop that we're going to infect with an SMM backdoor using a flash programmer, opening the laptop, removing the heatsink because the spy is under the heatsink, flashing the spy, which is the longest process in all of this, 90 seconds to flash the spy chip, put it back together, and that's it. So let's enjoy the one minute ahead of you. We'll be right back. So that was an evil maid attack. The red that you saw at the end, that was the SMM backdoor. Dima wrote it's loading. Just an indication that from the beginning, you load into Windows, and then afterwards, you load into a backdoor and then Windows. Thank you, guys. Thank you. I do apologize. The rest of the videos don't have the soundtrack. How the hell? Okay. That's it. Okay. Now, I added a slide with a couple of reference notes. These CVEs are specifically for BIOS and firmware vulnerabilities. I'm not going to go into them. I'm just going to show you a few of them. I'm just going to give a high level. They involve SMI exploitation, SMI vulnerabilities, and so on and so forth. Check them out later. Now for the fun part. Now, to get started with low-level hardware debug or firmware debug, you need a couple of things. Intel Studio Debug is free to download. It's a three-month trial, I think, that you can renew every three months. It's awesome. UEFI tool, amazing tool. It basically helps view the UEFI images, view the parts in them, extract them, replace them. Chipsack is a tool for hardware and firmware security exploration, I would say. If you ever wanted to go into how the hardware in your computer works and you don't want to sit down and write a Windows driver, use Chipsack. Universal IFR extractor, that's an amazing tool. You basically, you use this on a BIOS image. I'm not going to go how to use each tool, but it allows you to get the details from the setup variable that are not usually shown to the user. Some of these are very interesting, and if you flip them on and off, you can get interesting behavior. A lot of BIOS modders use this. I really enjoy reading their blog posts, how they brick their systems. Be careful. It's really a good tool. It's been around since a long time ago. Two other important things. One is you need a USB-A to USB-A cable. It costs $15 from some vendor that I don't know, but maybe has his name on the slide. It's totally worth it. I would get it if I were you. Last but not least, you need to have a USB that allows you to boot into a UEFI shell. Now, there are plenty of tools out there in the Internet that are used for many platforms, for many scenarios. You can just put it on your shell, load it up, and play with. There's too many to list. I really recommend you start looking around. Now that you have a knowledge of what tools you can deal with, I'd like to go a little bit deeper. For the Intel Hardware Debug Interface, I need to reference some information here. The CVE you see mentioned here is our own CVE. We reported to Intel about the DCI vulnerability and got patched in a way that changed policy for all the vendors in BIOS. It's interesting because it stops you from enabling debug interface. It supposedly needs to stop you. I didn't validate it, but you should note that. Intel Studio Debug, once you have that, it's like five gigs. You download, you install it. It has a whole set of tools. All you care about is the debugger. That's it. And the debug abstraction layer, which is an important thing. It's a command line. It's an interface, a debugger. I'm going to talk about the UI and the command line. So I'm a Windows guy, I'm sorry. I like a lot of GUI. So I'm going to focus a little bit on that and I'm going to add a little bit of command line just for all you Linux people. So when you have this installed, you go and you find the Intel DAO folder on your hard drive and you find configconsole.exe. You can't see what it says, I hope you can, it's a bit, resolution's a bit off, but you get a menu like that. It's part of the Intel Studio Debug. You go into your dropdown and you select your target. It's abbreviated. So for example, KBL is KB Lake, SKL is Sky Lake and so on and so forth. The biggest, if you want to find what is what, you find the CPU of your target, you go the little numbers. It's a K or whatever, I7. You go into Intel Arc, you put that in the Arc and it gives you product formerly known as KB Lake. And then you know, KB Lake, what can that be, KBL. There's no one-to-one reference anywhere. So once you have that set, you click apply and then you click on that weird red button to connect to MasterFrame. MasterFrame is a service running in the background that connects you, your computer, your computer, your host to your target using the USB debug. After you do that, you have a service connected to that and you're good. After that, you open the Debug Studio and in there you have a button, connect to target. You select the out-of-band and it's important you click on DFX Abstraction Layer Configuration. That referenced to the previous dropdown menu. Now I'm like doing this explanation because it's not obvious. If you try to figure this out, it's going to take a while and you're going to be like frustrated. Why is this not working? For example, our target platform that we're using is an 8th Gen Coffee Lake ASRock system with a 370 chipset that you can see the option. It's like somewhere in the middle, second from the bottom. It's literally there. You just select it and click it. So you don't have to go all through this convoluted process of selecting the target platform and clicking and going and setting it up. But some platforms do not have this. So if you do want to use the GUI, this is a great tip to know how to fix that. You don't have to get specifically the hardware that works with us. On the command line side, you have the PythonConsole.cmd. It's a... It's a... The CLI for Python and ITP, it loads everything together. It's in the same folder as config console is at. You just run it and it starts booting up and setting everything up and then you get something like this. ITP is the namespace and when you do ITP.halt, it halts the CPU, which is by itself amazing. And then in this example, we set a breakpoint in a site. We issue an SMP, we issue an SMI, we let the process continue, and then the next breakpoint is SMM entry breakpoint. This is the script that actually does it, if you want to automate this. Excuse me. All it does is basically halts the CPU, sets the breakpoint to SMM enter, issues an I.O. for SMI and it... lets the CPU go, waits until the breakpoint is stripped, until the CPU gets the SMI, is in the breakpoint, gets the SMM physical base address, and uses memsave to dump the entire SMRAM. And then releases the CPU. In the GUI, it's much nicer and GUI-ish. So, um, you have this drop down when you create a breakpoint. You can create a hardware breakpoint, a software breakpoint, or other. Uh, I always use the hardware breakpoints. In there, you can choose if you, if you pause on code, or on data being accessed, or platform. If you choose platform, the debug studio comes with these built-in options. Now, I don't know about you all, but having the ability to have a debugger pause the system in a VM exit is not trivial. Or, machine check. Or SMM enter. Like these, these things are not something you can do with GDB. It's not something you can really like, oh, I'll do it later. It's really stopping everything. If we set a breakpoint in SMM enter, in the GUI, it would look something like this. You'd see a little yellow mark where you're stopping execution. You'd see the, the address right here. I'm showing you the, uh, we stopped at that address, and, and the, um, the SMM physical base address is, there's no that number so you can obviously, we're in SMRAM, we're running, and you can step, uh, step through, step into, step out of. It's exactly like any other debugger. It's amazing. Another interesting option here is the reset vector. So, um, in, in modern platform for the last 30 years, every time, um, the silicon gets powered on, it does its own, the chip does its own silicon stuff, and then it goes and it stops and it loads a specific address that has set up in it, that basically sets the reset vector for the firmware. Like, execution is handed off from the chip to the firmware, and then the firmware then loads to the OS, and then the bootloaders and all that stuff. The reset vector has always been the same place in, in, in the last 30 years. And breaking on it means that you get to stop the machine before BIOS has configured anything. No protections, no memory, nothing. Before even BIOS loads, you can do whatever you want. This is, um, this is how it looks when you, when you halt on it. Uh, you have write back and validate, which is, uh, an, an example of one system. This is on a Skylake system. In the Coffee Lake, it's nop, nop, and then it jumps to the next, uh, instruction. The address is the same on every platform. Oh. Now I'm going to go to the next one. To the fun part. And let Jesse do that. So, so we've looked a little bit about, so we, we've looked a little bit about how, uh, to use some of these debug interfaces and what to do. But, uh, as far as, like, actually finding vulnerability and what we can do with it, um, one of the, the most interesting areas is there, there's been a lot of, uh, network cap, capabilities added to UEFI. And some of those are things like over the internet updates from BIOS itself, from UEFI. Uh, we found a BIOS that can send email. Uh, there's another one that does, it'll download a remote diagnostics tool over the internet, run the application, and provide results back somewhere else to the, to the internet before your operating system loads at all. So, as, as part of, like, looking around at all these different features, we, we discovered that, uh, uh, two different vendors had vulnerabilities in their, uh, uh, internet-based, uh, UEFI update mechanism. One of them was Razwa, Asrock. Uh, we reported that to them and they were like, oh crap, let's fix this. And basically, uh, made, uh, firmware BIOS UEFI updates for around 300 different motherboards that were all affected by this. It basically was anything from Haswell onward from Asrock was affected by this. Uh, they do, they do have some, uh, AMD mod, models also that were affected. I think it was a much smaller number, it was like 27 motherboards. But, uh, we also found, uh, so this is the, the exploit that we're gonna walk through and explain how to actually take advantage of this. Uh, we found, uh, basically, uh, essentially the same bug in, uh, Asrock's firmware. And, uh, this is the response that we got back from Asrock, or Asus. This is Asus, sorry. Asrock is fine. Asus, we kind of went back and forth between them and explaining, like, you should maybe fix this. And they're like, no, this, this all happens before the operating system loads, so it's fine, it's not a problem. And it's like, no, like, the operating system, like, it's even more privileged because it's before the operating system. So, they didn't actually bother to fix this. So, it concerns me a little bit because, like, my desktop at home is an Asus system and it's vulnerable to this also. And I'd like them to make a patch. So, here's an example of what the, the user interface looks like in BIOS. You can basically go in and, uh, this is, uh, Asrock's implementation. Uh, it'll, it'll show you if there's an update available, you can apply it. Um, here's what, uh, uh, Asus's implementation looks like. It's essentially the same functionality, just implemented differently. Uh, it's, this is all vendor-specific add-ons to the, the base, uh, Tiana Core UEFI reference code implementation. So, we'll do a little bit of a walkthrough of, like, what's going on with this. And then, uh, we're going to talk a little bit about, like, what the actual exploit was. And then we'll explain how to take advantage of that and how to build a payload to actually exploit this. So, as, as Mickey mentioned, this was a, uh, a Coffee Lake Asrock latest, latest updates. Everything was, uh, up to date. So, uh, in, in this case, basically, it does a plain HTTP request from BIOS to a remote server on the Internet. It brings up the network connection using DHCP and makes plain HTTP requests from BIOS to remote server on the Internet. It brings up the network connection using DHCP and makes plain HTTP requests so there's no, no SSL, no certificate pinning, like, there's no verification that it's actually talking to the right server. And that you have a man in a middle that you have poisoned the attack so the request goes to your server, something like that. So they're not doing any of that. Uh, here's, let's see, so here's what the result looks like. It's basically just an XML document that has some fields like, here are different URLs you can download this BIOS update for. Here's the version that, uh, I just saved out that I saw on Internet, it's a, um, for, uh, a few is available. Here's the description of it. Here's the actual file name itself. And if you modify this, you basically show up with, like, here's my malicious update. Go apply that. But we discovered that, like, here's the exploit. So we discovered that if you just have a really long URL field, it doesn't even get to the point of asking you, saying, hey, there's a new update available. It just hangs. And you're like, that's interesting. What happened here? So in order to figure out what actually happened, we'll have to start using those hardware debug tools. But to get started, we'll just start off with a simple payload where in that URL XML tag, for the response we're returning, we're just going to put a long string of A's and see what happens. So once you've used Miku's process to attach the debug, the hardware debug tools, and get into Intel system debugger, you basically have an environment that looks kind of like this. You have the ability to look at memory, check the state of the CPU. The really key thing to do to figure out what actually happened is to look at the state of the CPU. In user mode applications, or even kernel, you'll usually get some kind of system log of what happened. When you cause an exception in BIOS, it usually just hangs. It goes to an exception handler and then goes to an infinite loop, and you don't know what's going on. So what you want to do is basically find the interrupt handlers for a general protection fault, and you're going to do that by, there's this menu option for looking at CPU structures and GDT, and then on the bottom right here, you can see here's the different handlers, and the offset of general protection fault is listed here in the very, very far right. So that address, you can then go set a hardware breakpoint on, and use this, basically go to that address and say create breakpoint at that address, so then when we trigger this, we can actually have that address, and then we can go to have this halt, and then examine the state of the system from that point. So when we do this, we basically end up where we've halted at the entry point for the general protection fault vector, and you can see in the upper right, here's the state of the registers, and the 40, 41s are basically our A characters that showed up in two of the registers that we've seen so far. So we've clearly overflowed something in the stack. There's this register state. It's been corrupted, and that's a pretty good sign so far. So we can go then take a look at it, and basically it's not quite as intuitive as GDB and, like, other kernel debug features that you can use. So in order to actually figure out where this faulted, we're going to take a look at the stack pointer and see there's basically when it goes into this. this exception, it puts the state of the machine onto the stack. So we can basically look at the stack pointer and use this function that's just show memory. And if you take a look here, it basically puts the memory of that address down at the bottom, and we can see there's a 64-bit value that's pushed, and then the next 64-bit value on the stack is the address of the instruction that faulted. So we can kind of navigate around a little bit and see what happened and find the exact line of code that crashed. It's not quite as intuitive as some of the other debuggers, but it's useful. So in this case, when we take a look at that instruction that we actually halted at, it turns out that it was a return instruction. So we basically faulted when we were trying to return because... Because our pointer was bad, so that's a pretty good sign because it implies that we control the return address and we can have arbitrary code execution at this point. But there's some things to look about for if you actually turn this into a real exploit. And what... There are some general constraints for your payload. This is 64-bit mode, so you can have larger pointers and your shell code needs to be 64-bit. 64-bit. And because this is a string copy from a document onto the stack, we need to avoid null characters and we also need to avoid greater than, less than symbols because they would mess with our XML document. So there's a few bad characters we need to avoid. And then as part of our exploration and exploring the debug environment, we were able to determine that we really need a very small and precise size for the length of the string because if we have too many bytes, we end up dereferencing a pointer that crashes before we get to the return address. So it needs to be exactly 255 bytes. So we have some constraints, but I think we can work with this. So in order to verify that we are actually executing instructions and we have remote code execution, we just build a basic, exploit where instead of the long string A's we have our knop sled and then just a single instruction to do an infinite loop and then our target return address to try and jump into the knop sled. It's pretty simple. So once we trigger this, we basically verify that we did hit our knop sled and when we halt the processor, we basically, you can see there's a little yellow tick at the very left of that infinite loop instruction. So we are, we halted the processor. It was in that busy loop. That's all it's doing. So we did confirm we have arbitrary code injection and the stack is executable. So that makes it even easier. So that's basically what we've determined here. It's like we have verified that we can execute instructions. There's no address randomization, which makes things easier also. And the stack is executable. But because we had that limit where it has to be, 255 bytes exactly, we need to figure out what we can do and what we can put into that space. So one other thing we could do is, like, we're limited to the 255 bytes for that particular field, but we have the rest of the XML document. It turns out that if you just append stuff to the end of the XML document, that also shows up in memory. And, uh, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, what, one thing that we could do is we could just look and see if we have a pointer that already ex... that already points at that XML document. So we'll just take a look at all the different registers and see if we get lucky. So we can use the Show memory and check each of the different registers. And it turns out that, uh, R10.... The R10 register happens to point into the heap. It's not exactly at the XML document, but it's close. If we, we basically look at R10 and then search backwards, in memory from that pointer we find our full XML document and it's there. Then we can take advantage of this by basically building our exploit to instead of having our infinite loop we basically have code that searches backwards from the R10 pointer in order to find a tag. We basically just used a little 8 byte string of A's and that worked. You can put whatever you want to have it as your tag to search for. But we basically have on the stack overflow is our initial payload and we use that to find the rest of the payload in the heap. Once you're actually stepping through that, there's some pretty useful functions within the debugger. So in order to get past that, so when I first started debugging this in order to figure out what was going on, I will really often add an infinite loop at a particular point. It's like I can add a breakpoint anywhere in my payload. One issue that we run into using the hardware debugging breakpoints is that you will often need to, like, after you cycle the power of the system, you'll often need to enable and re-enable the breakpoint and then go trigger your exploit. If you just add an infinite loop in, you can effectively have the same thing. But then when you're running, you basically need to say, I want to skip this instruction. So you can just use this move PC to line and set the instruction pointer to whatever you want. So that's a really common thing that you end up using. And then maybe there's like a long loop to do things like copy things or search memory and you can use this function just run to line. It's similar to like GDB functionality, but I kind of wanted to point out where to find these things and what you can use those for. So at this point, we've basically found our R2, our R3, our R4, our R5, our R6, our R7, our R8, our R9, our R10, our R11, our 0.2, our 0.2, our 0.4, our 0.5, our 0.6, our 0.7, our 0.9, our 0.8, our 0.7, and then we're all set. So we're all set. So the question is, what do we do with our second stage payload? And in order to really understand that, like, we don't have an operating system loaded. So like running bin bash using an AD syscall isn't going to work. So all these traditional things that you've seen in other types of shell code just doesn't exist. We don't even have your Windows kernel or Linux kernel or anything like that where you can patch functions in it and then basically escalate privilege of a user mode app. None of that works. So let's talk a little bit about what the UEFI environment actually looks like, and then we can have a better idea of the types of capabilities that exist that we can take advantage of. So we're going to give an overview of applications, overall structure of what an application looks like, and then protocols is a really key thing to know, and then system table, boot services, and runtime services are all kind of important things in UEFI. So the applications themselves are basically just a Windows PE executable, and instead of, like, you might be familiar with, like, ARGV and ARGC arguments being passed in. UEFI applications basically are passed a pointer to the handle to the executable that was loaded itself, and then a pointer to the system. And the system table is, you can find all these other functionality that exists inside of UEFI from the system table. Like I mentioned, there's a full network stack. There's a lot of rich functionality that we can take advantage of. And to actually use those functions, we need to know about what protocols are. It's essentially kind of a, so it's a protocol interface that is used to, it's an intercomponent mechanism such that it's one piece of functionality that wants to provide a type of interface. Like maybe it handles network connections. It will publish its interface by GUID. So you could say, this is a well-known number. I am a completely different application, and I want to use this. And. Yeah, and I'll look it up by GUID, and then I can basically do function calls into this other piece of functionality. It's essentially like object-oriented programming classes. So it's a really key part of UEFI, and everything is built on top of this architecture. And so the system table contains pointers to boot services and runtime services, some other useful things. Boot services have a bunch of functions. Like memory handling, protocol operations, loading and starting other UEFI applications, and then exit boot services. Exit boot services is basically what happens at the very end before you actually launch the operating system. Runtime services does like capsule operations, variable operations. The most important boot services functions that we have are locate protocol, which will allow you to find other pieces of functionality within the UEFI. So you can go into the boot services architecture and go use that function. Load image will basically allow you to load a UEFI application. And then start image will run that. So those are both things we can use. So first we need to find the boot services pointer. And it turns out that those are actually saved as part of the standard UEFI application framework. So it gets passed a pointer to the system table, and then the code will basically save those in global variables. But because we don't have address randomization, we can predict where those global variables are. And then our payload basically ends up looking like this, where we've got our second stage, which has basically code to call this loadImage and startImage shellcode. The loadImage function, you can either provide a path to go get it out of a firmware volume, or you can give it a buffer in memory and actually execute code directly that way. So we'll have code to basically load and start an arbitrary UEFI application. And one problem that we ran into is that right before the return instruction that we overflowed, they basically called a free function. So our XML document and payload that we're running is in the heap, but if we trigger any allocations, it's going to corrupt the heap and mess with our payload. So that's a problem. So we want to avoid that, so we basically end up copying everything back to a different location, basically copying it out of the heap so that the heap will stay preserved and things will work. So that actually ends up working, and I'll show a quick demo. So this is the... So this is the first demo that we actually... The first exploit that we actually got working. So this is what the environment looks like. We're basically going to go launch the Internet Flash functionality. It'll go check for an update and see what happens. We basically were able to do some simple text mode exploits. So we got code execution. It worked. But we don't want to do this one yet. Not yet. So let's see if I go back to this one. So that worked. But the problem is it wasn't great. We had limited space. The app was only up to about 12K or so, and we also had some issues with our payload encoding. So it turns out that if you try to use MSF Venom to encode, a 100K Windows executable, it doesn't work great. So we basically made our own payload encoding, which is just a very simple... It's essentially just... We thought about using Base64, but that includes a table. And we basically convert our UAFI application that we want to run into a long string of hex digits, map it all to a single set of... So basically by having it, instead of 0 through 9, A to F, basically map those characters to A through P. We don't need to have any branches or logic. It just is a copy loop that basically looks like this. So you just subtract A from each byte, and then that is the nibble that you use to rebuild the code. So that's what our decode steps looked like. So we also needed to find a better place to actually put our payload, because it turned out we only had about 12K of space on the stack. So we explored and looked around a little bit before we discovered some... remembered some useful things. So UAFI applications all run in ring 0. And there's no memory protection between the UEFI apps. So we can just write our code over some arbitrary UEFI that already exists in memory. And if it's one that we're not going to trigger, we don't really care. It just works. So let's try something bigger. . Shit. Nope. I need that up. Okay. . So it's basically the same thing, triggering the exploit. . . . . . . . . . . . So... So that was cool, but... So we figured, let's actually pop a full shell and do something more interesting. So this is, there's the tool that Mickey mentioned, the UEFI shell, and it basically is like a big 900K executable. It's a meg, almost two megs, so it takes a little bit longer, but it's basically showing that we can run any arbitrary UEFI application that exists. You can make your own UEFI apps to do whatever you want, like the demos that we made, the previous ones. So this is a full UEFI shell. It's about a two meg executable. You can run this, and it just works. So some other ideas are, you basically, you have a full network stack in UEFI. You can just do a network connection yourself. Download the third stage from the network instead. You could have a full command and control capability from BIOS. Some other ideas are, there's decompression code built into UEFI. You could decompress, you could even encrypt your payload and use the functionality that exists in UEFI to do a bunch of more interesting things. This particular firmware image contains an NTFS driver, which you can use that. But if you're... If your hard drive is not encrypted, you could use this to mount the hard drive from UEFI and modify files in the file system, drop malware into the OS. You could exfiltrate data and email it from BIOS. You could do ransomware, all kinds of stuff, because there is a very rich functionality built into UEFI. If you don't have the NTFS one, you could just include it in the payload and bring it yourself. This is actually what Hacking Team did with their UEFI. They had the NTFS driver and used that to drop an agent into the file system to have their malware running in the agent. So some of the mitigations that could work for this is adding stack protection, randomization, non-executable stack. None of this exists in the UEFI reference code implementation. There's been discussions by UEFI forum to start adding these features, but this doesn't exist now. And even if it did exist... In the Tiana Core reference implementation, the vendors have their own source tree. They basically pull from Tiana Core and add all their own stuff, and then they put it out into a platform in the real world. And it takes a while for that to show up. This doesn't exist now, and it'll probably be a while before it is out there. For recommendations for building your own exploits, use the latest EDK. There are directly from GitHub, from the head. There have been EDK package releases, but the latest one is best. They've fixed a bunch of things. And then there's also GNU EFI package. So there's EDK kind of build environment, and then there's a GNU EFI build environment. And they're kind of a different structure. GNU EFI is more of a Linux-you-make-file kind of thing. But Ubuntu has a version that's like two years old, so go get the official one and use that instead. Do we have time for questions? I don't think so. How much time do we have? No time. Yeah. Okay. Thank you. Thank you. Thank you. Good job. All right.