BARIH0x
GITHUBHTB
  • 📀BARIHO
    • 📜 CERTIFICACIONES
      • ✅eJPT
      • ✅OSWP
      • OSCP
  • 🛡️ PROYECTOS
    • ⚙️HOME LAB
      • 🍓PI-HOLE
      • 🗄️OPENMEDIAVAULT
      • ⛓️HOME ASSISTANTS [TRABAJANDO]
      • 🌐OPNSense [PROXIMO]
    • ⛔T-POT
  • ⚔️ WALKTHROUGH
    • 📄 HackTheBox
      • Legacy
      • Blue
      • Lame
    • 📄 TryHackme
      • 27 ~ Cmess - Linux
      • 26 ~ Battery - Linux
      • 25 ~ ConvertMyVideo - Linux
      • 24 ~ DogCat - Linux
      • 23 ~ Wonderland - Linux
      • 22 ~ Lian_Yu - Linux
      • 21 ~ Tomghost - Linux
      • 20 ~ LazyAdmin - Linux
      • 19 ~Boiler CTF - Linux
      • 18 ~ Couchdb - Linux
      • 17 ~ 0day - Linux
      • 16 ~ Brute It - Linux
      • 15 ~ Blog - Linux
      • 14 ~ Madness - Linux
      • 13 ~ Year Of The Rabbit - Linux
      • 12 ~ Inclusion - Linux
      • 11 ~ UltraTech - Linux
      • 10 ~ Anonymous - Linux
      • 9 ~ Ignite - Linux
      • 8 ~ Vulnversity - Linux
      • 7 ~ Basic Pentesting - Linux
      • 6 ~ MrRobot - Linux
      • 5 ~ Agent-Sudo - Linux
      • 4 ~ EasyCTF - Linux
      • 3 ~ Thompson - Linux
      • 2 ~ RootMe - Linux
      • 1 ~ Bounty Hacker - Linux
    • 🎮 OverTheWire
      • BANDIT
      • NATAS
        • Natas 0
    • 🎮 DVWA
      • Instalación DVWA (XAMPP)
      • Instalación DVWA (DOCKER)
      • Command Injection
      • File Inclusion
      • SQL Injection
  • 🛠️RECURSOS
  • Herramientas
  • 🗃️ Scripts
    • KillSSH
  • 💣 Maquinas
    • Login Wordpress - MrRobot
    • Fuzzing - Madness
  • 🔎 LINKS DE INTERERES
Con tecnología de GitBook
En esta página
  1. 🗃️ Scripts

KillSSH

Anterior🗃️ ScriptsSiguiente💣 Maquinas

Última actualización hace 11 meses

Un script bastante básico para matar todos los procesos por SSH y apagar el servicio.

#!/bin/bash

#Colours
greenColour="\e[0;32m\033[1m"
endColour="\033[0m\e[0m"
redColour="\e[0;31m\033[1m"
blueColour="\e[0;34m\033[1m"
yellowColour="\e[0;33m\033[1m"
purpleColour="\e[0;35m\033[1m"
turquoiseColour="\e[0;36m\033[1m"
grayColour="\e[0;37m\033[1m"
###################################

echo -e "\n${redColour}[!] MATANDO TODOS LOS PROCESOS SSH${endColour}"

ps -ef | grep "ssh" | grep -E -v "grep|killssh.sh" | awk '{print $2}' | tr "\n" " " | xargs kill &>/dev/null
sleep 1
echo -e "${yellowColour}[*]${endColour} ${grayColour}TODOS LOS PROCESOS SSH HAN SIDO MATADOS${endColour}"
sleep 1
echo -e "${redColour}[!] PARANDO EL SERVICIO SSH ${endColour}"
sudo systemctl stop ssh.service
sleep 1
echo -e "${yellowColour}[#]${endColour} ${grayColour}SERVICIO SSH PARADO POR SEGURIDAD${endColour}"