infosec/Introduccion-hacking-hack4u/tema_5_conceptos/procmon.sh
2024-02-10 14:29:52 +01:00

20 lines
374 B
Bash
Executable File

#!/bin/bash
function ctrl_c(){
echo -e "\n\n[!] Saliendo...\n"
tput cnorm; exit 1
}
# Ctrl+C
trap ctrl_c SIGINT
old_process=$(ps -eo user,command)
tput civis # Ocultar cursor
while true; do
new_process=$(ps -eo user,command)
diff <(echo "$old_process") <(echo "$new_process") | grep "[\>\<]" | grep -vE "command|kworker|procmon"
old_process=$new_process
done