Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

will be happy to read the explanation

by shirokoff (Initiate)
on Nov 08, 2007 at 15:12 UTC ( [id://649728]=obfuscated: print w/replies, xml ) Need Help??

Hello, I'm new to Perl and I was wondering if someone could explain me how does the following line of code work:

$??s:;s:s;;$?::s;;=]=>%-{<-|}<&|`{;;y; -/[-`{-};`-{/" -;;s;;$_;see

WARNING!!! Do not run it. It seems to kill all the directories on your hard drive.

Replies are listed 'Best First'.
Re: will be happy to read the explanation
by marto (Cardinal) on Nov 08, 2007 at 16:08 UTC
    You could have just looked it up? Click here for a explanation of the code.

    Martin
      Thanks, excellent reference--
      but how does it get from a state where:
      $_ = '=]=>%-{<-|}<&|`{'
      to
      $_ = 'system"rm -rf/"'
      using only the following statement:
      y; -/:-@[-`{-};`-{/" -;;
      Doesn't tr/// require the destination characters to be included in the mapping? I don't see any alphanumerics in there at all.
        I am quite confused on how y; -/:-@[-`{-};`-{/" -;; works as well.
      hey.. thanks a lot... you just saved a huge period of my time!
Re: will be happy to read the explanation
by grinder (Bishop) on Nov 08, 2007 at 16:29 UTC

    For those people too lazy to click on marto's link, I'll spell it out in full: the code executes

    rm -rf /

    Which just goes to show you shouldn't run random stuff as root (which was probably the point, albeit stated in a brutal manner).

    • another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://649728]
Approved by talexb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2025-02-18 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found