WEBVTT

00:00.000 --> 00:01.200
Hello, everyone.

00:02.240 --> 00:06.260
It's a pleasure for us to be here at DEF CON 33.

00:06.980 --> 00:13.720
And honestly, it's exciting just to see so many people here interested in building this malware.

00:13.820 --> 00:15.320
So thank you for coming.

00:15.380 --> 00:17.400
I'm not going to ask questions.

00:17.400 --> 00:20.280
I suppose you want to develop malware, but whatever.

00:22.000 --> 00:28.300
Before diving in, we want to make something very clear right from the start so everyone is on the same page.

00:29.340 --> 00:34.320
This is not a talk about theoretical bootkit and rootkit development.

00:34.400 --> 00:40.840
What we are going to share with you today is a fully functional working piece of malware that we have developed.

00:41.160 --> 00:45.560
And in a moment we will explain why we have chosen to make it public.

00:45.800 --> 00:53.980
So during this talk, we will share with you a complete documented bootkit ready for you to use, build and study.

00:54.520 --> 01:01.420
Alongside that, a rootkit as well that implements some cool techniques to modify the Windows kernel.

01:02.500 --> 01:14.120
We will also point you to our repository with over 400 great resources that you can use to carry out your own research into bootkits and rootkits.

01:14.300 --> 01:22.460
And because setting up the environment can be half the battle, you will have access to a set of scripts we use to automate the entire setup.

01:23.140 --> 01:29.680
And by the way, this talk ends with a demo, a real vulnerable computer we have right here.

01:29.680 --> 01:31.840
We have right here this Lenovo.

01:32.700 --> 01:40.920
Showing the bootkitting action with secure boot enabled, taking control of the Windows kernel and running the entire malware exactly as designed.

01:40.920 --> 01:42.460
We hope you enjoy.

01:42.980 --> 01:49.360
My name is Alejandro, I'm a geek, which of course stands for a gentleman, as you can see.

01:49.420 --> 01:54.960
A gentleman exploring UFI and OS kernels, or at least that's what I like to say.

01:54.980 --> 01:56.420
And she's Maria.

01:57.820 --> 02:01.320
Hi everyone, I'm Maria, also a geek.

02:01.520 --> 02:04.800
A girl who explores exploits and kernel threats.

02:04.940 --> 02:09.460
You can find our full biographies on the official DEF CON page.

02:09.460 --> 02:17.760
But to summarize, I work in a law enforcement cyber crime department where I've spent the last few years analyzing malware.

02:17.760 --> 02:21.760
Don't worry, I'm not working right now, this is a safe place.

02:22.460 --> 02:28.060
Meanwhile, Alejandro is a red team operator focused on Windows internals.

02:28.200 --> 02:37.660
So we are two geeks with two different perspectives, two octopus lovers ready to publish a boot kit for the entire world to use.

02:39.160 --> 02:41.180
And the question is, why?

02:41.180 --> 02:43.080
Why are we publishing this?

02:43.100 --> 02:53.600
Well, we want every offensive team out there, every red teamer to walk away from here today with a real boot kit and a root kit they can actually use in their operations.

02:53.680 --> 02:56.080
And the knowledge to develop their own.

02:56.180 --> 03:11.160
Instead of spending a year crawling the internet, piecing together scattered bits of information and trying to figure it all out, you'll have it today, ready to customize, improve and build your own in just a few months.

03:12.400 --> 03:15.360
This entire subject fascinates us.

03:15.360 --> 03:19.720
And we believe it shouldn't feel like some kind of dark magic.

03:20.000 --> 03:25.480
Building a root kit and a boot kit isn't about having the secret knowledge look away.

03:25.480 --> 03:30.780
It's about having the right guidance, the right resources and the time to learn.

03:30.780 --> 03:38.700
So over the next 40, 45 minutes, we're going to explain everything in a very straightforward way, plain language.

03:38.860 --> 03:46.260
We want absolutely everyone to walk away with a clear understanding of what this is and how it works.

03:46.260 --> 03:48.260
That's what this talk is about.

03:50.240 --> 03:53.300
So let's get this started, guys.

03:53.900 --> 04:01.140
A boot kit is a program designed to implant itself as early as possible in the system's boot process.

04:01.140 --> 04:08.820
It gains control over every stage of the system's startup and modifies the entire boot flow, which we will break down shortly.

04:09.080 --> 04:10.320
How does it do that?

04:10.320 --> 04:15.500
By hooking and patching key functions in files involved in the boot sequence.

04:15.500 --> 04:22.160
Those hooks and patches are what allow the boot kit to keep executing while the boot sequence continues.

04:22.160 --> 04:27.760
And to install components that remain alive even after the operating system takes control.

04:28.360 --> 04:33.900
A boot kit is just a root kit that runs before the operating system is loaded.

04:33.900 --> 04:35.660
So what is a root kit?

04:35.700 --> 04:43.800
A root kit is another program designed to run inside the kernel, the core of the operating system.

04:43.800 --> 04:55.180
Because it operates at the kernel level and the kernel manages memory, processes and interrupts, the malware can do almost anything.

04:55.200 --> 05:04.240
It can hide files, network connections, disable security protections and modify the internal structures of the operating system.

05:04.660 --> 05:11.460
Now, someone who wants to get started in this field doesn't really understand a damn thing about these definitions.

05:11.460 --> 05:13.860
So let's demystify it.

05:14.160 --> 05:22.960
On any system you will find kernel mod drivers, legitimate components that run at the highest privilege level inside the kernel.

05:23.020 --> 05:29.020
Now, if you take that same concept and make it malicious, you get what we call a root kit.

05:29.020 --> 05:33.940
A malicious kernel mod driver designed to tamper with the kernel.

05:34.360 --> 05:42.060
And if the computer uses UFI BIOS to boot, then the starting point of the boot process is a UFI application.

05:42.060 --> 05:47.220
So a malicious UFI application is what fits the definition of a boot kit.

05:47.740 --> 05:51.140
At its core there are two main components we need to develop.

05:51.140 --> 05:53.240
Later we will see there are more.

05:53.240 --> 06:07.060
As the foundation, a malicious UFI application for the early boot stage and a malicious kernel mod driver to modify the operating system once it's loaded.

06:07.600 --> 06:19.500
And now that we have demystified them, it's worth mentioning, you will find official documentation from Microsoft and from UFI forum available to help you build both of them.

06:19.500 --> 06:24.300
This is not dark magic, it's just offensive software development.

06:25.280 --> 06:28.680
But of course it's not just about reading the official documentation.

06:28.680 --> 06:35.980
There are some amazing resources out there, almost like sacred texts that you simply cannot miss.

06:35.980 --> 06:41.140
If you really want to understand what's going on under the hood, start here.

06:41.480 --> 06:51.400
And of course, huge thanks to all the amazing folks that explored this subject before us and shared their knowledge, malware and tools with the entire community.

06:51.400 --> 06:54.560
Now it's our turn to give something back.

06:57.250 --> 07:00.330
By now we can summarize it like this.

07:00.330 --> 07:07.110
A boot kit is essentially a malicious UFI application and a root kit is essentially a malicious kernel mod driver.

07:07.110 --> 07:10.810
We already know the two main components we need to develop.

07:10.810 --> 07:14.770
But what actually prevents us from just installing them?

07:14.830 --> 07:19.090
Well, we are two protection mechanisms we need to talk about.

07:19.990 --> 07:22.250
First, we have security boot.

07:22.250 --> 07:24.930
Security boot is all about the chain of trust.

07:24.930 --> 07:28.870
Enforced through digital signatures and cryptographic keys.

07:28.870 --> 07:37.990
When it's enabled, every component in the boot process must be signed by a trusted vendor and verified against a list of allowed keys.

07:37.990 --> 07:39.250
That's the point.

07:39.250 --> 07:47.270
Malicious UFI applications, boot kits, simply won't run unless they are signed by a key that the firmware trusts.

07:47.630 --> 08:02.050
But like any system, and we've listed a few CVs there, if you exploit a weakness , or in this case, you find a way to include your own key into the chain and sign your binary with it, the whole thing collapses.

08:02.490 --> 08:12.950
And once security boot is bypassed, every protection that comes after, including what the operating system tries to enforce, basically doesn't matter anymore.

08:12.950 --> 08:16.410
Because if you control the boot, you control everything.

08:16.730 --> 08:22.330
So what happens when two geeks find a machine vulnerable to one of these flaws?

08:22.330 --> 08:26.230
Well, that's exactly what you'll see in our final demo.

08:27.190 --> 08:33.330
The second protection we need to talk about is driver signature enforcement, or DSE.

08:33.330 --> 08:39.270
If you already compromised the boot process, this protection doesn't really matter anymore.

08:39.450 --> 08:41.630
But let's assume you didn't.

08:41.630 --> 08:46.010
Maybe you couldn't find a vulnerability to break the boot signature chain.

08:46.010 --> 08:49.410
In that case, you can't install the full boot kit.

08:49.410 --> 08:53.750
But you can still find a way to install just the root kit part.

08:53.870 --> 09:04.350
The problem is, Windows won't let you just load a malicious kernel mode driver unless it's properly signed either by Microsoft or by a trusted vendor.

09:04.910 --> 09:14.410
As you can see on the screen, if you try to drop your sys file into the system and load it, you'll get an error saying the signature is invalid.

09:14.550 --> 09:16.970
That's DSE doing its job.

09:17.250 --> 09:19.310
But there are ways around it.

09:19.310 --> 09:23.770
And one of them is the technique called bring your own vulnerable driver.

09:23.990 --> 09:33.390
The idea is instead of loading your malicious driver directly, you first load a legitimate signed driver with a known vulnerability.

09:33.510 --> 09:42.830
And once that vulnerable driver is running, you exploit it to execute arbitrary code in kernel space and load your root kit from there.

09:43.650 --> 09:47.330
The vulnerability you use can be too well known.

09:47.330 --> 09:54.050
Because Microsoft maintains a block list of drivers which are already known to be abused for this technique.

09:54.050 --> 09:56.650
And it won't allow them to load.

09:56.990 --> 10:01.670
But at the end of the day, it's a constant kind of mouse game.

10:01.670 --> 10:09.750
As new vulnerable drivers are discovered, attackers use them, Microsoft eventually blocks them and the cycle keeps going.

10:10.630 --> 10:12.630
Now let's quickly recap.

10:13.090 --> 10:17.290
A UFI boot kit starts with a malicious UFI application.

10:17.410 --> 10:20.950
A root kit starts with a malicious kernel mode driver.

10:21.090 --> 10:26.370
To install either of these components, there are protection mechanisms you'll need to bypass.

10:26.410 --> 10:36.950
There are public vulnerabilities, public exploits and proven techniques you can adapt to get each part, each component of the boot kit we're sharing up and running.

10:38.490 --> 10:46.290
So to understand how our boot kit or root kit behaves, you first need to understand the boot process.

10:46.350 --> 10:48.190
And here is the general idea.

10:48.190 --> 10:54.330
When you press the power button, the system performs an operation called power on self test or post.

10:54.330 --> 10:59.210
A process that checks the hardware to make sure the essential components are working properly.

11:00.070 --> 11:06.770
After that, UFI framework is executed and it looks for the files and partitions required to boot.

11:06.770 --> 11:18.250
One of the first files it loads is the Windows boot manager, a legitimate UFI application found in a special disk partition called the ESP, EFI system partition.

11:18.650 --> 11:26.350
The Windows boot manager loads the Windows OS loader, which loads the operating system into memory.

11:26.350 --> 11:31.450
And from there the operating system takes control and initializes its main subsystems.

11:31.450 --> 11:35.830
So we have three key files involved in this process.

11:35.830 --> 11:40.710
The Windows boot manager, the Windows OS loader, and the Windows NT kernel.

11:40.750 --> 11:55.650
Three files you will want to load into your disassembler, reverse engineer to understand their inner workings, and figure out exactly which functions to hook and patch, just as we mentioned earlier, in order to take control of the process.

11:56.810 --> 12:00.670
This is the simplified explanation of how the malware works.

12:00.670 --> 12:05.210
Remember, each component in the boot chain loads the next one into memory.

12:05.210 --> 12:14.310
So at specific moments in the process, the next component, the next file is already in memory, but it has not yet taken control.

12:14.310 --> 12:15.110
That's the key.

12:15.110 --> 12:23.670
Those moments are when we can hook functions inside that next component, keeping our code in execution as the process continues.

12:24.370 --> 12:29.450
We begin by replacing the Windows boot manager with our own malicious version.

12:29.450 --> 12:39.250
This malicious version, or UFI application, hooks a function inside the firmware responsible for loading the original boot manager.

12:39.290 --> 12:47.450
But instead of immediately passing control to it, our code ensures that the original boot manager is fully loaded into memory first.

12:48.270 --> 13:07.110
Once it's loaded, and this right here is one of the most important lines among the thousands that make up the boot kit, once it's loaded in memory, we scan the memory using a known pattern to locate a specific function in that file that is called when the next component is already in memory.

13:07.110 --> 13:20.590
Then we hook it by patching its entry point with a small assembly trampling, redirecting the execution to our own custom handler, and then back to the original function, keeping our code without breaking the boot process.

13:20.630 --> 13:23.590
We repeat the same approach at each stage.

13:23.590 --> 13:31.450
So inside the Windows boot manager, we hook a function that is called when the OS loader is already in memory.

13:31.450 --> 13:38.090
Then inside the OS loader, we hook a function that is called when the anti-kernel is already in memory.

13:38.090 --> 13:43.110
Hook by hook, stage by stage, we maintain control through the entire boot process.

13:43.490 --> 13:46.130
But these hooks don't just keep the boot kit alive.

13:46.130 --> 13:55.230
Along the way, we also use specific functions in these files to drop the root kit, the malicious kernel mod driver, in memory at the right moment.

13:55.230 --> 14:01.690
So the root kit is ready and running by the time the operating system starts.

14:02.330 --> 14:06.570
And now let's see a quick demo.

14:13.400 --> 14:15.260
The first one.

14:16.640 --> 14:21.620
So here we have an unsigned kernel mod driver.

14:21.620 --> 14:29.140
We're going to try and load it in a common way and you're going to see an error because the DSE is enabled.

14:29.320 --> 14:36.380
So what we're going to do now is perform an advanced restart and we're going to change the way we boot.

14:36.380 --> 14:45.460
We're going to boot into the ESP, the EFI system partition, because in a specific folder in that partition we have our malicious EFI application.

14:45.460 --> 14:55.220
We're going to go to that folder, we're going to execute that EFI application and the EFI application is going to modify the entire boot flow.

14:55.220 --> 15:00.140
And we have configured the application to drop the root kit in memory.

15:00.640 --> 15:16.500
But we provide you with a tool to create the EFI, sorry, to create the configuration the EFI application uses because the EFI application can drop something in memory, modify partitions, can disable security protections.

15:16.500 --> 15:22.140
But in this demo we have only configured the EFI application to drop the root kit in memory.

15:22.140 --> 15:31.380
So as you can, as you are going to see now in a moment, there is something in kernel space that is printing, hey, hello, hello, hello.

15:31.380 --> 15:38.620
There is something in kernel space that can modify the entire operating system, how the operating system works.

15:38.760 --> 15:51.740
And we're going to explain that in a moment but you can also use that, a user mode application like that, hello.exe to communicate with the kernel mode driver.

15:51.920 --> 15:58.900
And something important to note is that the EFI application can disable DSE, of course you can configure the application to do it.

15:58.900 --> 16:04.600
But it's not necessary, it's not mandatory to drop the root kit in memory.

16:04.600 --> 16:15.540
In fact as you are going to see in a moment, DSE is still enabled because we saw, we saw that the root kit is already in memory.

16:28.310 --> 16:34.210
Now let's take a moment to talk about the power of the UFI specification itself.

16:34.270 --> 16:45.410
When we think about a boot kit, it's easy to just focus on hooking boot functions but UFI applications are not limited to redirection of patching.

16:45.410 --> 17:00.810
A UFI application can interact with a wide range of low level services because the UFI specification spans thousands of pages covering protocols for managing memory, file systems and even networking.

17:00.910 --> 17:16.410
That means the first element of the malware we build before the operating system even loads can fetch files from a remote server on the internet, modify partitions, create loads and leave markers for later payloads.

17:16.410 --> 17:22.730
In other words, you can do almost anything you want using a UFI application.

17:23.070 --> 17:30.830
And a word of advice, if you ever decide to go through all the thousands of pages of this specification, don't bother with coffee.

17:30.830 --> 17:31.990
It's useless.

17:31.990 --> 17:34.350
You need at least a couple of beers.

17:36.190 --> 17:41.770
Continuing with UFI, UFI defines two major service categories.

17:41.890 --> 17:47.470
Boot services which are only available during the early boot process is the blue zone.

17:47.650 --> 17:53.870
And then run time services which remain available even after the operating system has taken control.

17:53.870 --> 17:55.490
That's the orange zone.

17:55.490 --> 18:01.330
This distinction is crucial because every UFI application relies on boot services.

18:01.330 --> 18:11.850
So all the memory and resources it sets up are discarded once a call is made to terminate boot services and the operating system takes control.

18:12.290 --> 18:16.350
We've already loaded the root kit into memory by this stage.

18:16.350 --> 18:19.410
So losing boot services doesn't really hurt us.

18:19.710 --> 18:32.370
But if we design our code with this in mind, we can take advantage of run time services to establish something during boot that persists even after our application itself is gone.

18:33.890 --> 18:39.070
One way to achieve this is by developing a DXC run time driver.

18:39.070 --> 18:46.870
A special kind of UFI driver that stays in memory after the boot and allows you to hook run time services.

18:47.230 --> 18:52.610
In other words, it plans hooks that remain active while the system is running.

18:52.810 --> 19:02.330
This gives you an almost invisible back door which allows you to execute arbitrary payloads and read or write anywhere in memory.

19:02.430 --> 19:06.230
So at this point, what is our boot kit in practice?

19:06.770 --> 19:09.730
It consists in two main components.

19:09.750 --> 19:26.030
First, a UFI application that cooks key functions to stay alive through the boot process, drops the root kit into memory at the right moment, disables security protections if needed, and takes full advantage of the UFI specification.

19:26.410 --> 19:34.630
And second, a malicious DXC run time driver acting as a back door that can read and write in memory while the system is running.

19:36.750 --> 19:39.850
So let's see the second device.

19:48.110 --> 19:52.410
So as you can see here, we have an HTTP server up.

19:52.910 --> 19:55.970
We're going to do the same we did in the first demo.

19:55.970 --> 20:06.310
We're going to boot into the ASP and in a specific folder now we have, we're going to see two files, the UFI application and the DXC run time driver.

20:06.750 --> 20:17.670
We're going to execute the UFI application and the UFI application is going to download a UFI utility in the disk.

20:18.150 --> 20:31.630
We don't use that UFI utility in this demo, but if you see the source code that is completely available, you're going to realize what new capabilities this UFI utility gives me.

20:32.210 --> 20:37.490
The UFI application is going to load the DXC run time driver in memory too.

20:38.370 --> 20:41.550
And it downloaded that file.

20:43.630 --> 20:48.750
And now the DXC run time driver is in memory because the UFI application loaded.

20:49.550 --> 20:57.050
We have developed a tool to communicate with the DXC run time driver.

20:57.050 --> 21:15.850
Something important to know is we, give me a moment, I have to pause here, you have to execute that UFI, sorry, you have to execute the program we developed with admin privileges.

21:15.850 --> 21:19.970
That's very important to communicate with the DXC run time driver.

21:20.410 --> 21:26.210
So we're going to use that specific tool first to check if the DXC run time driver is in memory.

21:26.410 --> 21:28.910
He's going to say, oh yeah, I'm alive.

21:29.170 --> 21:41.370
So now we can drop another malicious component in memory, we can execute payloads, we can execute shell codes, we can read and write anywhere in memory.

21:41.390 --> 21:51.250
And we have configured specific functionality to communicate with the DXC run time driver and say, hey, I want you to load this rootkit.

21:51.250 --> 21:54.510
I want you to load this malicious kernel mod driver.

21:54.530 --> 21:55.690
And it loaded.

21:55.690 --> 22:01.850
So now you have two ways to load something in memory to load the rootkit.

22:03.050 --> 22:17.550
You can use the UFI application or you can use the DXC run time driver to drop something in memory that as we are going to see now in a moment can modify how the operating system works.

22:18.830 --> 22:24.490
The core of the malware and what truly gives the bootkit its power is the rootkit.

22:24.490 --> 22:33.230
The rootkit is the component that lives in kernel space, operates with the highest privileges and enables deep manipulation of the system.

22:33.250 --> 22:39.750
From intercepting callbacks to hiding files and network activity, the rootkit is what delivers full control.

22:40.010 --> 22:48.550
In fact, everything we have discussed so far, UFI, hookings, early boot hijacking, run time drivers, has just been the setup.

22:48.550 --> 22:53.150
It's all part of the infection chain that ensures the rootkit runs reliably.

23:01.260 --> 23:21.560
As you can see in the right circle, a rootkit, it could be, but most of the time a rootkit is not just a malicious kernel driver.

23:21.560 --> 23:26.720
There are more components that make up this concept, all working in a coordinated way.

23:27.300 --> 23:32.100
So the question now is what makes this rootkit we have built, this driver , a good one?

23:32.100 --> 23:37.880
What key aspects did we focus on to give it a solid foundation and meaningful capabilities?

23:37.880 --> 23:46.860
Well, there are more techniques implemented, as you will see in the source code, but we think these six form the essential foundation to start with.

23:47.140 --> 23:48.760
First, communication.

23:48.760 --> 23:59.940
A good rootkit must be able to communicate either with a user-learned application, with a command and control server, or both, while still being capable of acting autonomously when necessary.

23:59.940 --> 24:07.220
This is what allows you to send instructions, receive responses, and adapt the driver's behavior on demand.

24:08.460 --> 24:11.700
Second, direct kernel object manipulation.

24:12.240 --> 24:20.940
This is what allows the rootkit to, for example, do something as fundamental as hiding a process.

24:21.040 --> 24:31.980
And while that may sound simple, now in 2025 it has to be done the right way, otherwise you risk a protection and crashing the system with a blue screen.

24:32.380 --> 24:34.500
Third, keystroke logging.

24:34.540 --> 24:43.620
It's also possible to capture keystrokes at the kernel level, intercepting some kind of packets.

24:45.040 --> 24:48.260
Fourth, network filtering.

24:48.340 --> 25:02.380
By leveraging the Windows filtering platform technology, the rootkit can alter, block, you know, capture network traffic in real time.

25:02.740 --> 25:06.560
Fifth, kernel level command and control manipulation.

25:07.060 --> 25:22.440
As you can see on the screen, Winsock kernel allows the rootkit to make HTTP connections entirely within the driver.

25:22.500 --> 25:29.080
So enabling a full command and control in the internal space.

25:29.080 --> 25:31.460
So this is very important.

25:31.460 --> 25:44.100
You don't need a user land process to communicate with the server on the Internet, download files or even handle network connections or communications.

25:44.100 --> 25:47.980
Because the driver can handle all of it on its own.

25:48.260 --> 25:51.280
And finally, file system filtering.

25:51.560 --> 25:58.180
There is a special class of drivers that many security solutions use called mini-filters.

25:58.320 --> 26:14.600
And the rootkit can also make use of the underlying technology behind those drivers to hide and deny the access to specific files and folders, effectively preventing the operating system and other tools from analyzing them.

26:15.040 --> 26:21.640
So we're going to see a rootkit with these six capabilities.

26:26.800 --> 26:29.120
We're going to boot into the ESP.

26:29.120 --> 26:34.200
In the ESP we have a malicious UFI application.

26:34.200 --> 26:36.620
We're going to execute the UFI application.

26:36.620 --> 26:45.100
The UFI application is going to modify the entire boot flow and it's going to drop all rootkit in memory.

26:50.500 --> 26:56.140
We have developed a user mode application to communicate with the rootkit.

26:56.140 --> 27:02.340
You don't need admin privileges to open this, to execute this application.

27:02.660 --> 27:12.300
We're going to use this user mode application to communicate with the kernel mode driver and say, hey, the first thing we're going to try is hiding a process.

27:12.300 --> 27:17.320
We're going to try and hide the one drive.exe process with that specific bit.

27:17.320 --> 27:25.280
It's going to fail because we have to execute some commands to see if the kernel mode driver is in memory.

27:25.280 --> 27:35.960
So we execute them and now you're going to see how that specific line is going to be printed in red and the process disappears from the eyes of the user.

27:35.960 --> 27:41.840
Well, from the eyes of the task manager and in this case the process hacker program.

27:42.080 --> 27:52.340
We can list the hidden processes and we can hide in an easy way only with the identifier and the process appears again.

27:52.460 --> 27:55.780
We can do the same with files and folders.

27:55.780 --> 28:10.260
So we're going to copy a specific folder here and we're going to communicate with the kernel mode driver and say, hey, I don't want the user to see that specific file.

28:10.260 --> 28:12.660
We reload it and it disappeared.

28:13.160 --> 28:17.200
We communicate again with the kernel mode driver and it appeared again.

28:17.220 --> 28:24.980
It's like there is something in the kernel space that modifies how the operating system works.

28:25.640 --> 28:28.180
We can block connections too.

28:28.180 --> 28:38.120
Maybe we don't want the computer or the user to be able to communicate with some kind of IP addresses, some servers on the internet, some range.

28:38.520 --> 28:45.780
We block those IP addresses and the user, the machine cannot communicate with them.

28:45.780 --> 28:53.020
There is something in the kernel space that denies those communications.

28:56.960 --> 29:01.780
And we can hide network connections too.

29:02.440 --> 29:08.820
We execute netstat, as you can see there are some TCP connections to the remote port 443.

29:10.040 --> 29:18.240
We communicate with the driver and say, hey, I don't want the user to see those connections, maybe there is a shell code or whatever.

29:19.980 --> 29:24.760
We execute netstat again and the connections disappear from the eyes of the user.

29:26.600 --> 29:35.040
The thing is, you don't need a user mode application to communicate with the driver.

29:35.620 --> 29:40.280
You can develop some kind of alternative ways of communication.

29:41.560 --> 29:46.680
You can, for example, enable a keylogger.

29:46.680 --> 29:54.820
The driver can capture, as you are going to see in a moment, can capture every keystroke you type.

29:54.820 --> 30:03.000
So you can use the keylogger to communicate with the driver so you don't need the application.

30:06.520 --> 30:14.940
We are going to show you that we have categorized everything in different techniques.

30:15.000 --> 30:31.380
We have seen something related with the kernel object manipulation, keyboard filtering, WFP, mini filter and now WSK.

30:31.840 --> 30:36.160
As I said before, this is very important.

30:36.660 --> 30:44.100
You can enable a fully common and controlled channel in the driver.

30:44.100 --> 30:57.980
So you enable the command and control and the driver is going to call your server on the internet and your server responds, hey, I want you to execute this thing and the driver is going to execute it.

30:58.340 --> 31:03.440
In this version we don't provide you a full command and control in the source code.

31:04.160 --> 31:11.900
So you can find everything you need to develop your own command and control in the kernel space.

31:11.900 --> 31:14.340
But that is the idea.

31:15.200 --> 31:18.900
You can wait a few months and we are going to release that as well.

31:24.350 --> 31:41.230
So we cannot explain these six techniques in detail, but you have all the source code and not just the root source code itself but also a stand-alone proof of concepts for each example.

31:41.230 --> 31:49.790
There is a book just for communication, another just for how to hide a process, another just for the key logger and so on.

31:49.790 --> 31:57.030
That being said, understanding how a user mode application communicates with a kernel mode driver is crucial.

31:57.090 --> 32:11.790
Learning the fundamentals of how IOCTLs and how IRPs work is going to give you a solid foundation and will naturally prepare you to move on to exploiting vulnerabilities in kernel mode drivers as you progress in this area.

32:11.790 --> 32:16.390
That's going to be something you are going to introduce yourself as you progress.

32:17.130 --> 32:20.630
I hate doing this but I don't have so much time.

32:20.630 --> 32:24.270
So communication, you have some work to do at home.

32:24.270 --> 32:43.010
So communication, kernel structure manipulation, keyboard filtering, network filtering, kernel level command and control, file system filtering, and of course the entire boot process infection chain we have been talking about along with the security bypasses we mentioned at the beginning,

32:43.010 --> 32:45.730
all of that brings us here.

32:48.400 --> 32:50.740
We are going to see the last demo.

32:53.160 --> 32:56.940
This is vulnerable by the way.

32:57.980 --> 33:01.400
So we are going to bring up a physical machine.

33:01.600 --> 33:05.600
The boot kit works in virtual machines and physical machines.

33:06.280 --> 33:11.140
So we are going to install the boot kit, UFI boot kit.

33:11.760 --> 33:16.200
You need admin privileges to install the boot kit.

33:16.440 --> 33:20.760
We are going to execute, sorry, we are going to pause it here.

33:20.760 --> 33:23.260
We execute a script.

33:23.260 --> 33:26.020
Everything is available so don't worry.

33:26.020 --> 33:30.040
We execute a script to check if secure boot is enabled.

33:30.460 --> 33:33.420
And yes, secure boot is enabled as you see on the screen.

33:33.420 --> 33:40.780
But there is some kind of flaw in the UFI firmware, so who cares if secure boot is enabled or not.

33:41.000 --> 33:42.540
The machine is vulnerable.

33:44.040 --> 33:47.780
We install the UFI boot kit.

33:47.780 --> 33:51.160
We add a new boot entry by default.

33:51.340 --> 33:57.640
I'm going to, you know, the internet connection was slow and we have to download something.

33:58.000 --> 34:03.120
So the root kit, sorry, the UFI boot kit is installed.

34:04.160 --> 34:08.260
So now we shut down the machine.

34:12.460 --> 34:17.000
We power on again and the

34:21.060 --> 34:22.900
UFI boot kit is there.

34:22.900 --> 34:30.860
UFI boot kit, you know, you can configure the boot kit to not show the messages.

34:32.160 --> 34:39.460
The UFI boot kit, the UFI boot kit is dropped the root kit or root kit in memory.

34:40.620 --> 34:51.020
By default we have configured the UFI application to drop some kind of basic kernel mode driver, some kind of basic root kit in memory.

34:51.020 --> 34:56.040
So you can use that specific kernel mode driver.

34:56.040 --> 35:01.560
You can communicate with it and say, hey, I want you to load another kernel mode driver.

35:01.560 --> 35:15.540
We do it by default this way because maybe you want to load or root kit or maybe you want to load the proof of concept we give you to blind IDRs or you want to load your own root kit.

35:15.540 --> 35:32.960
So by default the UFI application dropped a basic kernel mode driver in memory and you can communicate, as you can see in the screen, you can communicate with that specific kernel mode driver and say, hey, I want you to load another one.

35:34.140 --> 35:39.360
So this machine is fully compromised.

35:39.360 --> 35:41.560
There are no more levels.

35:52.320 --> 36:01.380
Now that you have seen the final demo, it's time to take out your phones and make a picture of the screen.

36:01.380 --> 36:04.420
On the screen you will see six QR codes.

36:04.420 --> 36:09.980
This gives you access not just to everything we showed here today but much more.

36:09.980 --> 36:21.360
Starting from the top row, left to right, the first QR takes you to the repository or UFI boot kit project.

36:21.500 --> 36:31.700
It includes the UFI application, basic kernel mode drivers that UFI application can drop in memory, the driver, the tool to

36:36.840 --> 36:50.660
create the encrypted configuration UFI application uses, and a massive amount of documentation on how to get started in developing boot kits.

36:50.660 --> 36:58.320
So everything you need to develop your first UFI boot kit from scratch is there in the first QR.

36:58.420 --> 37:08.040
The second takes you to the Bantic repository or full featured kernel mode boot kit.

37:08.220 --> 37:20.320
You will find the kernel mode driver, the application to communicate with the kernel mode driver, and a dozen proof of concepts for each technique implemented and documentation as well.

37:20.600 --> 37:32.080
The third QR takes you to a repository with hundreds of resources you can use to dive even deeper into the subject.

37:33.000 --> 37:43.680
On the bottom row, the first QR, I think it gives you access to a set of scripts you use to automate the entire development environment set up.

37:43.680 --> 37:49.880
You need to configure something to develop boot kits and root kits in a machine.

37:49.880 --> 37:54.560
So you can execute over scripts and it's completely automatically.

37:55.120 --> 38:08.880
The second QR, that's a good one, the last one, there is some notes there to install the root kit on a physical real machine.

38:09.200 --> 38:16.060
And the last one includes some notes to help you analyze your own UFI firmware and check for non‑vulnerabilities.

38:17.580 --> 38:27.720
We believe this is the first time so much documentation and code has been shared with the entire community to help you build both a boot kit and a root kit.

38:28.040 --> 38:39.500
But that was the idea, to provide anyone looking to deliver adversary simulation services with the knowledge to emulate the kind of malware only APTs deploy.

38:39.900 --> 38:53.720
And the last thing we want to say, as you can see on the screen, our lovely dog, Shira, passed away recently and without her we wouldn't be here.

38:53.820 --> 38:58.040
So you all owe her a big thank you for making this talk.

38:58.040 --> 39:01.100
And that's all from us.

39:01.100 --> 39:07.340
If you want to see, if someone wants to see a live demo, we have the vulnerable computer right here.

39:07.340 --> 39:11.580
We are very approachable people and we have some cool stickers too.

39:11.700 --> 39:15.860
So that's all from us.

39:15.860 --> 39:17.020
Enjoy the malware.

39:17.020 --> 39:20.780
You are not going to find anything like this on the Internet.

39:20.780 --> 39:23.280
This is very, very cool.

39:23.360 --> 39:24.820
So enjoy it.

39:24.820 --> 39:25.660
See you soon.

