valis

Untitled

Apr 6th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.20 KB | None | 0 0
  1. #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.
  2.    
  3. KVAR=`find /home/* | xargs grep "kill"`
  4. BVAR=`find /home/* | xargs grep "bomb"`
  5. NVAR=`find /home/* | xargs grep "Joe Smith"`
  6. QVAR=`find /home/* | xargs grep "quit"`
  7. SVAR=`find /home/* | xargs grep "steal"`
  8.  
  9.     KDIR=`echo $KVAR | cut -d : -f 1`
  10.     BDIR=`echo $BVAR | cut -d : -f 1`
  11.     NDIR=`echo $NVAR | cut -d : -f 1`
  12.     QDIR=`echo $QVAR | cut -d : -f 1`
  13.     SDIR=`echo $SVAR | cut -d : -f 1`
  14.  
  15. KLINE=`echo $KVAR | cut -d : -f 2`
  16. BLINE=`echo $BVAR | cut -d : -f 2`
  17. NLINE=`echo $NVAR | cut -d : -f 2`
  18. QLINE=`echo $QVAR | cut -d : -f 2`
  19. SLINE=`echo $SQAR | cut -d : -f 2`
  20.  
  21.     UK=`echo $KDIR | cut -d / -f 3`
  22.     UB=`echo $BDIR | cut -d / -f 3`
  23.     UN=`echo $NDIR | cut -d / -f 3`
  24.     UQ=`echo $QDIR | cut -d / -f 3`
  25.     US=`echo $SDIR | cut -d / -f 3`
  26.  
  27.             if [ -e $KDIR ]; then
  28.                 echo Username: $UK, Line with bad word found: $KLINE, Path and file name: $KDIR
  29.             fi
  30.  
  31.  
  32.  
  33.             if [ -e $BDIR ]; then
  34.                 echo
Advertisement
Add Comment
Please, Sign In to add comment