From b08fd74e45afb72c008e1ea3e0d6a1bc4831c07c Mon Sep 17 00:00:00 2001 From: Mathis CHIRAT Date: Tue, 24 Oct 2023 17:32:53 +0200 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deftools.sh | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 100 insertions(+), 37 deletions(-) diff --git a/deftools.sh b/deftools.sh index 7387a51..94ac120 100644 --- a/deftools.sh +++ b/deftools.sh @@ -2,18 +2,24 @@ clear +BGRED="\e[41m" +BGGREEN="\e[42m" + RED="\e[31m" GREEN="\e[32m" +LIGHT_RED="\e[91m" +LIGHT_GREEN="\e[92m" YELLOW="\e[33m" CYAN="\e[36m" ENDCOLOR="\e[0m" Aff() { - printf "\n${CYAN}█████ ████ ████ ████████ ██████ ██████ ██ ███████" - printf "\n██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ " - printf "\n██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ███████ " - printf "\n██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ " - printf "\n█████ ████ ██ ██ ██████ ██████ ███████ ███████${ENDCOLOR}\n" + printf "\n" + printf "\n ${CYAN}█████ ████ ████ ████████ ██████ ██████ ██ ███████" + printf "\n ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ " + printf "\n ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ███████ " + printf "\n ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ " + printf "\n █████ ████ ██ ██ ██████ ██████ ███████ ███████${ENDCOLOR}\n" } i=0 @@ -23,15 +29,15 @@ do printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" printf "\n " - printf "\n(1) • Panel" - printf "\n(2) • CMD Message Protection" - printf "\n(3) • SSH Protection" - printf "\n(4) • PSQL PassWord Protection" - printf "\n(5) • BASHRC Protection" - printf "\n(6) • ${RED}Comming Soon..${ENDCOLOR}" - printf "\n(7) • Panic Button" - printf "\n(8) • Information" - printf "\n(9) • Exit" + printf "\n (1) • Panel" + printf "\n (2) • CMD Message Protection" + printf "\n (3) • SSH Protection" + printf "\n (4) • PSQL PassWord Protection" + printf "\n (5) • BASHRC Protection" + printf "\n (6) • Sound Protection" + printf "\n (7) • Panic Button" + printf "\n (8) • Information" + printf "\n (9) • Exit" printf "\n " printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬${ENDCOLOR}\n" @@ -47,7 +53,10 @@ do cmdpanel_bashrc="$(ls -ld ~/.bashrc | grep -o '^\S*')" clear Aff - printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n" + printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + printf "\n\t\t\tType:\n" + printf "\n ${GREEN}•${ENDCOLOR} Protégé / Activé \n ${YELLOW}•${ENDCOLOR} Vulnérable / Warning \n ${RED}•${ENDCOLOR} Hautement Vulnérable / Désactivé\n" + printf "____________________________________________________\n" if [[ $cmdpanel_msg == "0" ]]; then printf "\n ${GREEN}• ${ENDCOLOR}CMD Message Protection" else @@ -102,19 +111,30 @@ do do clear cmdpanel_msg="$(ls -l -A /dev/pts | grep $USER | grep -v 'rw-------' | wc -l)" + + Aff + + printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + printf "\n " + printf "\n\t\tMessage Protection" + printf "\n " if [[ $cmdpanel_msg == "0" ]]; then - printf "\n> ${ENDCOLOR}CMD Message Protection ${GREEN}Enable ${ENDCOLOR}\n" + printf "\n\t\t ${ENDCOLOR} ${LIGHT_GREEN}Enable${ENDCOLOR}/${RED}Disable ${ENDCOLOR}\n" else - printf "\n> ${ENDCOLOR}CMD Message Protection ${RED}Disable ${ENDCOLOR}\n" + printf "\n\t\t ${ENDCOLOR} ${GREEN}Enable${ENDCOLOR}/${LIGHT_RED}Disable ${ENDCOLOR}\n" fi - read -p "Disable / Enable / Exit : " cmdmed - if [[ $cmdmed == "Disable" ]]; then - mesg on - printf "\n> ${RED} CMD Message Protection Disable ! ${ENDCOLOR}\n" - elif [[ $cmdmed == "Enable" ]]; then + printf "\n (1) • Enable" + printf "\n (2) • Disable" + printf "\n (3) • Exit" + printf "\n " + printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n\n" + + read -p ">> " cmdmed + if [[ $cmdmed == "1" ]]; then mesg no - printf "\n> ${GREEN} CMD Message Protection Ensable ! ${ENDCOLOR}\n" - elif [[ $cmdmed == "Exit" ]]; then + elif [[ $cmdmed == "2" ]]; then + mesg on + elif [[ $cmdmed == "3" ]]; then j=1 else printf "\n ${RED} ERR0R Invalide Input" @@ -127,22 +147,33 @@ do do clear cmdpanel_ssh="$(ls -ld ~/.ssh | grep -o '^\S*')" + + Aff + + printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + printf "\n " + printf "\n\t\tSSH File Protection" + printf "\n " if [[ $cmdpanel_ssh == "drwx------" ]]; then - printf "\n> ${ENDCOLOR}SSH File Protection ${GREEN}Enable ${ENDCOLOR}\n" + printf "\n\t\t ${ENDCOLOR} ${LIGHT_GREEN}Enable${ENDCOLOR}/${RED}Disable ${ENDCOLOR}\n" else - printf "\n> ${ENDCOLOR}SSH File Protection ${RED}Disable ${ENDCOLOR}\n" + printf "\n\t\t ${ENDCOLOR} ${GREEN}Enable${ENDCOLOR}/${LIGHT_RED}Disable ${ENDCOLOR}\n" fi - read -p "Disable / Enable / Exit : " sshproct - if [[ $sshproct == "Disable" ]]; then + printf "\n (1) • Enable" + printf "\n (2) • Disable" + printf "\n (3) • Exit" + printf "\n " + printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n\n" + + read -p ">> " sshproct + if [[ $sshproct == "1" ]]; then + chmod 700 ~/.ssh + elif [[ $sshproct == "2" ]]; then read -p "Entrer la permission que vous voulez mettre: " perm chmod $perm ~/.ssh printf "Custom Perm au .ssh appliquée." sleep 1 - elif [[ $sshproct == "Enable" ]]; then - chmod 700 ~/.ssh - printf "Protection du .ssh ${GREEN}activé${ENDCOLOR}" - sleep 1 - elif [[ $sshproct == "Exit" ]]; then + elif [[ $sshproct == "3" ]]; then j=1 else printf "\n ${RED} ERR0R Invalide Input${ENDCOLOR}" @@ -206,11 +237,27 @@ do fi done clear + elif [[ $toolsuse == "6" ]]; then + printf "${RED} NoSound in Dev.." + sleep 1 + clear + #read -p "Êtes vous sur d'activer le NoSound ? (y/n) : " nosound + #if [[ $nosound == "y" ]]; then + # nosound_patch="while true; do pactl set-sink-mute 0 true; pactl set-sink-volume 0 0%; done" + # exe="${nosound_patch} &" + # $exe + # printf "\n ${GREEN}NoSound Activé." + #fi elif [[ $toolsuse == "7" ]]; then printf "\n ${YELLOW}/!\\ WARNING /!\\ " printf "\n" - printf "\nEn activant cette fonctionnalité tout vos fichiers passerons en 700." - printf "\nSeul vous y aurez donc accès. ${ENDCOLOR}" + printf "\nEn activant cette fonctionnalité:" + printf "\n - Votre home passera en 700." + printf "\n - Votre .ssh passera en 700." + printf "\n - Votre .bashrc passera en 600." + printf "\n - Votre PSQL History sera remove." + printf "\n - Votre Bash History sera remove." + printf "\n${ENDCOLOR}" printf "\n" read -p "Êtes vous sur d'activer le panic button ? (y/n) : " panicbtn @@ -222,8 +269,23 @@ do printf "\n" read -p "Code: " code if [[ $rdmcode == $code ]]; then - chmod -R 700 ~ - printf "\n ${RED}Le Panic Button a été activé. ${ENDCOLOR}" + printf "\n ${RED}Le Panic Button a été activé. ${ENDCOLOR}\n\n" + printf "Set Home to 700 Perm.." + chmod 700 ~ + printf "\tOk\n" + printf "Set .ssh to 700 Perm.." + chmod 700 ~/.ssh + printf "\tOk\n" + printf "Set .bashrc to 600 Perm.." + chmod 600 ~/.bashrc + printf "\tOk\n" + printf "Remove PSQL History.." + rm ~/.psql_history + printf "\tOk\n" + printf "Remove Bash History.." + rm ~/.bash_history + printf "\tOk\n" + printf "\nProtection d'urgence de la session activé." sleep 2 clear else @@ -242,6 +304,7 @@ do Aff printf "\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + printf "\n Version 1.0" printf "\n " printf "\n DefTools est un script Bash de protection." printf "\n Développé par Mathis Chirat"