Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Searches all of users home directories documents for "kill, bomb, name, quit, and steal". The script needs to report to the screen the Username, Line with bad word found, Path and file name. After running the script the first time, legitimate uses for words (kill the process) will no longer be flagged by the script.
- KVAR=`find /home/* | xargs grep "kill"`
- BVAR=`find /home/* | xargs grep "bomb"`
- NVAR=`find /home/* | xargs grep "Joe Smith"`
- QVAR=`find /home/* | xargs grep "quit"`
- SVAR=`find /home/* | xargs grep "steal"`
- KDIR=`echo $KVAR | cut -d : -f 1`
- BDIR=`echo $BVAR | cut -d : -f 1`
- NDIR=`echo $NVAR | cut -d : -f 1`
- QDIR=`echo $QVAR | cut -d : -f 1`
- SDIR=`echo $SVAR | cut -d : -f 1`
- KLINE=`echo $KVAR | cut -d : -f 2`
- BLINE=`echo $BVAR | cut -d : -f 2`
- NLINE=`echo $NVAR | cut -d : -f 2`
- QLINE=`echo $QVAR | cut -d : -f 2`
- SLINE=`echo $SQAR | cut -d : -f 2`
- UK=`echo $KDIR | cut -d / -f 3`
- UB=`echo $BDIR | cut -d / -f 3`
- UN=`echo $NDIR | cut -d / -f 3`
- UQ=`echo $QDIR | cut -d / -f 3`
- US=`echo $SDIR | cut -d / -f 3`
- if [ -e $KDIR ]; then
- echo Username: $UK, Line with bad word found: $KLINE, Path and file name: $KDIR
- fi
- if [ -e $BDIR ]; then
- echo
Advertisement
Add Comment
Please, Sign In to add comment