Thread: Bad Bot Block

Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Bad Bot Block

    Trying to block a bot that is changing it's ip address but the host name is staying the same. The Block Bad Bot module BBB.zip can it be modified to instead of blocking based on the user agent block instead by the customers session host name?

    below is the code for the BBB to block a user agent:

    PHP Code:
    <?php
    if (stristr(strtolower($_SERVER['HTTP_USER_AGENT']), 'badrobotnamehere')) {
        @
    header("HTTP/1.1 410 Gone");
        exit();
      }

  2. #2
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Bad Bot Block

    The below code should work but it is not. I believe the issue is it is not able to fetch the customers host address. Is there a statement that needs to go before the if statement to make this work?

    PHP Code:
    <?php
    if (($_SESSION['customers_host_address'] == 'XXXXXXXXXXXX')) {
        @
    header("HTTP/1.1 410 Gone");
        exit();
      }

  3. #3
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Bad Bot Block

    Ok forget the above the ip is changing it's the session id that I need to block. Trying the below but it is not working:

    PHP Code:
    <?php
    if ($_SESSION['SSL_SESSION_ID'] == 'XXXXXXXXXXXXXXXXXXXXX) {
        @header("HTTP/1.1 410 Gone");
        exit();
      }

  4. #4
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Idea or Suggestion Re: Bad Bot Block

    Tried this too and it does not work, can anyone help on this have active bot that I need to block.

    PHP Code:
    if zen_session_id() == xxxxxxxxxxxxxxxxxxx{
        @
    header("HTTP/1.1 410 Gone");
        exit();
      } 

  5. #5
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Bad Bot Block

    This bot is still on my site using a different IP address every so many seconds but the session id is the same so I'm thinking that we should have a way to block by session id. I'm trying to modify the module Bad Bot Block which is a simple one file upload to includes\extra_configures\block_xxxxx_spider.php

    Here is my latest attempt but it is not working because it is not seeing I think the session id I'm calling it wrong or missing code. I'm not a programmer if someone can assist this can be a good tool to combat abusive bots.


    I'm replacing XXXXXXXXSESSIONIDXXXXXXXXXXX with a valid session id of course.

    PHP Code:
    <?php
    if ($_SESSION['zenid'] == 'XXXXXXXXSESSIONIDXXXXXXXXXXX') {
        @
    header("HTTP/1.1 410 Gone");
        exit();
      }

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,491
    Plugin Contributions
    88

    Default Re: Bad Bot Block

    Quote Originally Posted by marcopolo View Post
    This bot is still on my site using a different IP address every so many seconds but the session id is the same so I'm thinking that we should have a way to block by session id. I'm trying to modify the module Bad Bot Block which is a simple one file upload to includes\extra_configures\block_xxxxx_spider.php

    Here is my latest attempt but it is not working because it is not seeing I think the session id I'm calling it wrong or missing code. I'm not a programmer if someone can assist this can be a good tool to combat abusive bots.


    I'm replacing XXXXXXXXSESSIONIDXXXXXXXXXXX with a valid session id of course.

    PHP Code:
    <?php
    if ($_SESSION['zenid'] == 'XXXXXXXXSESSIONIDXXXXXXXXXXX') {
        @
    header("HTTP/1.1 410 Gone");
        exit();
      }
    The files in the /extra_configures and /extra_datafiles directories are loaded way-early in a page's load and, specifically, prior to the session being started. You could add that code as a /functions/extra_functions file, since that directory's files are all loaded post-session-start.

  7. #7
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Bad Bot Block

    Bot is gone so had to test on myself and it worked perfect! Thank you for your help!

 

 

Similar Threads

  1. Block Spider Bot - RPT-HTTPClient/0.3-3
    By miles in forum General Questions
    Replies: 2
    Last Post: 8 Jan 2009, 04:52 AM
  2. Spacing issues with Price, Attributes & Add to Cart block. - FireFox GOOD - IE BAD!
    By Sugarfreegum in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Jul 2008, 03:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR