diff --git a/README.md b/README.md index e296427..1d5d281 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,23 @@ sudo ./pimpmykali.sh # Writeups / Honorable Mentions - ip3c4c_n00b https://ip3c4c.com/2202_homelab_vmware/ -# Revision 1.7.9.a5 - curl --w +# Revision 1.7.9a6 - docker-compose / docker.io + - Enabled menu option 7 for Fix DockerCompose + - fix_dockercompose is included in options 0 (fix_all), N (new setup) or 1 (fix_missing) + - New function added fix_dockercompose lines 253 to 330 + - check if docker-compose is installed if not install latest from github + - if docker-compose is installed will version check system vs github and install newer version + - case statement exit code handling + - Consolidated docker-compose and docker.io installations in updated functions + - hacking_api_prereq + - map_prereq + - pbb_lab_setup + - peh_weblab_setup + - now uses fix_dockercompose function to install docker-compose and docker.io + - revision notes 1.7.9 to 1.7.9a3 moved to changelog.txt + - Readme.md updated for Menu option 7 + +# Revision 1.7.9a5 - curl --w - Thanks Alek, updated curl from --w to -w - functions small_speedtest, large_speedetest @@ -55,29 +71,6 @@ sudo ./pimpmykali.sh - corrected url for Lin/WinPeas - updated function to always pull latest release -# Revision 1.7.9a3 - updated functions - - updated fix_sources function - - includes non-free and non-free-firmware - - updated gen_new_sources in Pimpmykali-Mirrors menu option = - - includes non-free and non-free-firmware - -# Revision 1.7.9a2 - updated exit_screen function - - function modified to re-source logged in user ~/nameofshellrc - -# Revision 1.7.9a1 - netexec - - updated installation to use pipx - - created new function to ensure symlinks are created - - created new function for user and root installations - - menu option U or u to install netexec - - is also included in menu option N, 0 or 1 - -# Revision 1.7.9a - netexec (nxc) - - menu option U or u to install netexec - - is also included in menu options N, 0 or 1 - -# Revision 1.7.9 - crackmapexec - - corrected pathing of symlinks created in $HOME/.local/bin - # Menu Breakdown of Pimpmykali - Menu option N (New Users/New VM's Should start here!) @@ -164,7 +157,13 @@ sudo ./pimpmykali.sh - Menu Option 7 - - removed from the menu + - fix_dockercompose + - installs docker.io from kali repo + - check if docker compose is installed or not + - if not installed, install latest from github + - if installed, check local version vs github version + - install newer version if found + - Menu option 7 is included in fix_all and fix_missing functions - Menu Option 8 - Fix Nmap @@ -256,4 +255,4 @@ sudo ./pimpmykali.sh # TODO - - clean up todo list :) + - clean up todo list :) \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index bf74fb0..3123d64 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,26 @@ +# Revision 1.7.9a3 - updated functions + - updated fix_sources function + - includes non-free and non-free-firmware + - updated gen_new_sources in Pimpmykali-Mirrors menu option = + - includes non-free and non-free-firmware + +# Revision 1.7.9a2 - updated exit_screen function + - function modified to re-source logged in user ~/nameofshellrc + +# Revision 1.7.9a1 - netexec + - updated installation to use pipx + - created new function to ensure symlinks are created + - created new function for user and root installations + - menu option U or u to install netexec + - is also included in menu option N, 0 or 1 + +# Revision 1.7.9a - netexec (nxc) + - menu option U or u to install netexec + - is also included in menu options N, 0 or 1 + +# Revision 1.7.9 - crackmapexec + - corrected pathing of symlinks created in $HOME/.local/bin + # Revision 1.7.8 - Pimpmykali-Mirrors - correction/update to current url for mirrorlist diff --git a/pimpmykali.sh b/pimpmykali.sh index d192b8d..b0884bd 100755 --- a/pimpmykali.sh +++ b/pimpmykali.sh @@ -9,7 +9,7 @@ # Standard Disclaimer: Author assumes no liability for any damage # revision var - revision="1.7.9a5" + revision="1.7.9a6" # unicorn puke: red=$'\e[1;31m' @@ -230,6 +230,7 @@ fix_missing() { fix_netexec fix_ssh_widecompat #fix_waybackurls # has issues not implemented yet + fix_dockercompose # 07.30.2024 - rev 1.7.9a6 } fix_all() { @@ -248,6 +249,86 @@ fix_all() { # called as sub-function call of fix_all or fix_upgrade itself } + +fix_dockercompose() { + # Menu option 7 Fix DockerCompose, also installs docker.io - Rev 1.7.9a6 07.30.2024 + # exit_status tests : + # exit_status 127 + # sudo rm /usr/local/bin/docker-compose + # sudo ./pimpmykali.sh menu option 7 + # + # exit_status 0 - version check different versions + # sudo curl -L "https://github.com/docker/compose/releases/download/v2.28.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose + # sudo ./pimpmykali.sh menu option 7 + # + # exit_status 0 - version check same versions + # sudo ./pimpmyakli.sh menu option 7 + # + # all other exit_status codes caught with * in case statement + # + DOCKERCOMPOSE_RELEASE_URL="https://github.com/docker/compose/releases/" + DOCKERCOMPOSE_RELEASE_HTML=$(curl -s "$DOCKERCOMPOSE_RELEASE_URL") + DOCKERCOMPOSE_LATEST_VERSION=$(echo "$DOCKERCOMPOSE_RELEASE_HTML" | grep -oP 'href="/docker/compose/releases/tag/v\K[0-9.]+(?=")' | head -n 1) + if [ -z "$DOCKERCOMPOSE_LATEST_VERSION" ]; then + echo -e "\n $redexclaim Error: Unable to find the latest Docker Compose version from Github" + exit 1 + fi + DOCKERCOMPOSE_DOWNLOAD_URL="https://github.com/docker/compose/releases/download/v$DOCKERCOMPOSE_LATEST_VERSION/docker-compose-$(uname -s)-$(uname -m)" + + if command -v docker-compose &> /dev/null; + then + SYSTEM_DOCKERCOMPOSE_VER=$(docker-compose --version | awk '{print $4}' | tr -d "v") + EXIT_STATUS="$?" + # exit status should result in 0 + else + EXIT_STATUS="127" + # set exit status to 127 as docker-compose is not installed + fi + + case $EXIT_STATUS in + 0) + # exit code 0, docker compose is installed, compare versions and upgrade if newer is available + echo -e "\n\n $greenplus Local $(whereis docker-compose) found. Comparing versions..." + if [[ "$DOCKERCOMPOSE_LATEST_VERSION" > "$SYSTEM_DOCKERCOMPOSE_VER" ]]; then + echo -e "\n $greenminus Installed Docker Compose Ver = $SYSTEM_DOCKERCOMPOSE_VER" + echo -e " $greenminus Github Latest Docker Compose = $DOCKERCOMPOSE_LATEST_VERSION" + echo -e "\n $greenplus Installing latest DockerCompose \n" + apt_update + eval apt -y install build-essential python3-dev docker.io python3-setuptools \ + python3-wheel python3-wheel-common cython3 python3-pip python3-pip-whl + echo -e "\n $greenplus Latest Docker Compose version: $DOCKERCOMPOSE_LATEST_VERSION" + echo -e "\n $greenplus Downloading Docker Compose: $DOCKERCOMPOSE_DOWNLOAD_URL to /usr/local/bin/docker-compose" + curl -L "$DOCKERCOMPOSE_DOWNLOAD_URL" -o /usr/local/bin/docker-compose + echo -e "\n $greenplus Making /usr/local/bin/docker-compose executable" + chmod +x /usr/local/bin/docker-compose + echo -e "\n $greenplus Docker Compose installed successfully $(docker-compose --version | awk {'print $4'})" + else + echo -e "\n $greenminus Installed Docker Compose Ver = $SYSTEM_DOCKERCOMPOSE_VER" + echo -e " $greenminus Github Latest Docker Compose = $DOCKERCOMPOSE_LATEST_VERSION" + echo -e "\n $greenplus Versions Match, exiting" + fi + ;; + 127) + # exit code 127 docker-compose is not found, install from + echo -e "\n\n $redexclaim Docker Compose command not found, installing..." + apt_update + apt_update_complete + eval apt -y install build-essential python3-dev docker.io python3-setuptools \ + python3-wheel python3-wheel-common cython3 python3-pip python3-pip-whl + echo -e "\n $greenplus Latest Docker Compose version: $DOCKERCOMPOSE_LATEST_VERSION" + echo -e "\n $greenplus Downloading Docker Compose: $DOCKERCOMPOSE_DOWNLOAD_URL to /usr/local/bin/docker-compose\n" + curl -L "$DOCKERCOMPOSE_DOWNLOAD_URL" -o /usr/local/bin/docker-compose + echo -e "\n $greenplus Making /usr/local/bin/docker-compose executable" + chmod +x /usr/local/bin/docker-compose + echo -e "\n $greenplus Docker Compose installed successfully $(docker-compose --version | awk {'print $4'})" + ;; + *) + # catch all other exit codes + echo -e "\n $redexclaim Unknown error code $EXIT_STATUS" + ;; + esac + } + fix_kali_lightdm_theme_and_background () { # set kali lightdm login theme from Kali-Light to Kali-Dark sed s:"Kali-Light":"Kali-Dark":g -i /etc/lightdm/lightdm-gtk-greeter.conf @@ -1559,7 +1640,8 @@ hacking_api_prereq() { echo -e "\n $greenplus Running apt update" eval apt update $silent echo -e "\n $greenplus Installing docker.io docker-compose" - eval apt -y install docker.io docker-compose $silent + # eval apt -y install docker.io docker-compose $silent + fix_dockercompose echo -e "\n $greenplus Enabling docker services (systemctl enable docker)" systemctl enable docker # determine arch type and download the respective postman for that arch @@ -1722,7 +1804,8 @@ mapt_prereq() { echo -e " $greenplus python$pyver-venv aapt apktool adb apksigner zipalign wkhtmltopdf default-jdk jadx" apt -y install python$pyver-venv aapt apktool adb apksigner zipalign wkhtmltopdf default-jdk jadx echo -e "\n $greenplus git cloning mobsf to /opt" - eval apt -y install docker.io docker-compose + # eval apt -y install docker.io docker-compose + fix_dockercompose eval systemctl enable docker eval docker pull opensecurity/mobile-security-framework-mobsf:latest echo "sudo docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest" > /usr/bin/mobsf-docker @@ -1874,7 +1957,8 @@ pbb_create_cleanupsh() { pbb_lab_setup() { echo -e "\n $greenplus Installing docker.io and docker-compose" - eval apt -y install docker.io docker-compose + # eval apt -y install docker.io docker-compose + fix_dockercompose echo -e "\n $greenplus Starting docker service and enabling " eval systemctl enable docker --now @@ -2045,7 +2129,8 @@ hacking_peh_create_cleanupsh() { peh_weblab_setup() { echo -e "\n $greenplus Installing docker.io and docker-compose" - eval apt -y install docker.io docker-compose + # eval apt -y install docker.io docker-compose + fix_dockercompose echo -e "\n $greenplus Starting docker service and enabling " eval systemctl enable docker --now @@ -2363,7 +2448,7 @@ pimpmykali_menu() { echo -e " 4 - Fix Grub (adds mitigations=off)" # fix_grub echo -e " 5 - Fix Impacket (installs impacket 0.9.19)" # fix_impacket echo -e " 6 - Enable Root Login (installs kali-root-login)" # make_rootgreatagain - #echo -e " 7 - Install Waybackrust (waybackrust installed, symlinked to waybackurls)" # fix_waybackurls + echo -e " 7 - Fix Docker-Compose (installs docker-compose and docker.io)" # fix_dockercompose echo -e " 8 - Fix nmap scripts (clamav-exec.nse and http-shellshock.nse)" # fix_nmap echo -e " 9 - Pimpmyupgrade (apt upgrade with vbox/vmware detection)" # only_upgrade echo -e " (sources.list, linux-headers, vm-video)" # - @@ -2404,7 +2489,7 @@ pimpmykali_menu() { 4) fix_grub;; 5) fix_impacket;; 6) make_rootgreatagain;; - # 7) fix_waybackurls;; + 7) fix_dockercompose;; 8) fix_nmap ;; 9) apt_update; fix_libwacom; only_upgrade;; 0) fix_all; run_update; virt_what; check_vm;; @@ -2494,3 +2579,4 @@ check_for_root check_distro check_arg "$1" exit_screen +