Page 6 of 6 FirstFirst ... 456
Results 51 to 58 of 58
  1. #51
    Join Date
    Oct 2007
    Location
    Cornwall/Amsterdam
    Posts
    61
    Plugin Contributions
    0

    Default Re: AbuseIPDB Integration module

    Just a thought.

    Could it be that the spiders detection/do not allow sessions for spiders code happens further down in the code stack, so the abuseipdb plugin does its api lookup/redirect before the useragent is detected as a spider from the spiders.txt file?

  2. #52
    Join Date
    May 2008
    Posts
    443
    Plugin Contributions
    1

    Default Re: AbuseIPDB Integration module

    Quote Originally Posted by johnjlarge View Post
    Just a thought.

    Could it be that the spiders detection/do not allow sessions for spiders code happens further down in the code stack, so the abuseipdb plugin does its api lookup/redirect before the useragent is detected as a spider from the spiders.txt file?
    I checked that I think it's good from the program flow I referenced:
    https://docs.zen-cart.com/dev/code/program_flow/

    Set up and start session if valid session is above where this module comes in which is: NOTIFY_HTML_HEAD_START (the /includes/templates/common/html_header.php) unless I'm missing something. I tried going further down the list which did not resolve the issue.

  3. #53
    Join Date
    May 2008
    Posts
    443
    Plugin Contributions
    1

    Default Re: AbuseIPDB Integration module

    Recap and Solution I Implemented in v2.0.7 for the Meantime:

    Problem:
    During testing, I faced difficulties with the spider detection feature in Zen Cart. Specifically, the utilization of the $spider_flag variable did not produce the expected results, particularly in generating logs after detecting a spider using:

    PHP Code:
    if (isset($spider_flag) && $spider_flag === true
    Solution Implemented:
    To resolve this issue, I decided to clone the spider detection code from Zen Cart and integrate it directly into the module functions file. This allowed me to incorporate the spider detection functionality without relying on Zen Cart's $spider_flag variable. As a result, the spider detection now works as intended within my custom code.

    PHP Code:
    function checkSpiderFlag() {
        if (
    defined('SESSION_BLOCK_SPIDERS')) {
            
    $user_agent_abuseipdb '';
            if (isset(
    $_SERVER['HTTP_USER_AGENT'])) {
                
    $user_agent_abuseipdb strtolower($_SERVER['HTTP_USER_AGENT']);
            }
            
    $spider_flag_abuseipdb false;
            if (!empty(
    $user_agent_abuseipdb)) {
                
    $spiders_abuseipdb file(DIR_WS_INCLUDES 'spiders.txt');
                for (
    $i 0$n sizeof($spiders_abuseipdb); $i $n$i++) {
                    if (!empty(
    $spiders_abuseipdb[$i]) && substr($spiders_abuseipdb[$i], 04) != '$Id:') {
                        if (
    is_integer(strpos($user_agent_abuseipdbtrim($spiders_abuseipdb[$i])))) {
                            
    $spider_flag_abuseipdb true;
                            break;
                        }
                    }
                }
            }
            return 
    $spider_flag_abuseipdb;
        }
        return 
    false
    Although the current solution successfully resolves the logging problem, I am interested in understanding why using the original $spider_flag variable did not produce the expected outcome. If anyone has any insights, suggestions, or guidance that could be a potential resolution that would allow me to revert back to using the $spider_flag in the future, please do let me know!

    Thank you for your time and assistance.

  4. #54
    Join Date
    Oct 2007
    Location
    Cornwall/Amsterdam
    Posts
    61
    Plugin Contributions
    0

    Default Re: AbuseIPDB Integration module

    Quote Originally Posted by marcopolo View Post
    Recap and Solution I Implemented in v2.0.7 for the Meantime:

    Problem:
    During testing, I faced difficulties with the spider detection feature in Zen Cart. Specifically, the utilization of the $spider_flag variable did not produce the expected results, particularly in generating logs after detecting a spider using:

    PHP Code:
    if (isset($spider_flag) && $spider_flag === true
    Solution Implemented:
    To resolve this issue, I decided to clone the spider detection code from Zen Cart and integrate it directly into the module functions file. This allowed me to incorporate the spider detection functionality without relying on Zen Cart's $spider_flag variable. As a result, the spider detection now works as intended within my custom code.

    PHP Code:
    function checkSpiderFlag() {
        if (
    defined('SESSION_BLOCK_SPIDERS')) {
            
    $user_agent_abuseipdb '';
            if (isset(
    $_SERVER['HTTP_USER_AGENT'])) {
                
    $user_agent_abuseipdb strtolower($_SERVER['HTTP_USER_AGENT']);
            }
            
    $spider_flag_abuseipdb false;
            if (!empty(
    $user_agent_abuseipdb)) {
                
    $spiders_abuseipdb file(DIR_WS_INCLUDES 'spiders.txt');
                for (
    $i 0$n sizeof($spiders_abuseipdb); $i $n$i++) {
                    if (!empty(
    $spiders_abuseipdb[$i]) && substr($spiders_abuseipdb[$i], 04) != '$Id:') {
                        if (
    is_integer(strpos($user_agent_abuseipdbtrim($spiders_abuseipdb[$i])))) {
                            
    $spider_flag_abuseipdb true;
                            break;
                        }
                    }
                }
            }
            return 
    $spider_flag_abuseipdb;
        }
        return 
    false
    Although the current solution successfully resolves the logging problem, I am interested in understanding why using the original $spider_flag variable did not produce the expected outcome. If anyone has any insights, suggestions, or guidance that could be a potential resolution that would allow me to revert back to using the $spider_flag in the future, please do let me know!

    Thank you for your time and assistance.
    Testing here, and it's working really well with the new spiders detection code. Saving a lot of API calls on my site. Also, I've set my threshold at 30% as most of my customers score a 0 threat score, so I'm currently blocking about 10% of hits to the server. I've gone through the logs manually checking bad IPs and there are some real nasty ones in there. This plugin will save a lot of server resources and turn away some of the worst bad bots & crawlers. Invaluable to small shop owners.

    Thank you for all the hard work :)

  5. #55
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,741
    Plugin Contributions
    11

    Default Re: AbuseIPDB Integration module

    Quote Originally Posted by johnjlarge View Post
    Testing here, and it's working really well with the new spiders detection code. Saving a lot of API calls on my site. Also, I've set my threshold at 30% as most of my customers score a 0 threat score, so I'm currently blocking about 10% of hits to the server. I've gone through the logs manually checking bad IPs and there are some real nasty ones in there. This plugin will save a lot of server resources and turn away some of the worst bad bots & crawlers. Invaluable to small shop owners.

    Thank you for all the hard work :)
    having recently implemented this plugin on a couple of sites, i can truly see its benefit.

    it is a GREAT addition to the zen-cart plugin repository.

    thanks to @marcopolo for this contribution!
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  6. #56
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    552
    Plugin Contributions
    3

    Default Re: AbuseIPDB Integration module

    Heya Marco,

    I just submitted a PR/Merge request to your Github repository for adding the Contributor Badge onto the admin dashboard to get a higher API daily limits. The changes aren't that serious, but I added a bit to the documentation and upped the version number. I have also submitted, what would now be, 2.1.2 to the ZC Plugins database.

    You can view my PR here:
    https://github.com/CcMarc/AbuseIPDB/pull/6

  7. #57
    Join Date
    May 2008
    Posts
    443
    Plugin Contributions
    1

    Default Re: AbuseIPDB Integration module

    Someone on GitHub requested a whos_online feature. I use an enhanced version of whos_online and am currently still on Zen Cart 1.5.5, so I'm not sure about compatibility with newer versions. However, if you'd like to try it, this enhanced version adds the following features directly within the whos_online screen:

    • Exclude IPs by AbuseIPDB Threshold: Automatically filter out IPs from the "Who's Online" list based on their AbuseIPDB score exceeding a set threshold.
    • Display AbuseIPDB Score: Show the AbuseIPDB score next to each IP address in the "Who's Online" list, indicating the level of potential abuse associated with the IP.
    • Shield Icon for Blocked IPs: Display a shield icon for IPs automatically blocked by the module, indicating they have met or exceeded the threshold.
    • Ban Icon for Manual Blacklisting: Provide a ban icon that allows administrators to manually blacklist an IP address, adding it to the blacklist file directly from the "Who's Online" interface.


    AbuseIPDB_whos_online.zip

  8. #58
    Join Date
    May 2008
    Posts
    443
    Plugin Contributions
    1

    Default Re: AbuseIPDB Integration module

    Here's the complete enhanced_whos_online_2.0 plugin with my modifications. There are some image files that go along with the original plugin, in case you're not currently using it and need those:

    AbuseIPDB_enhanced_whos_online_2.0.zip
    Last edited by marcopolo; 24 Aug 2024 at 11:21 PM.

 

 
Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. AbuseIPDB integration?
    By marcopolo in forum General Questions
    Replies: 3
    Last Post: 4 May 2022, 06:31 PM
  2. v155 Full Ebay Integration Module
    By Wilkesy in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 19 Jun 2020, 03:29 AM
  3. v156 PayCertify Payment Integration Module
    By PayCertify in forum Addon Payment Modules
    Replies: 1
    Last Post: 1 May 2019, 11:29 PM
  4. Mailchimp Module Integration
    By hamid380 in forum Addon Sideboxes
    Replies: 5
    Last Post: 7 Sep 2011, 01:11 PM
  5. Custom Shipping Module Integration
    By youderian in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 22 Dec 2008, 05:59 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