From c7272766674bde475a478ff0f067a0fba50f5781 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Sat, 29 Sep 2018 02:05:44 -0600 Subject: [PATCH 1/8] Add dates to iso filenames. Former-commit-id: b8f0c9f17837d73878dd8112a3fb7f27123f6d7e Former-commit-id: ca1c34e6b14348c3a16f401a9fb09ac3f131a136 --- runme.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runme.sh b/runme.sh index 2d4e2d1d..c1b95ab7 100755 --- a/runme.sh +++ b/runme.sh @@ -68,7 +68,7 @@ Kali) cd build/live-build-config ./build.sh --distribution kali-rolling --variant $DESKTOP --verbose - cp images/*.iso ../../images/ + cp images/*.iso ../../images/kali-rolling-$DESKTOP-$(date -I).iso ;; Parrot) cp -rv ./modules/parrot-build ./build/ @@ -85,7 +85,7 @@ Parrot) cd build/parrot-build ./build.sh build variant-$DESKTOP amd64 - cp ../*.iso ../../images/ + cp ../*.iso ../../images/parrotsec-$DESKTOP-$(date -I).iso ;; esac From 6b31cbf0ccd7508a1f37a1c8cc499362cf08e04f Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Sat, 29 Sep 2018 02:35:13 -0600 Subject: [PATCH 2/8] Add CLI options for use with unattended builds. Former-commit-id: 57b9323b2ed1b3396695092e160e21e7dc022b79 Former-commit-id: ac82de30f8840b34434ec54534e588700e33c21e --- runme.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/runme.sh b/runme.sh index c1b95ab7..fe96719b 100755 --- a/runme.sh +++ b/runme.sh @@ -11,6 +11,19 @@ then exit 1 fi +#Argument check! + +while getopts ud:r: option +do + case "${option}" in + u) UNATTEND=true;; + d) DESKTOP=${OPTARG};; + r) REPO=${OPTARG};; + esac +done + +if [ $UNATTEND != "true" ]; +then whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70 DISTRO=$(lsb_release -i -s) @@ -44,6 +57,7 @@ else whiptail --backtitle "Pentest Build Script" --title "OK" --msgbox "This script will now terminate." 8 35 exit 1 fi +fi #This is the stuff that's common to both distros dpkg-name ./debs/*.deb @@ -89,6 +103,9 @@ Parrot) ;; esac +if [ $UNATTEND != "true" ]; +then whiptail --backtitle "Pentest Build Script" --title "Finished" --msgbox "Fingers crossed there were no errors... Your image should be done!" 7 70 +fi exit 0 From 9ede0f6f135c2d439fff7f9606008caae4fcdcd6 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Sat, 29 Sep 2018 16:42:16 -0600 Subject: [PATCH 3/8] CLI options functional. Former-commit-id: d855f8a75263803a29d9e2fedb9a3d09c3c34e3b Former-commit-id: 5651fe34d260b125ca58f2683648ea62a9a9e453 --- runme.sh | 71 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/runme.sh b/runme.sh index fe96719b..c0845eec 100755 --- a/runme.sh +++ b/runme.sh @@ -11,52 +11,53 @@ then exit 1 fi -#Argument check! +#Arguments + while getopts ud:r: option do case "${option}" in - u) UNATTEND=true;; - d) DESKTOP=${OPTARG};; - r) REPO=${OPTARG};; + u) UNATTEND="true" && echo "UNATTEND";; + d) DESKTOP=${OPTARG} && echo $DESKTOP;; + r) REPO=${OPTARG} && echo $REPO;; esac done -if [ $UNATTEND != "true" ]; -then -whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70 - DISTRO=$(lsb_release -i -s) -DESKTOP=$(whiptail --backtitle "Pentest Build Script" --title "Desktop Environment" --menu "Choose a desktop:" 15 50 6 \ -"gnome" "GNOME Desktop Environment" \ -"mate" "MATE Advanced Traditional Environment" \ -"cinnamon" "Cinnamon Desktop Environment" \ -"kde" "K Desktop Environment" \ -"xfce" "Xfce Desktop Environment" \ -"lxde" "Lightweight X11 Desktop Environment" 3>&1 1>&2 2>&3) - -REPO=$(whiptail --backtitle "Pentest Build 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" ]; +if [ $UNATTEND != "true" ]; then - REPO=$(whiptail --backtitle "Pentest Build Script" --title "Local Repository" --inputbox "What is the IP address of your local repository?" \ - 10 60 3>&1 1>&2 2>&3) -fi + whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70 -if (whiptail --backtitle "Pentest Build Script" --title "Confirmation" --yesno "We're going to build: -Distribution: $DISTRO -Desktop Environment: $DESKTOP -Repository: $REPO -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 + DESKTOP=$(whiptail --backtitle "Pentest Build Script" --title "Desktop Environment" --menu "Choose a desktop:" 15 50 6 \ + "gnome" "GNOME Desktop Environment" \ + "mate" "MATE Advanced Traditional Environment" \ + "cinnamon" "Cinnamon Desktop Environment" \ + "kde" "K Desktop Environment" \ + "xfce" "Xfce Desktop Environment" \ + "lxde" "Lightweight X11 Desktop Environment" 3>&1 1>&2 2>&3) + + REPO=$(whiptail --backtitle "Pentest Build 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 Build Script" --title "Local Repository" --inputbox "What is the IP address of your local repository?" \ + 10 60 3>&1 1>&2 2>&3) + fi + + if (whiptail --backtitle "Pentest Build Script" --title "Confirmation" --yesno "We're going to build: + Distribution: $DISTRO + Desktop Environment: $DESKTOP + Repository: $REPO + 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 fi #This is the stuff that's common to both distros From e387ad06d7448c33dffa6a008b809bf8db5c6c81 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Mon, 1 Oct 2018 22:42:40 -0600 Subject: [PATCH 4/8] Fix unary operators. Former-commit-id: ecb86089a6a84dfd5c1a3fbe4547b61613656fa9 Former-commit-id: 3e3fb956b1d16717d9344131fe312bb9297ec5a4 --- runme.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runme.sh b/runme.sh index c0845eec..88c9e7a3 100755 --- a/runme.sh +++ b/runme.sh @@ -13,19 +13,20 @@ fi #Arguments +DISTRO=$(lsb_release -i -s) -while getopts ud:r: option +while getopts ul:d:r: option do case "${option}" in u) UNATTEND="true" && echo "UNATTEND";; + l) DISTRO=${OPTARG} && echo $DISTRO;; d) DESKTOP=${OPTARG} && echo $DESKTOP;; r) REPO=${OPTARG} && echo $REPO;; esac done -DISTRO=$(lsb_release -i -s) -if [ $UNATTEND != "true" ]; +if [[ $UNATTEND != "true" ]]; then whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70 @@ -104,7 +105,7 @@ Parrot) ;; esac -if [ $UNATTEND != "true" ]; +if [[ $UNATTEND != "true" ]]; then whiptail --backtitle "Pentest Build Script" --title "Finished" --msgbox "Fingers crossed there were no errors... Your image should be done!" 7 70 fi From 6d5fd1b95128b913b3f22130bfd87379aa3378d2 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Mon, 1 Oct 2018 22:46:22 -0600 Subject: [PATCH 5/8] Fix for use with Debian. Former-commit-id: 77394d8d4ad5261d2726d659702d9c5c063e79dc Former-commit-id: 43fdefb6e0c9cdcbbdc5532fd95c455b470f9330 --- modules/live-build-config/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/live-build-config/build.sh b/modules/live-build-config/build.sh index 16f29826..f939e343 100755 --- a/modules/live-build-config/build.sh +++ b/modules/live-build-config/build.sh @@ -144,7 +144,7 @@ ver_debootstrap=$(dpkg-query -f '${Version}' -W debootstrap) if dpkg --compare-versions "$ver_debootstrap" lt "1.0.97"; then if ! echo "$ver_debootstrap" | grep -q kali; then echo "ERROR: You need debootstrap >= 1.0.97 (or a Kali patched debootstrap). Your current version: $ver_debootstrap" >&2 - exit 1 + #exit 1 fi fi From b287cc3a1e9138f615eb3dbbc22566ba65d5f91a Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Wed, 3 Oct 2018 00:56:39 -0600 Subject: [PATCH 6/8] Update README.md Former-commit-id: 6834fc0d7e724c40361fdbee6650a089a1c4fcd5 Former-commit-id: ca4e8424560ad07043e9374264ef0aa9f95e2a7d --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e1a6d70f..918f1da5 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,22 @@ Just clone the repository, then make whatever changes you wish to make. * Files in the filesystem/ folder will be copied to the system. * Add any extra software from the repository you wish to install to the config/software.list.chroot file. -When you're ready to build, run `sudo ./runme.sh` . +When you're ready to build, run `sudo ./runme.sh` . Once it's complete, the finished image will be copied to the images/ folder. -The script will build whichever OS you are currently running, and prompt for which desktop environment and repository you wish to use. +If you run the script without any options, it will build whichever OS you are currently running, and prompt for which desktop environment and repository you wish to use. If you wish, however, you can manually specify these options instead: -Once it's complete, the finished image will be copied to the images/ folder. +* -u + * Unattended mode (skip the menu, required for the other options to function) +* -l + * Linux distribution you wish to build (can be either "Kali" or "Parrot") +* -d + * Desktop environment (can be one of "cinnamon", "gnome", "kde", "lxde", "mate", or "xfce") +* -r (optional) + * Repository (can be either "default" for the distribution's default repo, or an IP address) + +## Examples +`sudo ./runme.sh -u -l Kali -d mate -r 192.168.0.30` +This will build a Kali Linux .iso, with the MATE desktop environment, using a local repository at 192.168.0.30 + +`sudo ./runme.sh -u -l Parrot -d cinnamon` +This will build a Parrot Security OS .iso, with the Cinnamon desktop environment, using the default Parrot repository. If -r is unspecified, then the default will be used. From 9874b9949d7489c995b6275a7e510cbf5abeacf2 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Wed, 3 Oct 2018 00:56:52 -0600 Subject: [PATCH 7/8] Update README.md Former-commit-id: ae6d5e4fca139e58a5f0a2f658dd4e6f51c9b033 Former-commit-id: 834ed518f1781496cb9e9444bfa525ab1dac544b --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 918f1da5..be332baf 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,9 @@ If you run the script without any options, it will build whichever OS you are cu ## Examples `sudo ./runme.sh -u -l Kali -d mate -r 192.168.0.30` + This will build a Kali Linux .iso, with the MATE desktop environment, using a local repository at 192.168.0.30 `sudo ./runme.sh -u -l Parrot -d cinnamon` + This will build a Parrot Security OS .iso, with the Cinnamon desktop environment, using the default Parrot repository. If -r is unspecified, then the default will be used. From 396c99695bc8e92692557eb11cff9331f5dba48e Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Wed, 3 Oct 2018 00:57:40 -0600 Subject: [PATCH 8/8] Update README.md Former-commit-id: 253548413fc7069af16835fbb6983b957aaf9270 Former-commit-id: 5873be24f7ce84818116246085982cbe5ea94b40 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index be332baf..f9d4c7ef 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,6 @@ This will build a Kali Linux .iso, with the MATE desktop environment, using a lo `sudo ./runme.sh -u -l Parrot -d cinnamon` -This will build a Parrot Security OS .iso, with the Cinnamon desktop environment, using the default Parrot repository. If -r is unspecified, then the default will be used. +This will build a Parrot Security OS .iso, with the Cinnamon desktop environment, using the default Parrot repository. + +If -r is unspecified, then the default will be used.