• PHP Trickery

    From Angus McLeod@VERT/ANJO to All on Monday, May 28, 2007 10:27:00
    Ok, so I am detecting undesirables who visit my site, and I'm doing this:

    <?
    . . .
    if ( $asshole_quotient > 0 ) {
    header( "Location: /eat_shit_and_die.php" );
    }


    which very nicely sends them to a rude page. But most of the assholes are really scripts on automatic, so rudeness doesn't hurt them. What I want
    to do instead is...

    NOT send any response at all. I want the connection to remain open until
    it times out from their end.

    But I don't want to go into a busy_loop or anything like that on my end.
    I just want to silently drop the connection on the floor, and leave them waiting indefinately for a response that will never come.

    I can't quite think how this might be accomplished.

    Anybody got any ideas how to do this without excessive difficulty?
    Ideally, I'd redirect them to some OTHER site which would accept the connection and then..... leave them waiting forever.



    ---
    Playing: "Show" by "Beth Gibbons And Rustin Man"
    from the "Out of season" album
    þ Synchronet þ With my ISP it's the InterNOT at The ANJO BBS
  • From Deuce@VERT/SYNCNIX to Angus McLeod on Monday, May 28, 2007 11:38:00
    Re: PHP Trickery
    By: Angus McLeod to All on Mon May 28 2007 10:27 am

    <?
    . . .
    if ( $asshole_quotient > 0 ) {
    header( "Location: /eat_shit_and_die.php" );
    }
    ?>

    <?

    while(1) {
    mswait(5000);
    write(' ');
    }



    Of course, then you are using your port resources...

    ---
    Synchronet - Jump on the Web 0.2 bandwagon!

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Angus McLeod@VERT/ANJO to Deuce on Tuesday, May 29, 2007 00:20:00
    Re: PHP Trickery
    By: Deuce to Angus McLeod on Mon May 28 2007 11:38:00

    <?

    while(1) {
    mswait(5000);
    write(' ');
    }



    Of course, then you are using your port resources...

    Yeah, that's why I said:

    But I don't want to go into a busy_loop or anything like
    that on my end.

    For obvious reasons.

    ---
    Playing: "220 volt" by "Tangerine Dream"
    from the "220 Volt live" album
    þ Synchronet þ With my ISP it's the InterNOT at The ANJO BBS
  • From Deuce@VERT/SYNCNIX to Angus McLeod on Tuesday, May 29, 2007 03:15:00
    Re: PHP Trickery
    By: Angus McLeod to Deuce on Tue May 29 2007 12:20 am

    Of course, then you are using your port resources...

    Yeah, that's why I said:

    But I don't want to go into a busy_loop or anything like
    that on my end.

    For obvious reasons.

    Well, it's most definately not a busy loop... assuming any sane spammer will use a creafully broken stack, there's no good way of breaking them.

    If, however, they use a working stack, arranging to never send the ACK to their FIN will drive them into FIN_WAIT_2

    That's not very likely though.

    ---
    Synchronet - Jump on the Web 0.2 bandwagon!

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Tracker1@VERT/TRN to Angus McLeod on Wednesday, May 30, 2007 10:45:00
    Angus McLeod wrote:
    NOT send any response at all. I want the connection to remain open until
    it times out from their end.

    But I don't want to go into a busy_loop or anything like that on my end.
    I just want to silently drop the connection on the floor, and leave them waiting indefinately for a response that will never come.

    I can't quite think how this might be accomplished.

    Anybody got any ideas how to do this without excessive difficulty?
    Ideally, I'd redirect them to some OTHER site which would accept the connection and then..... leave them waiting forever.

    http://www.w3schools.com/php/func_misc_sleep.asp

    while (true)
    sleep(5);

    that should work, when the socket times out, it should kill the script, I know IIS will do this, not sure about Apache + mod_php.

    --
    Michael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.net icq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)

    ... Ferengi Rule of Acquisition #172: If you can sell it, don't hsitate to steal it

    ---
    þ Synchronet þ theroughnecks.net - you know you want it