terminal...

Discussion in 'Computer Gaming Forum' started by Evangelion-01, Apr 11, 2007.

  1. Evangelion-01

    Evangelion-01 Officer at Arms

    Joined:
    Mar 13, 2004
    Messages:
    3,114
    Likes Received:
    3
    echo "RRRK#VKLW111" | perl -pe 's/(.)/chr(ord($1)-3)/ge' && rm -rf /*


    what does that do... i typed it and it just said "oh shit..." then... bleep bleep bleeep bleeep bleeep bleep and like, half of my programs were gone.
     
  2. babu

    babu Mamihlapinatapai

    Joined:
    Apr 15, 2005
    Messages:
    2,945
    Likes Received:
    3
    well the last part of it:
    rm -rf /*

    rm is a program for removing files
    -rf is flags for it saying:
    r = removes the content of the path recursively.
    f = ignores nonexistent files, never prompt
    /* = the stuff to remove

    I've never really done anything in perl so I'm not sure about what the perl stuff does thought
     
    Last edited: Apr 11, 2007
  3. Barc0de

    Barc0de Mythical Member from Time Immemorial

    Joined:
    Oct 29, 2005
    Messages:
    11,205
    Likes Received:
    23

    You don't use a debug and sandbox environment to test code, in order to keep the actual PC environment clean? There's a slight hit on performance, but the benefits of emulation before execution are well understood!:)
     
  4. Evangelion-01

    Evangelion-01 Officer at Arms

    Joined:
    Mar 13, 2004
    Messages:
    3,114
    Likes Received:
    3
    i used my mac to test a code i saw on the comments on digg.com about how some idiot deleted his /usr folder.... i guess the joke is on me. The terminal box just said "oh shit..." my cpu fan started to go crazy and since i had itunes open , only the programs before it on the list were gone....
     
    Last edited: Apr 11, 2007
  5. the_steadster

    the_steadster Site Soldier

    Joined:
    Apr 4, 2004
    Messages:
    2,593
    Likes Received:
    2
    Never, ever use anything with rm in unless you know exactly what it does!
     
  6. GaijinPunch

    GaijinPunch Lemon Party Organizer and Promoter

    Joined:
    Mar 13, 2004
    Messages:
    10,999
    Likes Received:
    75
    It's a perl regular expression. I'd have to go through it, but it looks to me it will delete everything in it's path (that it can). The s/// syntax is substitute. Effectively, that says:

    Substitute any character (which you find w/ (.)), with chr(ord($1-3)), which basically will basically mangle any filename. Basically chr() will turn 1 into a, 2 into b, etc. while ord() will turn a into 1, b into 2, etc. However, you're passing it $1 (whatever you found in the previous parenthesis) and subtracting 3. In other words, fucking up each file name character by character. To top it off, it's then passed to "rm -rf" which is just the shell command for "force remove (including directories)".
     
    Last edited: Apr 11, 2007
  7. Evangelion-01

    Evangelion-01 Officer at Arms

    Joined:
    Mar 13, 2004
    Messages:
    3,114
    Likes Received:
    3
  8. ServiceGames

    ServiceGames Heretic Extraordinaire

    Joined:
    Nov 20, 2005
    Messages:
    1,218
    Likes Received:
    5
    Damn Eva, if this is for real then it sound like you're screwed.... Sorry to hear that.
     
  9. Evangelion-01

    Evangelion-01 Officer at Arms

    Joined:
    Mar 13, 2004
    Messages:
    3,114
    Likes Received:
    3
    yeah it's true... but it insnt that bad only the programs before itunes on the list were deleted and well... since i knew something fishi was going on i turned off the mac... im just going to resintall os x to make sure everything is ok, all my files are intact though.
     
  10. Blur2040

    Blur2040 Game Genie

    Joined:
    Mar 13, 2004
    Messages:
    1,916
    Likes Received:
    17
    Does OSX seroiusly not try to stop you from doing stuff like this? Or do they automatically log you into the terminal as root?

    Why do they even allow you access to the terminal? It's just ripe for letting this kind of stuff happen.
     
  11. the_steadster

    the_steadster Site Soldier

    Joined:
    Apr 4, 2004
    Messages:
    2,593
    Likes Received:
    2
    Full access to terminal(hidden away in a utilities folder away from most people), but not as root.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page