-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 2.29 KB
/
Makefile
File metadata and controls
68 lines (54 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Folders
PXE ?= ./pxe
TFTP = ${PXE}/tftp
SMB = ${PXE}/smb
# Artifacts Linux
INITRAMFS = ${TFTP}/alpine-initrd.xz
KERNEL = ${TFTP}/linux
SHIM = ${TFTP}/shimx64.efi
GRUB = ${TFTP}/grubx64.efi
# Artifacts WinPE
BOOT_SDI = ${TFTP}/Boot/boot.sdi
BOOT_WIM = ${TFTP}/Boot/boot.wim
DUMPIT_EXE = ${SMB}/winpe/DumpIt.exe
WINPMEM_EXE = ${SMB}/winpe/winpmem.exe
SEARCH_VMK_EXE = ${SMB}/winpe/search-vmk.exe
DISLOCKER_METADATA_EXE = ${SMB}/winpe/dislocker-metadata.exe
all: linux winpe
linux: ${SHIM} ${GRUB} ${KERNEL} ${INITRAMFS}
@echo "Building Linux based bitpixie exploitation components..."
${INITRAMFS} ${KERNEL}:
@echo "Preparing initramfs and kernel..."
linux/initramfs/bitpixie build
linux/initramfs/bitpixie deploy
${SHIM} ${GRUB}:
@echo "Preparing shim and GRUB..."
docker run --platform linux/amd64 --rm -v "${CURDIR}/linux/bootloader:/build" -v "${PXE}":/mnt -w /root \
alpine:3.20.3 "/build/download.sh"
winpe: ${BOOT_SDI} ${BOOT_WIM} ${WINPMEM_EXE} ${SEARCH_VMK_EXE} ${DISLOCKER_METADATA_EXE}
@echo "Building WinPE based bitpixie exploitation components..."
${BOOT_SDI} ${BOOT_WIM}:
@echo "Preparing Windows boot.{sdi,wim} files..."
docker run --platform linux/amd64 --rm -v "${CURDIR}/winpe:/build" -v "${PXE}":/mnt -w /root \
alpine:3.20.3 "/build/download-winpe.sh"
${WINPMEM_EXE}:
@echo "Bulding $@..."
docker run --platform linux/amd64 --rm -v "${CURDIR}/winpe:/build" -v "${PXE}":/mnt -w /root \
alpine:3.20.3 "/build/build-winpmem.sh"
${DUMPIT_EXE}:
@echo "Please download Magnet DumpIt for Windows"
@echo "\n https://www.magnetforensics.com/resources/magnet-dumpit-for-windows/\n"
@echo "And place it into $@\n"
@exit 1
${SEARCH_VMK_EXE}:
@echo "Bulding $@..."
docker run --platform linux/amd64 --rm -v "${CURDIR}/search-vmk:/src" -v "${CURDIR}/winpe:/build" -v "${PXE}":/mnt -w /root \
alpine:3.20.3 "/build/build-search-vmk.sh"
${DISLOCKER_METADATA_EXE}:
@echo "Bulding $@..."
docker run --platform linux/amd64 --rm -v "${CURDIR}/winpe:/build" -v "${PXE}":/mnt -w /root \
alpine:3.20.3 "/build/build-dislocker-metadata.sh"
clean:
@rm -f "${SHIM}" "${GRUB}" "${KERNEL}" "${INITRAMFS}"
@rm -f "${BOOT_SDI}" "${BOOT_WIM}" "${WINPMEM_EXE}" "${SEARCH_VMK_EXE}" "${DISLOCKER_METADATA_EXE}"
.PHONY: all linux winpe clean