Zen Cart Logo
Forums / All Other Contributions/Addons / AbuseIPDB Integration module

AbuseIPDB Integration module

Views: 22,005

Results 101 to 120 of 132
24 May 2025, 7:29 PM
#101
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

AbuseIPDB Integration module

marcopolo:

I’m exploring a possible new feature for the AbuseIPDB plugin to prevent bots from rapidly creating sessions in Zen Cart (e.g., 1000+ sessions in a short time), which can overload the server. I’ve seen this happen a few times—bots create thousands of sessions and cause major performance issues. Since Zen Cart’s session_start() in application_top.php runs before the plugin can intervene, we need to block these requests before session creation.

Goal:
Block session creation for IPs that exceed a rate threshold (e.g., 100 sessions in 1 minute), while allowing normal browsing patterns (e.g., 100 sessions over 30 minutes).

Proposed Approach:

Use an auto-loader or similar method to run a check before session_start() in application_top.php.

Track session rates per IP in TABLE_ABUSEIPDB_CACHE (session count and window start time).

Use a sliding window (e.g., 60 seconds): increment count per request, reset after window expires.

If the count exceeds the threshold, return a 403 Forbidden response and exit.

Alternative (Not Preferred):
Dynamically write deny rules to .htaccess to block IPs at the Apache level before PHP runs. We’d prefer to avoid this for compatibility with non-Apache servers.

This issue is rare but impactful, so we need to address it. I’d really appreciate input from anyone who’s tackled similar problems, or ideas on the cleanest and most portable way to intercept or throttle session creation before session_start() runs. Any advice on standard mechanisms, code examples, or pitfalls to watch out for would be greatly appreciated!

If there isn’t a clean way to accomplish this in the current Zen Cart architecture, I’d suggest considering it for a future version. It would be ideal if Zen Cart provided a standard pre-session hook or filtering mechanism—either in the core or through a well-documented extension point—so modules like AbuseIPDB (or others) can intercept and block abusive requests before sessions are created. This would make handling rate-limiting and abuse much more robust and portable going forward.

Thanks,
The problem, IMO, with the proposed approach is the requirement for the site's autoloading to occur as it requires database accesses to determine whether/not to shut down the request.

I realize the non-Apache risk with the alternative solution, but it's probably the best choice to shut down the unwanted accesses before additional server resources (i.e. database and file-system) are required.

For either approach, you could use an auto-loader and load your processing after breakpoint 50 (where the database connection is made and configuration settings read) and prior to breakpoint 70 (where the session is established).

25 May 2025, 12:00 AM
#102
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

lat9:

The problem, IMO, with the proposed approach is the requirement for the site's autoloading to occur as it requires database accesses to determine whether/not to shut down the request.

I realize the non-Apache risk with the alternative solution, but it's probably the best choice to shut down the unwanted accesses before additional server resources (i.e. database and file-system) are required.

For either approach, you could use an auto-loader and load your processing after breakpoint 50 (where the database connection is made and configuration settings read) and prior to breakpoint 70 (where the session is established).

Thanks for the feedback—much appreciated. I’ve decided to go with the .htaccess method for now to catch these before they hit the server resources. I agree, it’s the cleanest way in the current setup even if not fully portable.

25 May 2025, 12:12 AM
#103
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

New Release: AbuseIPDB v4.0.3

🚨 What’s New:

  • Advanced Session Rate Limiting: Protect your site from bots creating sessions too rapidly! IPs exceeding the threshold (default: 100 sessions in 60 seconds) are blocked via .htaccess and logged in logs/abuseipdb_session_blocks.log. Configure the threshold, time window, and reset period (default: 5 minutes) in the admin settings. Blocked IPs remain blocked until manually removed from .htaccess by the admin.

  • Enhanced Flood Tracking Reset: Building on v4.0.2, flood tracking now resets per type (2-octet, 3-octet, country, foreign) after the defined reset period, ensuring previously flagged IPs are recounted if they return later.

🚀 Visual Update (from v4.0.2):

  • Monitor threats effortlessly with color-coded shields in the Who's Online page, including new colors for flood blocks (teal for domestic, brown for foreign) and superscripts for 2F/3F floods.

📝 Notes:

  • Session rate limiting is designed for Apache2 servers, as it uses .htaccess to block IPs. For non-Apache servers (e.g., Nginx), you’ll need to implement alternative rate-limiting solutions.
  • Ensure your .htaccess file is writable (e.g., chmod 664 .htaccess and chmod 775 for the directory) for session rate limiting to work.
  • The session rate limiting log (abuseipdb_session_blocks.log) is generated regardless of the general logging setting, so you can always review blocked IPs.

Download the latest version and check out the full details on GitHub!

25 May 2025, 11:15 PM
#104
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

New Release: AbuseIPDB v4.0.5

🚨 What’s New:

v4.0.5: Updated admin dashboard widget to display Session Rate Limiting blocks in .htaccess for easy admin visibility when they occur.

v4.0.4: Bug Fix - resolved country code population bug and removed duplicate config setting in installer.

Download the latest version and check out the full details on GitHub!

1 Jun 2025, 1:18 PM
#105
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

New Release: AbuseIPDB v4.0.6

🚨 What’s New:

v4.0.6: Improved session rate limiting by using a new abuseipdb_actions table to queue IPs for blocking, reducing .htaccess write delays and preventing duplicate log entries.

Download the latest version and check out the full details on GitHub!

24 Jul 2025, 7:57 PM
#106
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

hello there,
Thanks for this module, you recommended. I get the following error log from whos online:-

Table '****_zen.zen_abuseipdb_cache' doesn't exist'

I renamed the four databases and put zen_ in front, that error goes and whos online works. Just wondering, if I did right doing the other three tables the same? Thanks :-)

EDIT I renamed back as it seems to stop the site working, so I turned off abuseipdb for now. On 4.06 version. I think I am not the norm in having zen_ prefix, which I have had this issue before actually.

24 Jul 2025, 10:09 PM
#107
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

HeathenMagic:

hello there,
Thanks for this module, you recommended. I get the following error log from whos online:-

Table '****_zen.zen_abuseipdb_cache' doesn't exist'

I renamed the four databases and put zen_ in front, that error goes and whos online works. Just wondering, if I did right doing the other three tables the same? Thanks :-)

EDIT I renamed back as it seems to stop the site working, so I turned off abuseipdb for now. On 4.06 version. I think I am not the norm in having zen_ prefix, which I have had this issue before actually.

I've just released v4.0.8, which adds full support for Zen Cart table prefixes via the DB_PREFIX constant. You no longer need to rename any database tables manually — in fact, doing so will cause the module to break.

To fix the issue:

Revert the following database tables back to their original names — or simply delete them. The installer will automatically recreate them during the upgrade:

abuseipdb_cache
abuseipdb_flood
abuseipdb_maintenance
abuseipdb_actions

Download and install the updated v4.0.8 module (available on GitHub - Download v4.0.8).

The module now automatically adapts to your store’s prefix settings, and the “table doesn’t exist” error should be fully resolved.

Let me know if you run into anything else — I appreciate the feedback!

24 Jul 2025, 11:21 PM
#108
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

marcopolo:

I've just released v4.0.8, which adds full support for Zen Cart table prefixes via the DB_PREFIX constant. You no longer need to rename any database tables manually — in fact, doing so will cause the module to break.

To fix the issue:

Revert the following database tables back to their original names — or simply delete them. The installer will automatically recreate them during the upgrade:

abuseipdb_cache
abuseipdb_flood
abuseipdb_maintenance
abuseipdb_actions

Download and install the updated v4.0.8 module (available on GitHub - Download v4.0.8).

The module now automatically adapts to your store’s prefix settings, and the “table doesn’t exist” error should be fully resolved.

Let me know if you run into anything else — I appreciate the feedback!

Thanks for the update. I deleted the tables first, uninstalled, then installed 4.0.8 via plugin manager. Unfortunately, I still get a similar error:-

PHP Fatal error: MySQL error 1146: Table '****.zen_abuseipdb_actions' doesn't exist :: SELECT ip FROM zen_abuseipdb_actions ==> (as called by) /zc_plugins/AbuseIPDB/v4.0.8/catalog/includes/classes/observers/abuseipdb_observer.php on line 92 <== in /includes/classes/db/mysql/query_factory.php on line 733.

Maybe it is my setup? The tables are without prefix, I can see 4. They are at top of list as they are alphabetically first. Hope this helps.

24 Jul 2025, 11:45 PM
#109
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

HeathenMagic:

Thanks for the update. I deleted the tables first, uninstalled, then installed 4.0.8 via plugin manager. Unfortunately, I still get a similar error:-

Maybe it is my setup? The tables are without prefix, I can see 4. They are at top of list as they are alphabetically first. Hope this helps.

I've updated the installer — I had missed a section.
Please re-download the latest ZIP for v4.0.8 — the fix is included now. Let me know if anything else comes up!

25 Jul 2025, 12:46 AM
#110
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

marcopolo:

I've updated the installer — I had missed a section.
Please re-download the latest ZIP for v4.0.8 — the fix is included now. Let me know if anything else comes up!

To fix the issue:

First, uninstall the current AbuseIPDB plugin.

Then re-download the latest ZIP for v4.0.8 — the fix is included now. (I had missed a section)

The new installer will automatically create the correct tables using your database prefix.

You can safely delete the old tables (the ones without the prefix), as they are no longer used if they are still there.

25 Jul 2025, 7:25 AM
#111
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

marcopolo:

To fix the issue:

First, uninstall the current AbuseIPDB plugin.

Then re-download the latest ZIP for v4.0.8 — the fix is included now. (I had missed a section)

The new installer will automatically create the correct tables using your database prefix.

You can safely delete the old tables (the ones without the prefix), as they are no longer used if they are still there.

Thats great! I can confirm it is all working perfectly. I have enabled most of the settings that I understand, octet, flood, and session rate limiting. I think the module doesn't automatically block the IP, I refer to whos online and add to the blacklist text file? I have started doing that, and enabled the blacklist execution anyway.

25 Jul 2025, 10:46 AM
#112
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

HeathenMagic:

Thats great! I can confirm it is all working perfectly. I have enabled most of the settings that I understand, octet, flood, and session rate limiting. I think the module doesn't automatically block the IP, I refer to whos online and add to the blacklist text file? I have started doing that, and enabled the blacklist execution anyway.

Great to hear it’s working now!

The module does automatically block IPs when their AbuseIPDB confidence score exceeds the threshold you’ve configured — no need to manually blacklist them. That part is handled in real time.

As for the features you enabled:

Octet blocking looks for too many hits from the same IP range (e.g. 123.45.67.*) and can block the entire subnet if abuse is detected.

Flood control has multiple layers — depending on which option is enabled, it can detect surges from foreign countries or large volume from specific subnets.

Session rate limiting watches for how quickly new sessions are created and blocks IPs exceeding the limit.

Each setting has its own logic and threshold — and the README walks through all of them in detail. Give it a look when you can.

27 Jul 2025, 12:06 PM
#113
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

marcopolo:

Great to hear it’s working now!

The module does automatically block IPs when their AbuseIPDB confidence score exceeds the threshold you’ve configured — no need to manually blacklist them. That part is handled in real time.

As for the features you enabled:

Octet blocking looks for too many hits from the same IP range (e.g. 123.45.67.*) and can block the entire subnet if abuse is detected.

Flood control has multiple layers — depending on which option is enabled, it can detect surges from foreign countries or large volume from specific subnets.

Session rate limiting watches for how quickly new sessions are created and blocks IPs exceeding the limit.

Each setting has its own logic and threshold — and the README walks through all of them in detail. Give it a look when you can.

Thanks a lot for that! And for the concise point on its features. I have referred to the readme previously, I overlooked the point that I can lower threshold to auto-block. I think I will lower to 40 instead of 50, that might cut a lot more bad bots out. Great module once again!

29 Jul 2025, 10:33 AM
#114
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

Think they must have targetted me this morning as seems 5000 request daily limit already reached! I reckon the previous blocked is tied to Abuse account so it can't retrospectively block those again. I only added one ip to that blacklist file (on top htaccess rules and IP blocked ranges on server).

29 Jul 2025, 11:52 AM
#115
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

HeathenMagic:

Think they must have targetted me this morning as seems 5000 request daily limit already reached! I reckon the previous blocked is tied to Abuse account so it can't retrospectively block those again. I only added one ip to that blacklist file (on top htaccess rules and IP blocked ranges on server).

Yes, it can block those same IPs again — but only if they return after their cache entry expires. By default, the plugin caches each IP’s AbuseIPDB score for 1 day (86400 seconds) under the Cache Time setting. That means once an IP is checked, its score is stored locally and reused until that cache expires — avoiding repeat API calls, but also meaning the system won’t recheck or re-block the same IP until that cache period ends.

If you're seeing a spike in abuse, you can temporarily increase the cache time (to 2–3 days, for example).
172800 = 2 days or 259200 = 3 days

That way:

  • Previously flagged IPs stay blocked longer, even without another API call
  • You conserve your daily quota (5,000 requests) during surges
  • Protection stays active while usage stays within limits

Also, enabling extended caching (High Score Cache Extension) for IPs over a threshold (default score: 100) can stretch cache time even further (defaults to 7 days or longer whatever you set it too via Extended Cache Time).

I’ve seen a huge uptick in bot traffic lately, especially from IPs returning very low or even 0 scores from AbuseIPDB. Something definitely seems to be going on across multiple shops. You’re not the only one running into this pattern.

29 Jul 2025, 2:39 PM
#116
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

marcopolo:

Yes, it can block those same IPs again — but only if they return after their cache entry expires. By default, the plugin caches each IP’s AbuseIPDB score for 1 day (86400 seconds) under the Cache Time setting. That means once an IP is checked, its score is stored locally and reused until that cache expires — avoiding repeat API calls, but also meaning the system won’t recheck or re-block the same IP until that cache period ends.

If you're seeing a spike in abuse, you can temporarily increase the cache time (to 2–3 days, for example).
172800 = 2 days or 259200 = 3 days

That way:

  • Previously flagged IPs stay blocked longer, even without another API call
  • You conserve your daily quota (5,000 requests) during surges
  • Protection stays active while usage stays within limits

Also, enabling extended caching (High Score Cache Extension) for IPs over a threshold (default score: 100) can stretch cache time even further (defaults to 7 days or longer whatever you set it too via Extended Cache Time).

I’ve seen a huge uptick in bot traffic lately, especially from IPs returning very low or even 0 scores from AbuseIPDB. Something definitely seems to be going on across multiple shops. You’re not the only one running into this pattern.

Thanks for your reply, and I have took action on one of your tips so far. Just looking into the other one. Apparently I had 60000 connections in two hours! Which tallies with the logs around that duration. I'd turned off session rate limiting so turned it back on again. Was investigating a session related bug.
So its not just me then....... I know another business they block Sinagpore and China, as recommended by their server people. But the former can have customers from there. Yes its definitely not something I have had to tackle this viciously before.

29 Jul 2025, 2:52 PM
#117
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

Server is offering to do blanket ban on subnet, but the excerpt they showed me, some are google and microsoft bots. They check out genuine, in similar range. Perhaps the rest of excerpt are the bad ones. Another few were another search engine bot. Seems strange...... I will see what other ip address ranges they found, don't want to block the good ones.

31 Jul 2025, 8:18 AM
#118
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

I just wondered, I am doing the country ban using the setting in Abuseipdb. If I do that at .htaccess / server level, that would reduce lookups and stop daily exhaustion of 5000 allocated lookups I think? I am getting about 8 countries I never send to, with repeated spam bots that are showing up as bad bots on the tools I use.

31 Jul 2025, 2:46 PM
#119
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
520
Plugin Contributions:
2

Re: AbuseIPDB Integration module

HeathenMagic:

I just wondered, I am doing the country ban using the setting in Abuseipdb. If I do that at .htaccess / server level, that would reduce lookups and stop daily exhaustion of 5000 allocated lookups I think? I am getting about 8 countries I never send to, with repeated spam bots that are showing up as bad bots on the tools I use.

That kind of blocking is outside this module not sure how that would be done exactly in .htaccess.

When you say country ban remember there tare two one is "Enable Country Flood Detection?" I wouldn't recommend using that one unless you really have to, since it can block IPs from within your own country (which is set in the module settings).

Instead, you can use "Enable Foreign Flood Detection?", which specifically targets traffic from outside your default country and is much safer in most cases.

Also worth noting — AbuseIPDB does offer paid tiers that increase your daily API limit. The first paid tier bumps you up to 10,000 lookups per day, and I believe the next one is 50,000 — you’ll want to check their pricing page for the latest details.

31 Jul 2025, 5:59 PM
#120
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: AbuseIPDB Integration module

marcopolo:

That kind of blocking is outside this module not sure how that would be done exactly in .htaccess.

When you say country ban remember there tare two one is "Enable Country Flood Detection?" I wouldn't recommend using that one unless you really have to, since it can block IPs from within your own country (which is set in the module settings).

Instead, you can use "Enable Foreign Flood Detection?", which specifically targets traffic from outside your default country and is much safer in most cases.

Also worth noting — AbuseIPDB does offer paid tiers that increase your daily API limit. The first paid tier bumps you up to 10,000 lookups per day, and I believe the next one is 50,000 — you’ll want to check their pricing page for the latest details.

I tried some code for blocking countries, apparently its legit but nothing is ever easy and it still seems to be letting them through. Asking server people if they need to do anything else (the module for it was enabled).

Oops! I switched that off right now, thanks for the tip! I have been testing from a few different ips for testing from GB. But best to follow your advice. I have foreign flood set to True. And noticed a lot of activity that way.

Yes I am considering the first tier to see if that makes it more helpful. I am at 5000 limit, it looks like country specific attacks is the main thing right now. Not sure if your experience with your webstores tallies with that.