Homepage Windows Primer Module 1: The Boot Process Legacy BIOS/MBR Boot Lab 1.1: MBR Current UEFI/GPT Boot Lab 1.2: UEFI/GPT Securing the Boot Process Lab 1.3: Secure Boot/TPM Module Review Module 2: Processes, Services, and File Structure Module 3: Registry and Configuration Module 4: Drivers and Libraries Module 5: Windows in an Enterprise Environment Linux Undo Script

Welcome to Pete's Tech Site

Windows Primer

Welcome to the Windows Primer page. The intent of this section is to provide a collection of resources detailing the fundamental components and processes of the Windows operating system with a focus on offensive cyber operations.

The Boot Process

The boot process for a PC begins with a Power On Self Test (POST). The POST uses firmware code to check the status of key hardware components such as the Random Access Memory (RAM) and the Central Processing Unit (CPU) registers. After the POST, the machine starts the bootstrap loader to begin the Operating System (OS) boot process. From the early 1980s to mid 2010s, PCs used a Basic Input Output System (BIOS) and a boot drive partitioned with a Master Boot Record (MBR) to load the operating system. The Unified Extensible Firmware Interface (UEFI) was released in 2005 and superseded the legacy BIOS that most motherboards used. UEFI in conjunction with the Globally Unique Indentifier Partition Table (GPT), have mostly replaced the legacy BIOS/MBR system for booting PCs (as of 2022).

Legacy BIOS/MBR Boot

NeoSmart provides a good written explanation of the legacy boot process here.

Lowell Vanderpool provides an explanation of this process this video:

Key points:

  • The first 512 byte sector (sector 0) of a boot drive holds the MBR
  • On PCs, the final two bytes of the 512-byte MBR are called the boot signature
  • The BIOS uses the boot signature to determine if the selected boot drive is bootable
  • If a drive is bootable, the last two bytes of the MBR should be 0x55 0xAA
  • The bootcode (usually the first 440 bytes of the MBR) contains executable code to load the boot sector of the active partition
  • The boot sector contains instructions to load the boot file stored on the actual filesystem of the disk
  • Windows XP's/Server 2003's boot loader is ntldr
  • Vista, 7, 8, 10, and 11 use bootmgr
  • Most Linux distributions use the GRand Unified Bootloader (GRUB) which is stored in the core.img file
  • The maximum addressable storage space of an MBR partitioned disk is 2 TiB (232 x 512 bytes)
  • An MBR partitioned drive can have a maximum of 4 (primary) partitions

MBR Lab

Lab Objectives:

  • Create a bootable MBR drive in Windows 10
  • Copy boot files to the drive from Windows
  • Examine boot files in Windows
  • Examine the MBR in Linux
  1. Open a command prompt as an Administrator

  2. Enter   diskpart  
  3. Microsoft DiskPart version 10.0.19041.964 Copyright (C) Microsoft Corporation. On computer: DESKTOP-8M0RP18 DISKPART>

  4. Enter   list disk  
  5. DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 60 GB 1024 KB Disk 1 Online 57 GB 0 B

  6. Enter   select disk (number)   where (number) is the number of the disk you are going to partition. Ensure you select the correct disk or you may destroy your filesystem!
  7. Disk 1 is now the selected disk.

  8. Enter   clean   To erase the disk.
  9. DiskPart succeeded in cleaning the disk.

  10. Enter   create partition primary   to create a new primary partition
  11. DiskPart succeeded in creating the specified partition.

  12. Enter   select partition 1   to select the newly created partition
  13. Partition 1 is now the selected partition.

  14. Enter   format fs=ntfs quick   to format the new partition with the New Technology File System (NTFS)
  15. 100 percent completed DiskPart successfully formatted the volume.

  16. Enter   active   to set the partition as active (bootable)
  17. DiskPart mark the current partition as active.

  18. Enter   assign letter=B   to assign a drive letter mount point for the partition
  19. DiskPart successfully assigned the drive letter or mount point.

  20. Enter   exit   to return to the command prompt. We will now copy the Windows boot files to the partition using bcdboot.

  21. Enter   bcdboot C:\Windows /s B: /f BIOS   to copy system files to the B: drive for BIOS booting (assuming Windows is installed to C:\)
  22. Boot files successfully created.

  23. Enter   B:   to switch to the B: drive

  24. Enter   dir   to get a directory listing
  25. Directory of B:\ File Not Found

    Notice that no files are listed. Why is this?

  26. Enter   dir /as   to list hidden system files (dir /ah also works)
  27. Directory of B:\ 02/04/2022 05:11 PM <DIR> Boot 02/01/2022 03:22 PM 413,786 bootmgr 12/07/2019 01:08 AM 1 BOOTNXT 02/04/2022 04:18 PM <DIR> System Volume Information 2 File(s) 413,787 bytes 2 Dir(s) 61,388,775,424 bytes free

    Notice that bootmgr has been copied from our Windows 10 system to the drive. Windows 10 does not provide the tools necessary to work directly with the MBR, so we will need to switch to a Linux system to examine our drive there.

  28. After connecting the drive to the Linux machine enter   lsblk   to list block storage devices
  29. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 465.8G 0 disk |-sda1 8:1 0 512M 0 part /boot/efi |-sda2 8:2 0 464.3G 0 part / `-sda3 8:3 0 976M 0 part [SWAP] sdb 8:16 1 57.3G 0 disk `-sdb1 8:17 1 57.3G 0 part nvme0n1 259:0 0 3.7T 0 disk |-nvme0n1p1 259:1 0 190M 0 part |-nvme0n1p2 259:2 0 128M 0 part |-nvme0n1p3 259:3 0 3.7T 0 part |-nvme0n1p4 259:4 0 990M 0 part |-nvme0n1p5 259:5 0 17.3G 0 part `-nvme0n1p6 259:6 0 1.4G 0 part

    On this machine, sdb is the attached drive we created. Note: Since the MBR exists outside of the NTFS filesystem partition, we won't be mounting the drive to examine it. Instead we must work directly with the block device sdb. We need to copy the first 512 bytes from sdb in to a file so we can examine the MBR.

  30. Enter   sudo dd if=/dev/sdb of=~/MBR.bin bs=512 count=1   this will copy 1 block that is 512bytes in size.
    1+0 records in 1+0 records out 512 bytes copied, 0.00198152 s, 258 kB/s

    Now we can examine the MBR.bin file to see the contents of the MBR.

  31. Enter   vim ~/MBR.bin   to open the file in vim
  32. Notice the output is not legible. This is because we are trying to view binary data as ASCII text. We need to view it as hexadecimal.

  33. Enter   :%!xxd   to filter the entire file with the xxd hexdump utility
  34. 00000000: 33c0 8ed0 bc00 7c8e c08e d8be 007c bf00 3.....|......|.. 00000010: 06b9 0002 fcf3 a450 681c 06cb fbb9 0400 .......Ph....... 00000020: bdbe 0780 7e00 007c 0b0f 850e 0183 c510 ....~..|........ 00000030: e2f1 cd18 8856 0055 c646 1105 c646 1000 .....V.U.F...F.. 00000040: b441 bbaa 55cd 135d 720f 81fb 55aa 7509 .A..U..]r...U.u. 00000050: f7c1 0100 7403 fe46 1066 6080 7e10 0074 ....t..F.f`.~..t 00000060: 2666 6800 0000 0066 ff76 0868 0000 6800 &fh....f.v.h..h. 00000070: 7c68 0100 6810 00b4 428a 5600 8bf4 cd13 |h..h...B.V..... 00000080: 9f83 c410 9eeb 14b8 0102 bb00 7c8a 5600 ............|.V. 00000090: 8a76 018a 4e02 8a6e 03cd 1366 6173 1cfe .v..N..n...fas.. 000000a0: 4e11 750c 807e 0080 0f84 8a00 b280 eb84 N.u..~.......... 000000b0: 5532 e48a 5600 cd13 5deb 9e81 3efe 7d55 U2..V...]...>.}U 000000c0: aa75 6eff 7600 e88d 0075 17fa b0d1 e664 .un.v....u.....d 000000d0: e883 00b0 dfe6 60e8 7c00 b0ff e664 e875 ......`.|....d.u 000000e0: 00fb b800 bbcd 1a66 23c0 753b 6681 fb54 .......f#.u;f..T 000000f0: 4350 4175 3281 f902 0172 2c66 6807 bb00 CPAu2....r,fh... 00000100: 0066 6800 0200 0066 6808 0000 0066 5366 .fh....fh....fSf 00000110: 5366 5566 6800 0000 0066 6800 7c00 0066 SfUfh....fh.|..f 00000120: 6168 0000 07cd 1a5a 32f6 ea00 7c00 00cd ah.....Z2...|... 00000130: 18a0 b707 eb08 a0b6 07eb 03a0 b507 32e4 ..............2. 00000140: 0500 078b f0ac 3c00 7409 bb07 00b4 0ecd ......<.t....... 00000150: 10eb f2f4 ebfd 2bc9 e464 eb00 2402 e0f8 ......+..d..$... 00000160: 2402 c349 6e76 616c 6964 2070 6172 7469 $..Invalid parti 00000170: 7469 6f6e 2074 6162 6c65 0045 7272 6f72 tion table.Error 00000180: 206c 6f61 6469 6e67 206f 7065 7261 7469 loading operati 00000190: 6e67 2073 7973 7465 6d00 4d69 7373 696e ng system.Missin 000001a0: 6720 6f70 6572 6174 696e 6720 7379 7374 g operating syst 000001b0: 656d 0000 0063 7b9a 85f2 195a 0000 8020 em...c{....Z... 000001c0: 2100 07fe ffff 0008 0000 00f8 2807 0000 !...........(... 000001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.

    Is this drive marked as bootable? How can you tell?

Current UEFI/GPT Boot

GPT

Because of MBR's disk size limitation, as drives approached the 2TB mark in the late 2000s, it's days were numbered. To address disk size and other limitations of the MBR partition scheme, the UEFI specification defined the GPT format. A GPT FAQ page from Microsoft can be accessed here which provides a brief overview.

Key points are as follows:

  • GPT supports extremely large drives, the size limitation is now based on OS or filesystem restrictions not the partition scheme
  • Windows supports up to 128 basic GPT partitions, as opposed to MBR's 4
  • Each GPT partition has a 36-character Unicode name to provide a human readable ID
  • Windows Server 2003 with SP1 and later support GPT partitioned disks
  • GPT provides a Protective MBR to prevent legacy tools from thinking the disk is blank and re-partitioning it
  • A Windows UEFI boot drive must have an Extensible Firmware Interface System Partition (ESP), which stores boot files, a Microsoft Reserved Partition (MSR), which provides reserved space for the OS, and a basic data partition which stores the OS
  • Only one ESP should exist on a system no matter how many OSes are installed. Multiple OSes use the same ESP
  • UEFI firmware can still boot MBR partitioned disks, but GPT is the future

Microsoft states that, "GPT disks do not allow hidden sectors. Software components that formerly used hidden sectors now allocate portions of the MSR for component-specific partitions. For example, converting a basic disk to a dynamic disk causes the MSR on that disk to be reduced in size and a newly created partition holds the dynamic disk database."

Given that the MSR is a hidden storage space which is required by Windows GPT drives, and usually has free space available, what potential uses can you imagine for this partition?

UEFI

Here is Lowell Vanderpool with an explanation of the UEFI boot process for Windows:

Sandip Roy provides a good comparison overview of BIOS vs. UEFI on this page. Additionally, this diagram from Microsoft provides a flow chart of both BIOS/MBR and UEFI/GPT boot processes for Windows.

Key points:

  • While BIOS can only load the MBR sector, UEFI supports reading FAT32/FAT16 partitions and files
  • UEFI will load bootloaders from the EFI System Partition
  • The ESP must be FAT16/32 formatted and must have an \EFI directory in the root of that partition
  • Windows will create an \EFI\Microsoft subdirectory in the ESP
  • Bootmgfw.efi (Lowell's video has a typo) is the Windows UEFI Boot Manager file
  • Windows writes the path of the Boot Manager to the UEFI Non-Volatile Random Access Memory (NVRAM)
  • \EFI\Boot\bootx64.efi is the default boot path that UEFI firmware on 64-bit X86 systems will use
  • The Boot Manager is stored with the Boot Configuration Data (BCD) registry hive in \EFI\Microsoft\Boot
  • The Boot Manager will load boot configuration data from BCD to enumerate boot options
  • The BCD will point to the location of winload.efi (default \Windows\system32\winload.efi) to load the Windows kernel (ntoskrnl.exe)
Once the Windows OS kernel is loaded the kernel boot process is the same for both BIOS/MBR and UEFI systems:
  • The Kernel loads the system registry hive and starts drivers marked BOOT_START
  • The Kernel passes control to the Session Manager process (smss.exe) which initializes the system session and loads the remaining drivers
  • For Windows Vista and later smss.exe launches a second instance of itself to configure session 0
  • This smss.exe instance launches the Windows Startup Application (wininit.exe) and the Client-Server Runtime Subsystem (csrss.exe) and then exits
  • wininit.exe launches services.exe, the Local Security Authority Subsystem Service (lsass.exe), and the Local Session Manager (lsm.exe)
  • smss.exe starts another instance of itself to configure a console session
  • The console smss.exe instance launches a csrss.exe and winlogon.exe instance for the console session to prepare for user login
  • winlogon.exe launches the Logon User Interface Host (logonui.exe) which presents the Windows Security screen
  • The Windows Security screen prompts the user to press CTRL+ALT+DELETE to log in, completing the Windows loading process

UEFI/GPT Lab

Lab Objectives:

  • Create a UEFI bootable GPT partitioned drive in Windows 10
  • Copy boot files to the drive from Windows
  • Examine boot files in Windows
  1. Open a command prompt as an Administrator

  2. Enter   diskpart  
  3. Microsoft DiskPart version 10.0.19041.964 Copyright (C) Microsoft Corporation. On computer: DESKTOP-8M0RP18 DISKPART>

  4. Enter   list disk  
  5. Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 60 GB 1024 KB Disk 1 Online 57 GB 57 GB

  6. Enter   select disk (number)   where (number) is the number of the disk you are going to partition. Ensure you select the correct disk or you may destroy your filesystem!
  7. Disk 1 is now the selected disk.

  8. Enter   clean   To erase the disk.
  9. DiskPart succeeded in cleaning the disk.

  10. Enter   convert gpt   to convert the disk to GPT format
  11. DiskPart successfully converted the selected disk to GPT format.

  12. Enter   exit   to return to the command prompt

  13. Enter   powershell   to launch the powershell interpreter
  14. Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6

  15. Enter   get-disk   to list available disks
  16. Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition Style ------ ------------- ------------- ------------ ----------------- ---------- ---------- 0 QEMU HARDDISK QM00001 Healthy Online 60 GB MBR 1 SanDisk Ultra USB... 4C530001131126121261 Healthy Online 57.28 GB GPT

  17. Enter   New-Partition -DiskNumber (number) -Size 100MB -GptType "{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}" -DriveLetter "S"   where (number) is the correct number for your disk.
  18. This creates an EFI system partition 100MB in size and labels it with the S: drive mount point. The "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" GUID identifies it as an EFI system partition to GPT.

    DiskPath: \\?\usbstor#disk&ven_sandisk&prod_ultra_usb_3.0&rev_1.00#4c530001131126121261&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b} PartitionNumber DriveLetter Offset Size Type --------------- ----------- ------ ---- ---- 1 S 1048576 100 MB System

  19. Enter   Format-Volume -FileSystem FAT32 -NewFileSystemLabel "SYSTEM" -DriveLetter "S" -Force   to format the partition with a FAT32 filesystem and label it "SYSTEM".
  20. DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining Size ----------- ------------ -------------- --------- ------------ ----------------- ------------- ---- S SYSTEM FAT32 Removable Healthy OK 96 MB 96 MB

  21. Enter   New-Partition -DiskNumber 1 -Size 16MB -GptType "{e3c9e316-0b5c-4db8-817d-f92df00215ae}"   to create a MSR partition.
  22. DiskPath: \\?\usbstor#disk&ven_sandisk&prod_ultra_usb_3.0&rev_1.00#4c530001131126121261&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b} PartitionNumber DriveLetter Offset Size Type --------------- ----------- ------ ---- ---- 2 105906176 16 MB Reserved

    The "e3c9e316-0b5c-4db8-817d-f92df00215ae" GUID identifies the partion as an MSR

  23. Enter   New-Partition -DiskNumber 1 -UseMaximumSize -GptType "{ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}" -DriveLetter "W"   to create a basic GPT partition with the rest of the storage space and assign drive letter W:
  24. DiskPath: \\?\usbstor#disk&ven_sandisk&prod_ultra_usb_3.0&rev_1.00#4c530001131126121261&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b} PartitionNumber DriveLetter Offset Size Type --------------- ----------- ------ ---- ---- 3 W 122683392 57.17 GB Basic

  25. Enter   Format-Volume -FileSystem NTFS -NewFileSystemLabel "WINDOWS" -DriveLetter "W" -Force   to format the partition as NTFS and label it WINDOWS.
  26. DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining Size ----------- ------------ -------------- --------- ------------ ----------------- ------------- ---- W WINDOWS NTFS Removable Healthy OK 57.08 GB 57.17 GB

    With our drive partitioned and formatted we now need to copy the system boot files.

  27. Enter   bcdboot $env:SystemRoot /s S: /f UEFI   to copy the system boot files for UEFI to the EFI partition.
    Boot files successfully created.

    Notice we used the powershell environment variable $env:SystemRoom to substitue for C:\Windows. This will work even if Windows was installed to D:\Windows or C:\Win.

  28. Enter   S:   to switch to our system partition.

  29. Enter   dir   to view a directory listing.
  30. Directory: S:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/5/2022 1:36 PM EFI

    Notice the EFI partition was created.

  31. Enter   cd EFI   to change to the EFI directory

  32. Enter   dir   to view a directory listing.
  33. Directory: S:\EFI Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/5/2022 1:36 PM Microsoft d----- 2/5/2022 1:36 PM Boot

    Notice two directories: Boot which is the default UEFI path and Microsoft which is unique to Windows.

  34. Enter   dir Boot   to view the Boot directory contents.
  35. Directory: S:\EFI\BOOT Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 2/1/2022 3:22 PM 1559920 bootx64.efi

    Notice bootx64.efi which is the default UEFI boot loader.

  36. Enter   dir Microsoft\Boot   to view the Microsoft EFI Boot directory.
  37. *** LANGUAGE FOLDERS OMITTED *** d----- 2/5/2022 1:36 PM Fonts d----- 2/5/2022 1:36 PM Resources -a---- 10/6/2021 6:51 AM 5145 boot.stl -a---- 2/1/2022 3:22 PM 1559920 bootmgfw.efi -a---- 2/1/2022 3:22 PM 1542472 bootmgr.efi -a---- 12/7/2019 1:09 AM 17720 kdnet_uart16550.dll -a---- 10/6/2021 6:51 AM 27464 kdstub.dll -a---- 12/7/2019 1:09 AM 31544 kd_02_10df.dll -a---- 12/7/2019 1:09 AM 379192 kd_02_10ec.dll -a---- 12/7/2019 1:09 AM 26424 kd_02_1137.dll -a---- 12/7/2019 1:09 AM 239928 kd_02_14e4.dll -a---- 12/7/2019 1:09 AM 44344 kd_02_15b3.dll -a---- 12/7/2019 1:09 AM 44344 kd_02_1969.dll -a---- 12/7/2019 1:09 AM 31544 kd_02_19a2.dll -a---- 12/7/2019 1:09 AM 20280 kd_02_1af4.dll -a---- 12/7/2019 1:09 AM 298296 kd_02_8086.dll -a---- 12/7/2019 1:09 AM 18960 kd_07_1415.dll -a---- 12/7/2019 1:09 AM 48952 kd_0C_8086.dll -a---- 2/1/2022 3:22 PM 1349432 memtest.efi -a---- 12/7/2019 1:08 AM 9796 winsipolicy.p7b -a---- 2/5/2022 1:36 PM 20480 BCD

    Notice bootmgfw.efi which is the default Boot Manager for Windows 10 has the same file size as bootx64.efi.

  38. Enter   get-filehash .\Boot\bootx64.efi   to get a SHA256 hash of the file.

  39. Enter   get-filehash .\Microsoft\Boot\bootmgfw.efi   to get a SHA256 hash as well.
  40. PS S:\EFI> get-filehash .\Boot\bootx64.efi Algorithm Hash Path --------- ---- ---- SHA256 46748BCAC9F362133158176E31AE1431BC9D2DAB57A65CBD9A54979C6BDE4C95 S:\EFI\Boot\bootx64.efi PS S:\EFI> get-filehash .\Microsoft\Boot\bootmgfw.efi Algorithm Hash Path --------- ---- ---- SHA256 46748BCAC9F362133158176E31AE1431BC9D2DAB57A65CBD9A54979C6BDE4C95 S:\EFI\Microsoft\Boot\bootmgfw.efi

    They are the same file. Windows just makes of copy of its Boot Manager and puts it in the default \EFI\Boot\bootx64.efi file. Notice the BCD registry is also in this directory. Let's look at its contents.

  41. Enter   bcdedit /store .\Microsoft\Boot\BCD /enum /v   to view the BCD entries.
  42. Windows Boot Manager -------------------- identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795} device partition=S: path \EFI\Microsoft\Boot\bootmgfw.efi description Windows Boot Manager locale en-us inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e} default {bd73a7a0-86cb-11ec-8657-525400febabb} resumeobject {bd73a79f-86cb-11ec-8657-525400febabb} displayorder {bd73a7a0-86cb-11ec-8657-525400febabb} toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d} timeout 30 Windows Boot Loader ------------------- identifier {bd73a7a0-86cb-11ec-8657-525400febabb} device partition=C: path \Windows\system32\winload.efi description Windows 10 locale en-us inherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7} isolatedcontext Yes allowedinmemorysettings 0x15000075 osdevice partition=C: systemroot \Windows resumeobject {bd73a79f-86cb-11ec-8657-525400febabb} nx OptIn bootmenupolicy Standard

    Note that since we copied the configuration files from our system drive, the Windows Boot Loader is set to the C:\Windows\system32\winload.efi path. Let's compare this BCD registry to the one on our host system.

  43. Enter   bcdedit /enum /v   to view the BCD entries on the host machine. Excluding the /store switch will default to loading the system BCD file.
  44. Windows Boot Manager -------------------- identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795} device partition=\Device\HarddiskVolume1 description Windows Boot Manager locale en-US inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e} default {0fefbebb-83ca-11ec-b344-a67ff87d56db} resumeobject {0fefbeba-83ca-11ec-b344-a67ff87d56db} displayorder {0fefbebb-83ca-11ec-b344-a67ff87d56db} toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d} timeout 30 Windows Boot Loader ------------------- identifier {0fefbebb-83ca-11ec-b344-a67ff87d56db} device partition=C: path \Windows\system32\winload.exe description Windows 10 locale en-US inherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7} recoverysequence {0fefbebc-83ca-11ec-b344-a67ff87d56db} displaymessageoverride Recovery recoveryenabled Yes allowedinmemorysettings 0x15000075 osdevice partition=C: systemroot \Windows resumeobject {0fefbeba-83ca-11ec-b344-a67ff87d56db} nx OptIn bootmenupolicy Standard

    What are the differences in this entry? Is this system configured to use UEFI booting or MBR? How can you tell? BONUS research question: What is bootmgr.efi used for?

    It should be noted that while BCDedit allows you to change Windows Boot Loader settings, it does not allow users to change EFI NVRAM settings. Linux provides an efibootmgr utility which can edit EFI NVRAM settings directly.


Securing the Boot Process

UEFI Vulnerabilities

UEFI firmware is a radical change over BIOS firmware. For comparison, the 1994 plug and play BIOS specification from Intel and Phoenix was 56 pages long and defined basic functionality to configure plug-and-play devices. The UEFI specification is 2558 pages and defines:

  • A full TCP/IP network stack including WiFi, Bluetooth, UDP, IPsec, TLS, HTTP, DNS v4/v6, ARP, DHCP, and FTP support
  • File I/O with support for USB devices
  • A shell environment allowing scripting, and access to pre-boot applications that provide file manipulation and device access
Even a full-on web-browser with internet access can be run from UEFI firmware. UEFI application development is beyond the scope of this module, but if you are interested in exploring it more: here is a Hello World project in C using the EFI API, and a tutorial using bare-metal UEFI assembly. Additionally, you can find an excellent tutorial on UEFI shell scripting here.

All the features provided by UEFI facilitate management subsystems such as the Intel Management Engine and AMD Secure Technology.

The Intel ME:

  • Runs on an embedded microcontroller found in Intel chipsets integrated into motherboards
  • Runs its own operating system with a micro-kernel
  • Provides out-of-band access to system devices to include, RAM, and network interfaces
  • Runs independent of the powerstate of the PC, even if the system is powered off
The massive increase in firmware based capabilities has also massively increased the attack surface available for exploitation. This has lead to a number of CVEs to include:
  • CVE-2017-5689 for Intel Active Management Technology (AMT). This CVE is rated 10 in severity; it allows the complete compromise of integrity and confidentiality of a System while requiring no authentication, and very little skill to execute remotely. An exploit explanation is available here
  • CVE-2018-3628 which revealed a possible buffer overflow in AMT's HTTP handler
  • A number of CVEs were just disclosed allowing potential privilege escalation in machines running InsydeH2O firmware
  • MoonBounce is a rootkit targeting UEFI firmware which was recently discoverd by Kapersky
Firmware exploits are not specific to Windows because they are not specific to any OS. They execute code before, and outside of, any OS installed on a PC. Because of this, they should be considered as a potential attack vector, regardless of what OS a machine is running.

Secure Boot

The UEFI Consortium created the secure boot specification to mitigate the chance of malicious code being loaded and prevent the installation of rootkits and bootkits.

Microsoft provides an overview of the UEFI Secure Boot process on this page, and another more in-depth look at it here. The UEFI Consortium also provides a description and some background information about secure boot in this document. Finally, Brandon Adler gives a good description of the UEFI Secure Boot specification in this video:

Key Points are:

  • The secure boot process creates a chain of trust utilizing public key certificates
  • Secure boot uses RSA 2048 or stronger asymmetric encryption
  • The secure boot Public Key Infrastructure (PKI) is very similar to PKI websites use; they have root certificate authorities (CA), and intermediate CAs, which sign their site's X.509 certificate
  • The Platform Key (PK) is a self-signed key and acts as the root CA in the Secure Boot process
  • The PK is usually set by the equipment manufacturer before shipping a system
  • There can be only one PK in a UEFI secure boot system
  • Key Exchange Keys (KEKs) are a second tier of keys
  • KEKs establish a trust relationship between the OS and the firmware
  • There can be several KEKs in the UEFI NVRAM
  • Most systems have a Microsoft public CA key and a vendor public CA key pre-installed
  • Both the PK and the KEKs can be used to update the secure boot databases
  • The secure boot databases consist of the: Deny List Database (DBX), Allow List Database (DB), Timestamp Database (DBT), and Recovery Database (DB)
  • The DBX is used to explicitly deny images which have a matching SHA-256 hash or revoked X.509 certificate
  • The DBX is the first database that is checked before code is executed
  • The DB stores signed signatures of allowed images such as operating system loaders like bootmgfw.efi
  • The DBT stores timestamps to check if a certificate has expired
  • The DBR stores authorized signatures for recovery images to use in the event that no valid DB image is found
  • Secure boot is supported in Windows 8 and later versions
  • Secure boot is a UEFI specification and does not require a Trusted Platform Module (TPM)
The secure boot process is fairly involved, so here is Lowell Vanderpool with another video explaining it:

Additional Points:

  • On boot, the UEFI firmware verifies the Boot Manager (bootmgfw.efi) signature in the secure boot DB
  • Each Windows component in the boot chain verifies the Authenticode signature of the next component
  • Starting with Windows 8, the Windows Kernel launches the Windows Defender Early Launch Anti-Malware (ELAM) driver (wdboot.sys)
  • ELAM scans the signatures of third-party drivers to ensure they have valid digital signatures before loading them

While secure boot keys such as the PK are not intended to be installed by end-users, it is possible to create your own PK for secure boot and install it to your UEFI NVRAM. The NSA provides this instructional guide on how to completely customize UEFI secure boot with your own key Infrastructure.

Trusted Platform Module (TPM)

TPM is a standard that was developed by the Trusted Computing Group TCG to provide a specification for secure cryptoprocessors. The specification is published by the International Organization for Standardization (ISO) in ISO 11889. TPM 2.0 was published in 2019, and is the current standard. Microsoft provides an overview of TPM functionality in this article.

Here is Mr. Vanderpool again explaining the operation of TPMs:

Here is the second part of the video focusing on Windows 10:

Key Points:

  • A TPM is a secure cryptoproccessor that complies with the ISO 11889 standard developed by the TCG
  • TPMs implement multiple tamper resistant measures
  • TPMs can be used to generate and store cryptographic keys
  • TPMs can generate hashes
  • TPMs can generate true random numbers using analog noise measured from physical sensors
  • The TPM 2.0 specification can be implemented on descrete hardware (dTPM), integrated in chipsets, virtualized by a hypervisor (vTPM), or embedded into firmware (fTPM)
  • TPMs can be used to provide measured boot for a system by using a hash-chain of hardware and firmware components to detect any changes to a systems configuration
  • TPM 1.2 supported SHA1, RSA, XOR, and very limited AES
  • TPM 2.0 supports any hash algorithm with a fixed digest size, any asymmetric algorith with a public/private portion, and any symmetric algorithm
  • Windows Hello is a local login mechanism which uses a simple hash of a PIN or biometric data which is paired with the TPM to allow local login

True understanding of the secure boot process and the TPM requires an understanding of public key cryptography and digital signatures. If you are interesting in learning more about cryptography, Christopher Paar's Introduction to Cryptography Youtube channel provides a 30 hour lecture series that gives a great overview of major algorithms and cryptographic concepts.

Secure Boot/TPM Lab

Lab Objectives:

  • Check the secure boot settings in Windows
  • View the enrolled secure boot keys
  • View the key signatures in boot files
  • View the TPM info
NOTE: You will need a Windows machine with secure boot and TPM enabled to complete this lab. Internet access will also be required to download non-standard Powershell modules.
  1. Open a command prompt as an Administrator

  2. Enter   powershell  

  3. Enter   Confirm-SecureBootUEFI   to verify that UEFI Secure Boot is enabled
  4. True

  5. Make a directory to export UEFI certificates to. Enter:   md UEFI_Certs  
  6. Directory: C:\Users\Pete Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/7/2022 6:17 PM UEFI_Certs

  7. To extract the Platform Key enter:   Get-SecureBootUEFI -Name PK -OutputFilePath .\UEFI_Certs\PK.esl  
  8. Name Bytes Attributes ---- ----- ---------- PK {161, 89, 192, 165...} NON VOLATILE...

  9. To extract the Key Exchange Key(s) enter:   Get-SecureBootUEFI -Name KEK -OutputFilePath .\UEFI_Certs\KEK.esl  
  10. Name Bytes Attributes ---- ----- ---------- PK {161, 89, 192, 165...} NON VOLATILE...

  11. To extract the db keys enter:   Get-SecureBootUEFI -Name db -OutputFilePath .\UEFI_Certs\db.esl  
  12. Name Bytes Attributes ---- ----- ---------- PK {161, 89, 192, 165...} NON VOLATILE...

  13. To extract dbx keys and hashes enter:   Get-SecureBootUEFI -Name dbx -OutputFilePath .\UEFI_Certs\dbx.esl  
  14. Name Bytes Attributes ---- ----- ---------- PK {161, 89, 192, 165...} NON VOLATILE...

    Now that we have the Secure Boot variables saved from NVRAM, we need to extract the certificates and signature hashes from the EFI Signature List (ESL) files. While Linux has an efitools package to help perform this extraction, Windows does not have a equivalent program. (If you want to port sig-list-to-certs to Windows, the source is available here )

    We can still manually extract the certificates in Windows, but we will need some additional tools. First we will install the winget package manager.

  15. Enter:   Add-AppxPackage -Path https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle  

  16. Enter:   winget install --id Git.Git -e --source winget  
  17. This will install the Microsoft Git package, which includes a number of tools including openssl and the vim editor. Now we update the path variable to include the vim.exe and openssl.exe locations.

  18. Enter:   Enter $Env:PATH += ";C:\Program Files\Git\usr\bin"  

  19. Enter:   cd UEFI_Certs   to go to the cert Directory
  20. We will now extract the PK certificate from the PK.esl file. First we need to dump the binary file to a hex format with xxd.

  21. Enter:   xxd PK.esl PK.hex  
  22. Now we can edit the hex dump with vim.

  23. Enter:   vim PK.hex  
  24. 00000000: a159 c0a5 e494 a74a 87b5 ab15 5c2b f072 .Y.....J....\+.r 00000010: cd03 0000 0000 0000 b103 0000 ce4d 5670 .............MVp 00000020: fc9a e34e 85fc 9496 49d7 e45c 3082 039d ...N....I..\0... 00000030: 3082 0285 a003 0201 0202 1050 a1bd 858a 0..........P.... 00000040: e7b6 bc40 2dca 78cd d268 a130 0d06 092a ...@-.x..h.0...* 00000050: 8648 86f7 0d01 010b 0500 3067 310b 3009 .H........0g1.0. 00000060: 0603 5504 0613 0255 5331 0e30 0c06 0355 ..U....US1.0...U 00000070: 0408 0c05 5465 7861 7331 1330 1106 0355 ....Texas1.0...U 00000080: 0407 0c0a 526f 756e 6420 526f 636b 3112 ....Round Rock1. *** REMAINING OUTPUT OMITTED ***

    According to page 1717 of the UEFI specification, the GUID identifier for an x509 certificate list is:

      #define EFI_CERT_X509_GUID \ { 0xa5c059a1, 0x94e4, 0x4aa7, \
      { 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 } };  
    However, the UEFI documentation is in Big Endian format while the firmware actually stores the data in Little Endian format. This calculator can be helpful to convert the values. To read little endian Hex values, read the bytes from right to left, but read each individual byte from left to right. In little endian format the x509 GUID value is: a159c0a5 e494 a74a 87 b5 ab 15 5c 2b f0 72 which we see on the first line of the file:

    00000000: a159 c0a5 e494 a74a 87b5 ab15 5c2b f072 .Y.....J....\+.r

    The next value after the x509 GUID is the UINT32 SignatureListSize value, which defines the length of the signature list including headers. We know this value is 4 bytes long because a 32-bit Unsigned Integer (UINT32) is 32 bits, and 32 bits is 4 bytes. The next 4 bytes after the GUID are:

    00000010: cd03 0000

    However this is little endian, so the big endian value is 0000 03cd. In decimal, this is 973 bytes. Conveniently our hex dump has byte numbers listed in hexadecimal on the side, so we just need to find byte 03cd to find the end of the PK certificate. Scrolling down we see:

    *** Remaining output omitted *** 00000370: a3b9 c037 aaf9 e0f1 83e9 5228 923b b837 ...7......R(.;.7 00000380: 0a0f a2ef 7e0b 0031 d7b1 40f6 eaf5 871a ....~..1..@..... 00000390: 8804 83d9 33f2 9979 24c0 2c43 5b42 2c6c ....3..y$.,C[B,l 000003a0: db05 6c48 23bf 1694 383e 551b 4991 39cc ..lH#...8>U.I.9. 000003b0: b265 3ee8 af15 2445 c85b ad28 3aa7 a488 .e>...$E.[.(:... 000003c0: 948d 0ad8 4b8d c36c 1797 8221 fc ....K..l...!.

    Byte 0000 03c0 is the first byte on the last line of the file. We can count from that byte to find byte 03cd; remember that every 2 hexadecimal digits are 1 byte, and 0xd in hex is decimal 13. We need to count 13 bytes, or 26 hex digits, from the start of the line. 0xfc is 13 bytes from the start of the line, so it is the last byte in the certificate. It is also also the last byte in the file. This makes sense, because there can only be one PK certificate. To extract the certificate from the file, we just need to remove the ESL header information from the beginning of the file. According to the specification, the next value in the header after UINT32 SignatureListSize is UINT32 SignatureHeaderSize. Scrolling back to the top of the file we see:

    00000010: cd03 0000 0000 0000 b103 0000 ce4d 5670 .............MVp

    The next 4 bytes after cd03 0000 is 0000 0000, so the signature has no header. (Note this is the signature header not ESL header). After UINT32 SignatureHeaderSize is UINT32 SignatureSize:

    00000010: cd03 0000 0000 0000 b103 0000 ce4d 5670 .............MVp

    This is b103 0000 which is 0000 03b1 in big endian, so there are 03b1 bytes in the signature. The specification states that SignatureSize may vary but shall always be 16 (size of the SignatureOwner component) + the size of the certificate itself. This means that the next 16 bytes are the SignatureOwner which should not be included in the certificate:

    00000010: cd03 0000 0000 0000 b103 0000 ce4d 5670 .............MVp 00000020: fc9a e34e 85fc 9496 49d7 e45c 3082 039d ...N....I..\0...

    The next 16 bytes are ce4d 5670 fc9a e34e 85fc 9496 49d7 e45c. This means our certificate should start with 3082 039d. We need to delete all bytes before 0x3082 to extract the x509 certificate for the PK. Unfortunately, we can't delete bytes from a hex dump in this format in vim (with line numbers and ASCII) so we need to reformat the output.

  25. Enter:   :q!   to exit vim

  26. Enter:   xxd -ps PK.esl PK.hex   to re-dump the file in postscript plain hexdump style

  27. Enter:   vim PK.hex  

  28. a159c0a5e494a74a87b5ab155c2bf072cd03000000000000b1030000ce4d 5670fc9ae34e85fc949649d7e45c3082039d30820285a003020102021050 a1bd858ae7b6bc402dca78cdd268a1300d06092a864886f70d01010b0500 3067310b3009060355040613025553310e300c06035504080c0554657861 733113301106035504070c0a526f756e6420526f636b3112301006035504 0a0c0944656c6c20496e632e311f301d06035504030c1644656c6c20496e 632e20506c6174666f726d204b6579301e170d3136303630313230323030 375a170d3331303630313230333030365a3067310b300906035504061302 5553310e300c06035504080c0554657861733113301106035504070c0a52 6f756e6420526f636b31123010060355040a0c0944656c6c20496e632e31 1f301d06035504030c1644656c6c20496e632e20506c6174666f726d204b *** Remaining output omitted ***

    Working with just the hex values we can now delete all bytes before 0x3082039:

    3082039d30820285a003020102021050 a1bd858ae7b6bc402dca78cdd268a1300d06092a864886f70d01010b0500 3067310b3009060355040613025553310e300c06035504080c0554657861 733113301106035504070c0a526f756e6420526f636b3112301006035504 0a0c0944656c6c20496e632e311f301d06035504030c1644656c6c20496e 632e20506c6174666f726d204b6579301e170d3136303630313230323030 375a170d3331303630313230333030365a3067310b300906035504061302 5553310e300c06035504080c0554657861733113301106035504070c0a52 *** Remaining output omitted ***

  29. Enter:   :x!   to save changes and exit vim

  30. Enter:   xxd -r -ps PK.hex PK.cer   to reverse our hex dump back into a binary file
  31. We now should be able to view the PK certificate information with openssl:

  32. Enter:   openssl x509 -in PK.cer -inform der -noout -text   to view the certificate
  33. Certificate: Data: Version: 3 (0x2) Serial Number: 50:a1:bd:85:8a:e7:b6:bc:40:2d:ca:78:cd:d2:68:a1 Signature Algorithm: sha256WithRSAEncryption Issuer: C = US, ST = Texas, L = Round Rock, O = Dell Inc., CN = Dell Inc. Platform Key Validity Not Before: Jun 1 20:20:07 2016 GMT Not After : Jun 1 20:30:06 2031 GMT Subject: C = US, ST = Texas, L = Round Rock, O = Dell Inc., CN = Dell Inc. Platform Key Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: 00:b1:20:3a:40:88:eb:67:58:23:12:44:0c:20:ed: *** OUTPUT TRUNCATED *** ab:ff:6f:82:a1:bb:64:f2:b0:5e:b7:a9:63:a4:71: 94:43 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Key Usage: critical Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment, Certificate Sign X509v3 Basic Constraints: critical CA:TRUE, pathlen:1 X509v3 Subject Key Identifier: 46:6F:90:1C:10:20:52:99:56:15:EF:39:FD:48:18:48:CF:75:E6:A4 Signature Algorithm: sha256WithRSAEncryption 52:f6:b6:79:e4:c9:72:b0:a1:49:69:25:ce:17:5c:6a:c6:32: *** OUTPUT TRUNCATED ***: 97:82:21:fc

    From the output we can see that:

    Serial Number: 50:a1:bd:85:8a:e7:b6:bc:40:2d:ca:78:cd:d2:68:a1 Issuer: C = US, ST = Texas, L = Round Rock, O = Dell Inc., CN = Dell Inc. Platform Key Subject: C = US, ST = Texas, L = Round Rock, O = Dell Inc., CN = Dell Inc. Platform Key

    The serial number uniquely identifying the PK is: 50:a1:bd:85:8a:e7:b6:bc:40:2d:ca:78:cd:d2:68:a1
    The common name for this key is: Dell Inc. Platform Key
    The certificate was issue by itself, since it is self signed.

  34. Next we will extract the Key Exchange Key certificates. Repeat the previous procedure to create a hex dump of the KEK.esl file and open it in vim:
  35. 00000000: a159 c0a5 e494 a74a 87b5 ab15 5c2b f072 .Y.....J....\+.r 00000010: f203 0000 0000 0000 d603 0000 ce4d 5670 .............MVp 00000020: fc9a e34e 85fc 9496 49d7 e45c 3082 03c2 ...N....I..\0... 00000030: 3082 02aa a003 0201 0202 1027 9bad 52bf 0..........'..R. 00000040: 5dab b24c 3677 42f4 ebac cd30 0d06 092a ]..L6wB....0...* 00000050: 8648 86f7 0d01 010b 0500 3067 310b 3009 .H........0g1.0. 00000060: 0603 5504 0613 0255 5331 0e30 0c06 0355 ..U....US1.0...U 00000070: 0408 0c05 5465 7861 7331 1330 1106 0355 ....Texas1.0...U *** Remaining output omitted ***

    Again we see that this file begins with the x509 signature list GUID: a159 c0a5 e494 a74a 87b5 ab15 5c2b f072 . The next 4 bytes are the UINT32 SignatureListSize, which is f203 0000, Little Endian, which is 0000 03f2 Big Endian. If we scroll down to byte 03f2 we see that this is definitely not the end of the file, so there is likely multiple KEK certs stored in it:

    *** Remaining output omitted *** 000003b0: e8e8 ed41 45ac 5eaf d2eb b57a 6f74 cedf ...AE.^....zot.. 000003c0: f64e b062 0994 9dcc 09dd f568 a318 c432 .N.b.......h...2 000003d0: 9f13 4065 cf67 6d98 f3d5 c311 afb4 8a4b ..@e.gm........K 000003e0: 9549 0642 0e86 5748 7beb aaae 2c07 5496 .I.B..WH{...,.T. 000003f0: 6b36 a159 c0a5 e494 a74a 87b5 ab15 5c2b k6.Y.....J....\+ 00000400: f072 1806 0000 0000 0000 fc05 0000 bd9a .r.............. 00000410: fa77 5903 324d bd60 28f4 e78f 784b 3082 .wY.2M.`(...xK0. 00000420: 05e8 3082 03d0 a003 0201 0202 0a61 0ad1 ..0..........a.. 00000430: 8800 0000 0000 0330 0d06 092a 8648 86f7 .......0...*.H.. *** Remaining output omitted ***

    Note that on byte 0x03f3, another x509 GUID starts with: a159 c0a5. We need to separate the certificate entries into separate files. Exit vim and dump the file in to postscript format so it can be edited. Open the ps formatted file in vim:

    a159c0a5e494a74a87b5ab155c2bf072f203000000000000d6030000ce4d 5670fc9ae34e85fc949649d7e45c308203c2308202aaa003020102021027 9bad52bf5dabb24c367742f4ebaccd300d06092a864886f70d01010b0500 3067310b3009060355040613025553310e300c06035504080c0554657861 733113301106035504070c0a526f756e6420526f636b3112301006035504 0a0c0944656c6c20496e632e311f301d06035504030c1644656c6c20496e 632e20506c6174666f726d204b6579301e170d3136303630313230323234 *** Remaining output omitted ***

  36. Enter:   /a159c0a5   to find the start of the second x509 GUID.
    Type:   v   to switch to visual selection mode.
    Type:   G$   to select to the end of the file.
    Type:   y   to copy (yank) the text.
    Enter:   :e KEK-1.hex   to create a new file with the filename KEK-1.hex.
    Type:   p   to paste the copied lines.
  37. We know from the the PK.esl file that the first 44 bytes are header and owner information which are not included in the certificate file, so we need to delete the first 88 characters from the file:

    308205e8308203d0a003020102020a610ad18800000000000330 0d06092a864886f70d01010b0500308191310b3009060355040613025553 311330110603550408130a57617368696e67746f6e3110300e0603550407 13075265646d6f6e64311e301c060355040a13154d6963726f736f667420 436f72706f726174696f6e313b3039060355040313324d6963726f736f66 *** Remaining output omitted ***

  38. Enter:   :x!   to write changes and quit
  39. Convert our hex dump back to binary:

  40. Enter:   xxd -r -ps KEK-1.hex KEK-1.cer  

  41. Enter:   openssl x509 -in KEK-1.cer -inform der -noout -text   to view the certificate information:
  42. Certificate: Data: Version: 3 (0x2) Serial Number: 61:0a:d1:88:00:00:00:00:00:03 Signature Algorithm: sha256WithRSAEncryption Issuer: C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = Microsoft Corporation Third Party Marketplace Root Validity Not Before: Jun 24 20:41:29 2011 GMT Not After : Jun 24 20:51:29 2026 GMT Subject: C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = Microsoft Corporation KEK CA 2011 Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: 00:c4:e8:b5:8a:bf:ad:57:26:b0:26:c3:ea:e7:fb: *** OUTPUT TRUNCATED *** af:79:40:84:79:87:7f:e3:52:a8:e8:9d:7b:07:69: 8f:15 Exponent: 65537 (0x10001) X509v3 extensions: 1.3.6.1.4.1.311.21.1: ... X509v3 Subject Key Identifier: 62:FC:43:CD:A0:3E:A4:CB:67:12:D2:5B:D9:55:AC:7B:CC:B6:8A:5F 1.3.6.1.4.1.311.20.2: . .S.u.b.C.A X509v3 Key Usage: Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE X509v3 Authority Key Identifier: keyid:45:66:52:43:E1:7E:58:11:BF:D6:4E:9E:23:55:08:3B:3A:22:6A:A8 X509v3 CRL Distribution Points: Full Name: URI:http://crl.microsoft.com/pki/crl/products/MicCorThiParMarRoo_2010-10-05.crl Authority Information Access: CA Issuers - URI:http://www.microsoft.com/pki/certs/MicCorThiParMarRoo_2010-10-05.crt Signature Algorithm: sha256WithRSAEncryption d4:84:88:f5:14:94:18:02:ca:2a:3c:fb:2a:92:1c:0c:d7:a0: *** OUTPUT TRUNCATED *** 57:4e:36:d2:32:84:bf:9e

    Repeat this process for any remaining KEK certificates. After extracting the KEK certificates, extract the certificates from the db ESL.

Module Review

Discussion Points:

  • As Cyber experts, why should we care about the boot process?
  • Given that BIOS/UEFI firmware is one of the first things a PC loads, what opportunity does that present?
  • How does having a full network stack inside a UEFI firmware affect system vulnerability?
  • How might the widespread implementation of TPM affect the ability to gain remote access to systems using weak passwords and database dumps?

Processes, Services, and File Structure

Under construction

Registry and Configuration

Under construction

Drivers and Libraries

Under construction

Windows in an Enterprise Environment

Under construction

Linux Undo Script

This script prevents accidental lockout while configuring iptables remotely. It can be adapted for other commands as well:


          sudo iptables -P INPUT DROP; read -t 30 ; if [ "$REPLY" != "Y" ]; then sudo iptables -P INPUT ACCEPT; fi
        
REGEX examples