• DragonSpeed (unregistered)

    OUCH!

  • Dazed (unregistered)

    For every complicated problem there is a simple solution. And it's wrong.

  • lurker (unregistered)

    I say we take off and nuke the entire site from orbit. It's the only way to be sure.

    ---Ripley

  • steve (unregistered)

    i'm speechless!

  • l1fel1ne (unregistered)

    #revision 1.1

    do
       ./upload_site
    until 1 < 0

    CAPTCHA:clueless - How appropriate

  • (cs)


    ./upload_site
    ./no_really_upload_site
    ./ok_seriously_stop_screwing_around_upload_site

  • (cs) in reply to lurker
    Anonymous:
    I say we take off and nuke the entire site from orbit. It's the only way to be sure.

    ---Ripley


    I love the Clerks reference!
  • Less (unregistered)

    I don't get it.... What's wrong with that?

  • (cs) in reply to Ron Bowes

    Ron Bowes:
    Anonymous:
    I say we take off and nuke the entire site from orbit. It's the only way to be sure.

    ---Ripley


    I love the Clerks reference!

    That was from Aliens.

  • (cs) in reply to Ron Bowes
    Ron Bowes:
    Anonymous:
    I say we take off and nuke the entire site from orbit. It's the only way to be sure.

    ---Ripley


    I love the Clerks reference!


    Wrong movie?
  • (cs)

    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!

  • (cs) in reply to SolidSilver
    SolidSilver:
    Ron Bowes:
    Anonymous:
    I say we take off and nuke the entire site from orbit. It's the only way to be sure.

    ---Ripley


    I love the Clerks reference!


    Wrong movie?


    both movies
  • snoofle (unregistered) in reply to RayS

    RayS:
    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!

    I assume you meant 0 <1 ? Or perhaps 0 != 1 ?

  • snoofle (unregistered) in reply to snoofle

    So that's 15,000 files * approximately 120 executions of thes cript (didn't count; eyeballed it) = 1.8MM files to be checked?

    No problem, just as long as your machine has a handy dandy 4TB cache

  • Hugo (unregistered) in reply to Harsh

    I know it's in the animated clerks, that only had like 6 episodes. They prolly got it from aliens,

    Does the computer get annoyed of doing the exact same command hundreds of times?

  • (cs) in reply to Harsh

    I don't understand; in what way did this script get past the firewall?

    I think the real WTF is in the firewall if simply trying 100 times is what it takes to succeed in doing something that the firewall is set to block.

  • (cs) in reply to snoofle
    Anonymous:

    RayS:
    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!

    I assume you meant 0 <1 ? Or perhaps 0 != 1 ?

     

    I'd prefer

    (paula = <FONT size=+0>"Brillant")</FONT>

  • (cs)

    The TRUE WTF is that issuing the command "./upload_site --no-terminate" didn't work! ;-P

  • Less (unregistered) in reply to Harsh

    Possibly, but the "--Ripley" firmly distinguishes it as an Aliens quote.

  • (cs) in reply to olsner
    olsner:
    I don't understand; in what way did this script get past the firewall?

    I think the real WTF is in the firewall if simply trying 100 times is what it takes to succeed in doing something that the firewall is set to block.


    The firewall isn't set to block, if it were, then it would have never worked. The firewall probably terminated connections of the rsync nature if the connection lived for longer than a set period of time. The number of times needed probably varied slightly depending on bandwidth, traffic, and content.
  • Todd (unregistered) in reply to SolidSilver

    No, although the quote is originally from Aliens - the Clerks reference is actually doubly-brillant.  In "Clerks - The Animated Series", they actually use this quote from Aliens in a witty reference (when Leonardo Leonardo's base launches into orbit).

     

    So actually, whoever posted "I love the Clerks reference" actually one-upped all you geeks out there with a double reference.

  • mare (unregistered)

    It must have been auto-generated.

    (captcha = paula :))

  • ohng (unregistered) in reply to Less

    Isn't it obvious?

    The shell script was written by the network folks to test a self-DOS attack.

    or something

    The real WTF is that they didn't burn the web site to CD 100 times, carry the CDs over to the web server, and copy each of them in turn. I think that would be an excellent way to ensure job security, especially for the CD retailer.

  • mare (unregistered) in reply to ohng
    Anonymous:
    Isn't it obvious?

    The shell script was written by the network folks to test a self-DOS attack.

    or something

    The real WTF is that they didn't burn the web site to CD 100 times, carry the CDs over to the web server, and copy each of them in turn. I think that would be an *excellent* way to ensure job security, especially for the CD retailer.

    No no, print the web page out, put the print on a wooden desk, take a picture of it, scan the picture... :P
  • Steve (unregistered)

    at least the dot wasnt in the local path. and captcha = craptastic...so is this in reference to my comment or the ./upload-site?                 

  • (cs)

    We need a "Scripting languages considered harmful" article, written by a computing authority :)

    The saddest part is that they probably only needed to check the return code of the script. A simple example in bash: ("simple" means that the syntax is probably incorrect and that there must a hundred of more correct ways to do it, but this one would still be much better than what they did)

    ./upload_script
    while [[ $? != 0 ]]; do
      ./upload_script
    done;
    
  • (cs) in reply to snoofle
    Anonymous:

    RayS:
    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!

    I assume you meant 0 <1 ? Or perhaps 0 != 1 ?


    That'll be it! Never start writing a WHILE but add the condition for a DO UNTIL.
    Still, what's a WTF submission without at least one WTF reply?
  • Adam WG (unregistered)

    Proper way to code this sort of thing:

    while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done

    Like, duh.

  • snoofle (unregistered) in reply to mare

    Anonymous:
    Anonymous:
    Isn't it obvious?

    The shell script was written by the network folks to test a self-DOS attack.

    or something

    The real WTF is that they didn't burn the web site to CD 100 times, carry the CDs over to the web server, and copy each of them in turn. I think that would be an *excellent* way to ensure job security, especially for the CD retailer.

    No no, print the web page out, put the print on a wooden desk, take a picture of it, scan the picture... :P

    Non no no - put the CD on the wooden table, ...

  • (cs)
    Jake Vinson:

     Below are the unedited, full contents of "retry_upload_site:"

    ./upload_site
    ./upload_site
    ...
    ./upload_site

    Fortunately, rsync only had to compare about 15,000 files every time upload_site ran.

    The real WTF is that they didn't use XML ...

    <root>
     <node1>
      <subnode a="0" b="./upload_site" />
      <subnode a="1" b="./upload_site" />
      <subnode a="2" b="./upload_site" />
      <subnode a="3" b="./upload_site" />
      <subnode a="4" b="./upload_site" />
      <subnode a="5" b="./upload_site" />
      <subnode a="6" b="./upload_site" />
      <subnode a="7" b="./upload_site" />

    etc


      </node1>
      </root>

  • matthew muscari (unregistered) in reply to snoofle

    no  you see this is very efficient code... notice how he unrolled the loop to reduce overhead!

  • script-guy (unregistered) in reply to Adam WG

    Anonymous:
    Proper way to code this sort of thing:

    while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done Like, duh.

    How is that different from:

    while [[ 1 ]]; do

          ./upload-site

    done

    ?

  • script-guy (unregistered) in reply to script-guy
    Anonymous:

    Anonymous:
    Proper way to code this sort of thing:

    while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done Like, duh.

    How is that different from:

    while [[ 1 ]]; do

          ./upload-site

    done

    Grrr - never-mind - smudge on crt over the second '>' 0- didn't see it

    Ironically, captcha = quality

  • (cs)

    Reminds me of the old days when people said "Please" to their computers.

  • (cs) in reply to RayS
    RayS:
    Anonymous:

    RayS:
    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!

    I assume you meant 0 <1 ? Or perhaps 0 != 1 ?


    That'll be it! Never start writing a WHILE but add the condition for a DO UNTIL.
    Still, what's a WTF submission without at least one WTF reply?

    You're making it too hard.  You just need
    while (true)
    {
       ./upload_site

    }


    Or you could do this
    while (true)
    {
       if (0==1)
       {
          break;
       }
       ./upload_site
    }

    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!

  • (cs) in reply to richleick
    richleick:


    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!


    No, it should not.

    sincerely,
    Richard Nixon
  • Looce (unregistered) in reply to richleick
    richleick:


    -- snip -- ~Looce


    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!


    The language does not dictate where its syntactic elements should be placed, unless said placement is part of the syntax (as in mIRC scripting).
    That would be a coding convention.

  • WebMasterP (unregistered) in reply to DragonSpeed

    <FONT face=Tahoma size=2>This one is so funny I'm actually inspired to post:</FONT>

    <FONT face=Tahoma>LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOL</FONT>

  • (cs) in reply to Richard Nixon

    Richard Nixon:
    richleick:


    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!


    No, it should not.

    sincerely,
    Richard Nixon

    Let's be thankful that there aren't "C"-style #define's in Java, or there'd be folks doing stuff like this:

    #define then
    #define begin {
    #define end }
    if (x > y) then 
       begin 
         blah; 
       end;
    

    (Once, on a bet, I wrote a Pascal/C translator doing most of the work with #define statements)

  • (cs) in reply to Dazed
    Anonymous:
    For every complicated problem there is a simple solution. And it's wrong.

    Nay sir. For every complicated problem there is a simple solution and a wrong one.

    This is the 3rd solution, the idiotic one.

    Anonymous:

    RayS:
    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!

    I assume you meant 0 <1 ? Or perhaps 0 != 1 ?

    No, this is a shell script, in shell scripts affectation requires the use of SET.

    richleick:

    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!

    Fuck no, K&R for the win.

  • Patrik (unregistered) in reply to Adam WG

    Yeah, another WTF answer! (captcha: wtf...)

    Way to proper way™ Step 1:
    while [[ 1 ]]; do echo "./upload-site" >> script; chmod u+x script; ./script; done

    Way to proper way™ Step 2:
    while [[ 1 ]]; do ./upload-site; done

    Way to proper way™ Step 3:
    while true; do ./upload-site; done

    Way to proper way™ Final Step 4:
    Fix the network.


    And the forum software sucks... why is it impossible to migrate to something not as braindead as that one? The sole fact that this is an ASP page...

  • Patrik (unregistered) in reply to Adam WG
    Anonymous:
    Proper way to code this sort of thing:

    while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done

    Like, duh.



    Grah. Meant to quote that post. Now this is the "Design" editor, and I see [ quote ] marks. BBcode embedded in HTML? STFU (captcha).

  • A coward called anonymous (unregistered) in reply to RayS
    RayS:
    So what's the WTF? That he didn't try to upload_site more times that that?


    To be REALLY SAFE, you need to reimplement it something like this.


    WHILE (0=1)
        ./upload_site
    LOOP

    This would be totally ok and even somewhat cunning way of looping ad infitum but usually you can't use a single number as an variable. Sad really :(
  • (cs)

    I'm going to buy the "Micro Mitt", turn it on, and punch the class action lawsuit guy.

  • (cs) in reply to Less

    Anonymous:
    Possibly, but the "--Ripley" firmly distinguishes it as an Aliens quote.

    Hahahahahahahaaa!!!

  • (cs) in reply to l1fel1ne
    Anonymous:

    #revision 1.1

    do
       ./upload_site
    until 1 < 0

    CAPTCHA:clueless - How appropriate



    Nah, just use perl and check the exit status:

    while(!($x == -1)){
    system(./upload_site);
    $x = ($? & 127);
    }

    There you go, guaranteed to smash your system like a tin can under an unending barrage of process forks.

  • (cs) in reply to Adam WG
    Anonymous:
    Proper way to code this sort of thing:

    while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done

    Like, duh.

    Better:

    while [[ 1 ]]; do echo "./upload-site" >> script; done; ./script

  • (cs) in reply to snoofle
    snoofle:

    Richard Nixon:
    richleick:


    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!


    No, it should not.

    sincerely,
    Richard Nixon

    Let's be thankful that there aren't "C"-style #define's in Java, or there'd be folks doing stuff like this:

    #define then
    #define begin {
    #define end }
    if (x > y) then 
       begin 
         blah; 
       end;
    

    (Once, on a bet, I wrote a Pascal/C translator doing most of the work with #define statements)

    I always preferred to write the "begin" on the same line in Pascal, too.  There is no need to start a block on an empty line because the indent denotes the start of a new block...

  • (cs) in reply to richleick

    richleick:

    And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!

    The only time I ever see people putting {'s on a line by themselves aside from opening a function, class, or namespace where it will be all the way at the beginning of the line, is when people are trying to increase their LOC.

  • (cs) in reply to makomk
    makomk:
    Anonymous:
    Proper way to code this sort of thing:

    while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done

    Like, duh.

    Better:

    while [[ 1 ]]; do echo "./upload-site" >> script; done; ./script



    Did I miss something, or will both of these simply fill the file 'script' with lines (untill the disk runs out of space and it crashes) while never actually getting to the part where it executes the script?

    Now that is replacing a WTF with a real WTF.

Leave a comment on “If at first you don't succeed...”

Log In or post as a guest

Replying to comment #:

« Return to Article