infosec/Introduccion-hacking-hack4u/tema_5_conceptos/procmon.sh

20 lines
374 B
Bash
Raw Normal View History

2024-02-10 14:29:52 +01:00
#!/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