From 7b5545c64e4a803a0abe7767712170bb59fe0cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 23 Feb 2025 20:10:47 +0100 Subject: [PATCH] Rename Linux related artifact download scripts --- pxe/{download-docker.sh => download-linux.sh} | 2 +- pxe/download.sh | 8 ++++++-- pxe/start-pxe-linux.sh | 16 ++++++++++++++++ pxe/start-pxe.sh | 17 +---------------- 4 files changed, 24 insertions(+), 19 deletions(-) rename pxe/{download-docker.sh => download-linux.sh} (95%) create mode 100755 pxe/start-pxe-linux.sh mode change 100755 => 120000 pxe/start-pxe.sh diff --git a/pxe/download-docker.sh b/pxe/download-linux.sh similarity index 95% rename from pxe/download-docker.sh rename to pxe/download-linux.sh index fc73541..391a8a2 100755 --- a/pxe/download-docker.sh +++ b/pxe/download-linux.sh @@ -25,4 +25,4 @@ wget "https://snapshot.debian.org/archive/debian/20240716T023930Z/pool/main/g/gr dpkg-deb -x grub.deb grub cp grub/usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed /mnt/tftp/grubx64.efi -# TODO: Fetching vulnerable Windows boot loader +# TODO: Fetching vulnerable Windows boot manager diff --git a/pxe/download.sh b/pxe/download.sh index ee7962e..f433e9e 100755 --- a/pxe/download.sh +++ b/pxe/download.sh @@ -1,4 +1,8 @@ #!/bin/sh -docker run --platform linux/amd64 --rm -v "$PWD":/mnt -w /root \ - alpine:3.20.3 "/mnt/download-docker.sh" +if [ -f tftp/grubx64.efi ] && [ -f tftp/shimx64.efi ]; then + echo "Skipping Linux related artifacts download" +else + docker run --platform linux/amd64 --rm -v "$PWD":/mnt -w /root \ + alpine:3.20.3 "/mnt/download-linux.sh" +fi diff --git a/pxe/start-pxe-linux.sh b/pxe/start-pxe-linux.sh new file mode 100755 index 0000000..8417c6c --- /dev/null +++ b/pxe/start-pxe-linux.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +[ $# -eq 0 ] && echo "usage: $0 " && exit 1 + +scriptpath="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +interface=$1 + +sudo ip a add 10.13.37.100/24 dev $interface + +sudo dnsmasq --no-daemon \ + --interface=$interface \ + --dhcp-range=10.13.37.100,10.13.37.200,255.255.255.0,1h \ + --dhcp-boot=bootmgfw.efi \ + --enable-tftp \ + --tftp-root="$scriptpath/tftp" \ + --log-dhcp diff --git a/pxe/start-pxe.sh b/pxe/start-pxe.sh deleted file mode 100755 index 8417c6c..0000000 --- a/pxe/start-pxe.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -[ $# -eq 0 ] && echo "usage: $0 " && exit 1 - -scriptpath="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -interface=$1 - -sudo ip a add 10.13.37.100/24 dev $interface - -sudo dnsmasq --no-daemon \ - --interface=$interface \ - --dhcp-range=10.13.37.100,10.13.37.200,255.255.255.0,1h \ - --dhcp-boot=bootmgfw.efi \ - --enable-tftp \ - --tftp-root="$scriptpath/tftp" \ - --log-dhcp diff --git a/pxe/start-pxe.sh b/pxe/start-pxe.sh new file mode 120000 index 0000000..bfb814a --- /dev/null +++ b/pxe/start-pxe.sh @@ -0,0 +1 @@ +start-pxe-linux.sh \ No newline at end of file