2014-09-23 20:05:31,146 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (10 # 5 days, 8:04:55 -> 2014-09-29 04:10:24) 2014-09-23 20:05:31,120 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-23 20:20:29) 2014-09-23 15:30:32,625 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-20 23:24:14,620 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (9 # 2 days, 16:06:18 -> 2014-09-23 15:30:31) 2014-09-20 23:24:14,569 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-20 23:39:13) 2014-09-20 21:10:36,708 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-19 13:03:03,377 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (8 # 1 day, 8:07:34 -> 2014-09-20 21:10:36) 2014-09-19 13:03:03,361 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-19 13:18:02) 2014-09-19 12:38:17,743 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-18 20:13:23,647 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (7 # 16:24:55 -> 2014-09-19 12:38:17) 2014-09-18 20:13:23,620 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-18 20:28:22) 2014-09-18 20:07:06,053 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-18 12:03:53,282 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (6 # 8:03:14 -> 2014-09-18 20:07:05) 2014-09-18 12:03:53,266 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-18 12:18:51) 2014-09-18 11:22:40,704 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-18 07:11:12,200 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (5 # 4:09:43 -> 2014-09-18 11:20:54) 2014-09-18 07:11:12,160 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-18 07:26:11) 2014-09-18 06:47:46,618 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-18 04:37:29,972 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (4 # 2:02:16 -> 2014-09-18 06:39:44) 2014-09-18 04:37:29,967 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-18 04:52:28) 2014-09-18 04:32:49,491 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-18 02:55:05,706 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (3 # 1:23:31 -> 2014-09-18 04:18:35) 2014-09-18 02:55:05,698 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-18 03:10:04) 2014-09-18 01:18:37,976 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-18 00:40:09,592 fail2ban.observer [named-refused] Increase Ban XXX.XXX.XX.XXX (2 # 0:38:30 -> 2014-09-18 01:18:37) 2014-09-18 00:40:09,548 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-18 00:55:07) 2014-09-17 22:47:05,872 fail2ban.actions [named-refused] Unban XXX.XXX.XX.XXX 2014-09-17 22:32:05,804 fail2ban.actions [named-refused] Ban XXX.XXX.XX.XXX (_ # 0:15:00 -> 2014-09-17 22:47:05)
2014-09-18 04:37:29,155 fail2ban.observer [named-refused] Found XXX.XXX.XX.XXX, bad - 2014-09-18 04:37:28, 3 # -> 5, Ban 2014-09-18 04:37:29,148 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-18 04:37:28 ...... 2014-09-18 02:55:04,790 fail2ban.observer [named-refused] Found XXX.XXX.XX.XXX, bad - 2014-09-18 02:55:04, 2 # -> 3, Ban 2014-09-18 02:55:04,763 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-18 02:55:04 2014-09-18 02:22:37,683 fail2ban.observer [named-refused] Found XXX.XXX.XX.XXX, bad - 2014-09-18 02:22:37, 2 # -> 3 2014-09-18 02:22:37,648 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-18 02:22:37 ...... 2014-09-18 00:40:08,908 fail2ban.observer [named-refused] Found XXX.XXX.XX.XXX, bad - 2014-09-18 00:40:08, 1 # -> 2, Ban 2014-09-18 00:40:08,625 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-18 00:40:08 2014-09-17 23:48:54,404 fail2ban.observer [named-refused] Found XXX.XXX.XX.XXX, bad - 2014-09-17 23:48:53, 1 # -> 2 2014-09-17 23:48:54,397 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 23:48:53 2014-09-17 22:49:04,647 fail2ban.observer [named-refused] Found XXX.XXX.XX.XXX, bad - 2014-09-17 22:49:03, 1 # -> 2 2014-09-17 22:49:04,620 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 22:49:03 ...... 2014-09-17 22:32:05,593 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 22:32:05 2014-09-17 22:06:29,952 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 22:06:29 2014-09-17 21:47:43,439 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 21:47:42 2014-09-17 20:43:41,490 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 20:43:40 2014-09-17 16:44:35,130 fail2ban.filter [named-refused] Found XXX.XXX.XX.XXX - 2014-09-17 16:44:34
sudo service fail2ban stop sudo apt-get remove fail2ban
cd /tmp unzip ~/downloads/fail2ban-ban-time-incr.zip cd fail2ban-ban-time-incr/ sudo python setup.py install
/etc/init.d/fail2ban
file) - and accordingly the service does not (auto) start, only through fail2ban-client start
. cd /tmp/fail2ban-ban-time-incr-debian sudo cp /etc/init.d/fail2ban ~/init.fail2ban.org sudo cp ./files/debian-initd /etc/init.d/fail2ban chmod u+x,g+x,o+x /etc/init.d/fail2ban
And check inside the path to fail2ban-client ( which fail2ban-client
):/usr/local/bin/fail2ban-client
- DAEMON=/usr/local/bin/$NAME-client
/usr/bin/fail2ban-client
- DAEMON=/usr/bin/$NAME-client
bantime.increment = true
. An example and description can still be found in " jail.conf ".bantime.rndtime
is the maximum time used to add random time to banTime
to prevent smart botnets from calculating the exact time when the IP is unlocked again. Example bantime.rndtime = 10m
bantime.factor
- coefficient for calculating the growth exponent for the formula bantime.formula
or multipliers bantime.multipliers
, the default value of the coefficient is 1, which corresponds to an increase in the ban time for 1, 2, 4, 8, 16 ... By increasing this parameter for some jail, increase blocking time more aggressively.bantime.formula
- used by default to calculate the next value of the ban time, the default value: bantime.formula = ban.Time * (1<<(ban.Count if ban.Count<20 else 20)) * banFactor
bantime.multipliers
equal to 1, 2, 4, 8, 16, 32 ...bantime.formula = ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)
bantime.multipliers
- the parameter can be used instead of the formula discretely to calculate the next value of the time of the ban. The value of the multiplier is "-1" (can only be at the end of the list) and puts the address in a permanent ban (before manual unlocking).bantime.multipliers = 1 2 4 8 16 32 64
- increases the ban time by 1, 2, 4, ... and if the last ban count was more than the last multiplier index, the last multiplier will always be used (64 in the example), which with a factor equal to "1" and the original time of the ban (10 minutes) - corresponds to 10.6 hours.bantime.multipliers = 1 5 30 60 300 720 1440 2880
- can be used for a small initial ban time (bantime = 60) - because the increase becomes more aggressive, we have bantime equal: 1 min, 5 min, 30 min, 1 hour, 5 hours, 12 hours, 1 day, 2 days, respectively. fail2ban-client set $JAIL unbanip $IP
logger -t 'test:auth' -i -p auth.info "pam_unix(test:auth): authentication failure; logname= uid=0 euid=0 tty=test ruser=admin rhost=1.2.3.4"
sudo service fail2ban start
Source: https://habr.com/ru/post/238303/
All Articles