It's an obfuscated destructo-simulator... it simulates a prompt,
followed by printing "cd", "rm -rf *", and the admonition "why do you
execute unknown mail content?". Point being that "sub
i($){print$_[0]}", harmless, could just have easily used "system" or
some such instead of print, and whacked all the files in your home
directory.
The obfuscations are pretty standard, although defining a subroutine
named "_" is an oldie but a goodie. The author was kind in that all the
tricky bits are at the front... subroutines named "i", "_", and "w" are
defined, and the alias glob of *j=*ENV.
Here's a non-obfuscated version. $j has been replaced everywhere by
$ENV, the gratuitous $f is gone, subroutines i and w have been replaced
by their one-line definitions, print and sleep, and the subroutine _ is
now named printPromptRot8:
-----BEGIN CODE-----
sub printPromptRot8 ($){
print "$p$c > ";
sleep 1;
$_=$_[0];
tr/i-za-h,/a-hi-z /; # Rot -8, plus comma gets translated to space
print $_;
sleep 1;
print "\n"
}
$|=1;
($c=$ENV{PWD})=~s/$ENV{"HOME"}/~/;
$p="$ENV{USER}\@$ENV{HOSTNAME}:";
printPromptRot8 "kl";
$c='~'; # simulate the change to home directory
printPromptRot8 "zu,-zn,*";
printPromptRot8 "#,epg,lw,gwc,mfmkcbm,cvsvwev,uiqt,kwvbmvb?";
print "$p$c > ";
sleep 99 ; # wait the 99 seconds, and you get your real prompt
-----END CODE-----
-Alex
--- Nathan England <
plug@the-arcanum.org> wrote:
> >
> I recieved this in the end of an email...
> I put it in a file and ran perl on it and it began doing stuff...
> But i couldn't tell what.
>
> Can someone tell me what this means?
>
> sub i($){print$_[0]}*j=*ENV;sub w($){sleep$_[0]}sub _($){i"$p$c > ",w
> 1,$_=$_[0],tr;i-za-h,;a-hi-z ;,i$_,w 1,i"\n"}$|=1;$f='HO';($c=$j{PWD}
> )=~s/$j{$f."ME"}/~/;$p="$j{USER}\@$j{HOSTNAME}:";_"kl",$c='~',_"zu,".
> "-zn,*",_"#,epg,lw,gwc,mfmkcbm,cvsvwev,uiqt,kwvbmvb?",i"$p$c > ";w 99
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com