mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-11-14 06:12:04 -07:00
70 lines
3 KiB
Bash
Executable file
70 lines
3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
function pause(){
|
|
read -p "$*"
|
|
}
|
|
|
|
#Root check!
|
|
if [ "$EUID" -ne 0 ]
|
|
then
|
|
whiptail --backtitle "Pentest Build Script" --title "NOT ROOT" --msgbox "YOU ARE NOT ROOT. PLEASE RUN THIS SCRIPT AS ROOT." 10 55
|
|
exit 1
|
|
fi
|
|
|
|
whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70
|
|
|
|
DISTRO=$(whiptail --backtitle "Pentest Build Script" --title "Distribution" --menu "Choose a distribution:" 10 40 2 \
|
|
"KALI" "Kali Linux" \
|
|
"PARROT" "Parrot Security OS" 3>&1 1>&2 2>&3)
|
|
|
|
DESKTOP=$(whiptail --backtitle "Pentest Build Script" --title "Desktop Environment" --menu "Choose a desktop environment:" 10 40 4 \
|
|
"gnome" "GNOME" \
|
|
"mate" "MATE Desktop Environment" \
|
|
"cinnamon" "Cinnamon Desktop Environment" \
|
|
"kde" "K Desktop Environment" 3>&1 1>&2 2>&3)
|
|
|
|
if (whiptail --backtitle "Pentest Build Script" --title "Confirmation" --yesno "We're going to build:
|
|
Distribution: $DISTRO
|
|
Desktop Environment: $DESKTOP
|
|
Shall we proceed?" 10 50)
|
|
then
|
|
whiptail --backtitle "Pentest Build Script" --title "Build Time!" --msgbox "This will take a while. Press OK to proceed." 8 30
|
|
else
|
|
whiptail --backtitle "Pentest Build Script" --title "OK" --msgbox "This script will now terminate." 8 35
|
|
exit 1
|
|
fi
|
|
|
|
#This is the stuff that's common to both distros
|
|
dpkg-name ./debs/*.deb
|
|
rm -rf build
|
|
mkdir build
|
|
apt install git build-essential cdebootstrap live-build curl wget
|
|
|
|
case $DISTRO in
|
|
KALI)
|
|
cp -rv ./modules/live-build-config ./build/
|
|
mkdir ./build/live-build-config/kali-config/variant-$DESKTOP/packages.chroot
|
|
cp ./debs/*.deb build/live-build-config/kali-config/variant-$DESKTOP/packages.chroot/
|
|
cp -rv filesystem/* ./build/live-build-config/kali-config/common/includes.chroot/
|
|
cp config/02-unattended-boot.binary ./build/live-build-config/kali-config/common/includes.installer/
|
|
cp config/preseed.cfg ./build/live-build-config/kali-config/common/includes.installer/
|
|
cp config/software.list.chroot ./build/live-build-config/kali-config/variant-$DESKTOP/
|
|
cd build/live-build-config
|
|
pause "Check to make sure everything's good, then hit enter..."
|
|
./build.sh --distribution kali-rolling --variant $DESKTOP --verbose
|
|
whiptail --backtitle "Pentest Build Script" --title "Finished" --msgbox "Fingers crossed there were no errors... Your image should be done!" 7 70
|
|
exit 0
|
|
;;
|
|
PARROT)
|
|
cp -rv ./modules/parrot-build ./build/
|
|
mkdir ./build/parrot-build/templates/parrot-variant-$DESKTOP/packages.chroot
|
|
cp ./debs/*.deb build/parrot-build/templates/parrot-variant-$DESKTOP/packages.chroot/
|
|
cp -rv filesystem/* ./build/parrot-build/templates/common/includes.chroot/
|
|
cp config/software.list.chroot ./build/parrot-build/templates/parrot-variant-$DESKTOP/
|
|
cd build/parrot-build
|
|
pause "Check to make sure everything's good, then hit enter..."
|
|
./build.sh build variant-$DESKTOP amd64
|
|
whiptail --backtitle "Pentest Build Script" --title "Finished" --msgbox "Fingers crossed there were no errors... Your image should be done!" 7 70
|
|
exit 0
|
|
;;
|
|
esac
|