From 674a96431b0d9cc595d8f23ed1575e0c39f6bb6d Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 15 Jul 2016 14:09:29 -0700 Subject: [PATCH] Improve nick-change evasion detection logic --- PBot/AntiFlood.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index a3d52697..2800aa3b 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -860,9 +860,11 @@ sub check_bans { return; } - if (exists $self->{nickflood}->{$message_account} and $baninfo->{type} ne 'blacklist') { - $self->{pbot}->{logger}->log("anti-flood: [check-bans] $mask evading nick-flood ban, disregarding\n"); - return; + if (exists $self->{nickflood}->{$message_account} and $self->{nickflood}->{$message_account}->{offenses} > 0 and $baninfo->{type} ne 'blacklist') { + if (gettimeofday - $self->{nickflood}->{$message_account}->{timestamp} < 60 * 15) { + $self->{pbot}->{logger}->log("anti-flood: [check-bans] $mask evading nick-flood ban, disregarding\n"); + return; + } } if ($baninfo->{type} eq 'blacklist') {