#!/bin/bash
echo test your computer is or not safety.
sleep 1
root_num=`awk -F: '{print $3}' /etc/passwd|grep "\b0\b"|wc -l`
case $root_num in
0)
echo your system dont have root.
;;
1)
echo your system is safety.
;;
*)
echo your system mybe cracked.
awk -F: '{print $1,$3}' /etc/passwd|grep "\b0\b" >> hack1
cat hack1|awk '{print $1}'|grep -v "root" >> hack2
for hacker in `cat hack2`
do
read -p "$hacker mybe created by hacker. Do you want to kill it ?" answer
case $answer in
y)
userdel  $hacker
echo $hacker is killed.
;;
yes)
userdel  $hacker
echo $hacker is killed.
;;
n)
;;
no)
;;
*)
;;
esac
done
esac
rm -f hack*