pentest-distro-builder/convert.sh

59 lines
2.2 KiB
Bash
Raw Normal View History

#!/bin/bash
#This script will automate adding all of our additions and changes on top of a vanilla intallation of Kali Linux.
#It has not been tested with Parrot.
function pause(){
read -p "$*"
}
#Root check!
if [ "$EUID" -ne 0 ]
then
whiptail --backtitle "Pentest Conversion Script" --title "Welcome" --msgbox "You are not signed in as root. This script will prompt for sudo as needed." 7 79
fi
whiptail --backtitle "Pentest Conversion Script" --title "Welcome" --msgbox "This script will add our changes on top of your Kali installation." 7 70
REPO=$(whiptail --backtitle "Pentest Conversion Script" --title "Repository" --menu "Which repository are you going to use?" 10 60 2 \
"default" "The distribution's default repository" \
"local" "A repository hosted on your local network" 3>&1 1>&2 2>&3)
if [ $REPO == "local" ];
then
REPO=$(whiptail --backtitle "Pentest Conversion Script" --title "Local Repository" --inputbox "What is the IP address of your local repository?" \
10 60 3>&1 1>&2 2>&3)
fi
if [ $REPO != "default" ];
then
sudo cp /etc/apt/sources.list /etc/apt/sources.list.original
2020-11-23 16:31:04 -07:00
sudo sed -i "s|http.kali.org|$REPO|g" /etc/apt/sources.list
fi
sudo apt update
sudo apt upgrade -y
xargs -a <(awk '! /^ *(#|$)/' "./config/software.list.chroot") -r -- sudo apt install -y
2020-11-23 16:39:57 -07:00
wget -O ../build/discord.deb "https://discordapp.com/api/download?platform=linux&format=deb"
wget -O ../build/slack.deb "https://downloads.slack-edge.com/linux_releases/slack-desktop-4.11.1-amd64.deb"
rm ./build/.gitignore
sudo dpkg -i ./build/
sudo rsync -HAXav ./filesystem/ /
if [ "$EUID" -ne 0 ]
then
2020-11-23 16:36:47 -07:00
rsync -av /etc/skel/ $HOME
fi
sudo bash ./config/pentest-distro-builder.chroot
if (whiptail --backtitle "Pentest Conversion Script" --title "Complete" --yesno "The script is now complete. A reboot is recommended.\nWould you like to reboot now?" 10 60)
then
whiptail --backtitle "Pentest Conversion Script" --title "Rebooting!" --msgbox "Thank you for using this script. Enjoy your new Kali!" 8 60
sudo reboot
else
whiptail --backtitle "Pentest Conversion Script" --title "Finished!" --msgbox "Thank you for using this script. Enjoy your new Kali!" 8 30
exit 1
fi