diff --git a/config/pentest-distro-builder.chroot b/config/pentest-distro-builder.chroot index d409b7ff..c1c9db56 100644 --- a/config/pentest-distro-builder.chroot +++ b/config/pentest-distro-builder.chroot @@ -9,7 +9,7 @@ git clone https://github.com/Veil-Framework/Veil.git /opt/Veil git clone https://github.com/leebaird/discover.git /opt/discover git clone https://github.com/trustedsec/ptf /opt/ptf -ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa +#ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa #Enable/disable our desired services systemctl enable ssh @@ -53,7 +53,8 @@ sudo apt update && sudo apt install codium -y xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search #Distro-specific stuff -DISTRO=$(cat /etc/lsb-release | grep DISTRIB_ID | cut -c 12-30) +#DISTRO=$(cat /etc/lsb-release | grep DISTRIB_ID | cut -c 12-30) +DISTRO=$(lsb_release -is) case $DISTRO in Parrot) diff --git a/convert.sh b/convert.sh new file mode 100755 index 00000000..4923bd69 --- /dev/null +++ b/convert.sh @@ -0,0 +1,57 @@ +#!/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 + sudo sed -i "s|archive.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 +bash ./debs/get-debs.sh +rm ./build/.gitignore +sudo dpkg -i ./build/ + +sudo rsync -HAXav ./filesystem/ / +if [ "$EUID" -ne 0 ] +then + cp -rv /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