blocker 0.1Introduction"blocker" is a small awk script for blocking packets from malicious hosts. It blocks the IP addresses from which ssh connections are tried to be established with wrong authentication information several times.
RequirementsSystem requirements are the followings:
InstallCopy the script to /usr/sbin or somewhere you want to put in. Make a directory /var/tmp/blocker and put white_list in. UsageFilesblack_listThe black_list is a list of already blocked IP addresses. Each line of it consists of an IP address. No spaces or comments are allowed. The file is created automatically if there isn't. white_listThe white_list is a list of absolutely safe net addresses. Each line of it consists of an IP address or net address like 10.0.0.0/8. Execution
You may want to run it once and for ever. ModificationsThere is no configuration mechanism, and thus you have to modify by yourself if it is needed. Do it on your own risk. The script uses /var/tmp/blocker to put in the address list files. It is VAR_DIR in BEGIN clause of the script. The address list file names can be changed through BLACK_LIST and WHITE_LIST variables. The default behavior is that when more than 4 times failed attempts from the same host is detected then the host is blocked. The limit count 4 is configurable through the variable LIMIT. If you want to use more delicate policy to block, then you have to program it into awk rule/action's. LimitationsThere is no way to stop blocking a host with a valid user who sometimes fails to login incidentally. The recovery from the situation must be carried out by super users. LicenseThis script is distributed under BSD lisence. 最終更新 2005-07-28 15:00:32 |
blocker script |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© 2005-2007, Matsui Fe2+ Tetsushi