From 927a6a85cd9a5d70c9a4370f594804138f918a89 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Thu, 18 Oct 2018 18:01:16 -0600 Subject: [PATCH] Move hook to config folder. Former-commit-id: 891a966bdce8ebca4b64558322ed258416abb440 Former-commit-id: b1f759ff281a060a67d5b130590254996bd0e677 --- README.md | 7 ++++--- .../pentest-distro-builder.chroot | 7 ++++--- config/software.list.chroot | 4 +++- modules/parrot-build/auto/config | 5 ++++- .../normal/pentest-distro-builder.chroot | 20 ------------------- runme.sh | 4 +++- 6 files changed, 18 insertions(+), 29 deletions(-) rename {modules/live-build-config/kali-config/common/hooks/live => config}/pentest-distro-builder.chroot (88%) delete mode 100644 modules/parrot-build/templates/common/hooks/normal/pentest-distro-builder.chroot diff --git a/README.md b/README.md index f9d4c7ef..475c11f4 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,14 @@ This script automates the process of building the most common pentesting Linux d ## Running Just clone the repository, then make whatever changes you wish to make. -* .deb files in the debs/ folder will be installed into the image. -* Files in the filesystem/ folder will be copied to the system. +* Add any .deb files to the debs/ folder that you want installed into the image. +* Add any files to the filesystem/ folder that you want on the final system. * Add any extra software from the repository you wish to install to the config/software.list.chroot file. +* Add any commands you want to have run during the build process to the config/pentest-distro-builder.chroot file. When you're ready to build, run `sudo ./runme.sh` . Once it's complete, the finished image will be copied to the images/ folder. -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: +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 (for example, to script an image to be built nightly or weekly): * -u * Unattended mode (skip the menu, required for the other options to function) diff --git a/modules/live-build-config/kali-config/common/hooks/live/pentest-distro-builder.chroot b/config/pentest-distro-builder.chroot similarity index 88% rename from modules/live-build-config/kali-config/common/hooks/live/pentest-distro-builder.chroot rename to config/pentest-distro-builder.chroot index a323d1b9..c94560a9 100644 --- a/modules/live-build-config/kali-config/common/hooks/live/pentest-distro-builder.chroot +++ b/config/pentest-distro-builder.chroot @@ -1,7 +1,7 @@ #!/bin/sh #Populate root's home folder from /etc/skel -cp -ru /etc/skel/* /root/ +cp -r /etc/skel/* /root/ #Time to git stuff... cd /root/ @@ -9,12 +9,13 @@ git clone https://github.com/Veil-Framework/Veil.git git clone https://github.com/leebaird/discover.git git clone https://github.com/trustedsec/ptf -#Enable our desired services ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa + +#Enable our desired services systemctl enable ssh systemctl enable cups systemctl enable apache2 systemctl enable mysql systemctl enable postgresql systemctl enable tor -systemctl enable cockpit.socket +systemctl enable cockpit.socket \ No newline at end of file diff --git a/config/software.list.chroot b/config/software.list.chroot index e73e9077..d4d384ea 100644 --- a/config/software.list.chroot +++ b/config/software.list.chroot @@ -28,4 +28,6 @@ cherrytree libreoffice gimp audacity -vlc \ No newline at end of file +vlc +gedit +gedit-plugins diff --git a/modules/parrot-build/auto/config b/modules/parrot-build/auto/config index 3e651cea..c4efcdb8 100755 --- a/modules/parrot-build/auto/config +++ b/modules/parrot-build/auto/config @@ -5,6 +5,9 @@ set -o pipefail # Bashism parrot_mirror=http://archive.parrotsec.org/parrot +public_mirror=http://deb.parrotsec.org/parrot + + # Detect target architecture and filter args if [ ! $arch ]; then arch=$(dpkg --print-architecture) @@ -107,7 +110,7 @@ lb config noauto \ --mirror-bootstrap "$parrot_mirror" \ --mirror-chroot "$parrot_mirror" \ --mirror-debian-installer "$parrot_mirror" \ - --mirror-binary "$parrot_mirror" \ + --mirror-binary "$public_mirror" \ --iso-application "Parrot" \ --iso-publisher "Parrot Project" \ --iso-volume "ParrotSec" \ diff --git a/modules/parrot-build/templates/common/hooks/normal/pentest-distro-builder.chroot b/modules/parrot-build/templates/common/hooks/normal/pentest-distro-builder.chroot deleted file mode 100644 index a323d1b9..00000000 --- a/modules/parrot-build/templates/common/hooks/normal/pentest-distro-builder.chroot +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -#Populate root's home folder from /etc/skel -cp -ru /etc/skel/* /root/ - -#Time to git stuff... -cd /root/ -git clone https://github.com/Veil-Framework/Veil.git -git clone https://github.com/leebaird/discover.git -git clone https://github.com/trustedsec/ptf - -#Enable our desired services -ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa -systemctl enable ssh -systemctl enable cups -systemctl enable apache2 -systemctl enable mysql -systemctl enable postgresql -systemctl enable tor -systemctl enable cockpit.socket diff --git a/runme.sh b/runme.sh index d4913046..b6e4f025 100755 --- a/runme.sh +++ b/runme.sh @@ -74,6 +74,7 @@ Kali) 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/software.list.chroot ./build/live-build-config/kali-config/variant-$DESKTOP/package-lists/ + cp config/pentest-distro-builder.chroot ./build/live-build-config/kali-config/common/hooks/live/ if [ $REPO != "default" ]; then @@ -90,11 +91,12 @@ Parrot) 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/package-lists/ + cp config/pentest-distro-builder.chroot ./build/parrot-build/templates/common/hooks/normal/ if [ $REPO != "default" ]; then sed -i "s|archive.parrotsec.org|$REPO|g" ./build/parrot-build/auto/config - sed -i "s|deb.parrotsec.org|$REPO|g" ./build/parrot-build/templates/common/archives/parrot.list + #sed -i "s|deb.parrotsec.org|$REPO|g" ./build/parrot-build/templates/common/archives/parrot.list fi cd build/parrot-build