CSF - So begrenzen Sie die Anzahl der Verbindungen pro IP-Adresse

CSF - So begrenzen Sie die Anzahl der Verbindungen pro IP-Adresse

firewall

Aktualisieren Sie in der Konfigurationsdatei vonConfigServer Security & Firewall (CSF)den Wert vonCT_LIMIT, um die Anzahl der Verbindungen pro IP-Adresse zu begrenzen. This is a simple trick to prevent some types of Denial of Service (DOS) attack.

Note
Um den Denial-of-Service-Angriff (DoS) sofort zu stoppen, lesen Sie dieses Beispiel vonnull route.

1. /etc/csf/csf.conf

SSH in Ihren Server als root. Bearbeiten Sie die Datei/etc/csf/csf.conf.

Terminal

$ ssh root@yourserver #login as root

$ vim /etc/csf/csf.conf

2. CT_LIMIT

Suchen Sie nachCT_LIMIT und aktualisieren Sie es auf 150. Wenn die Gesamtzahl der Verbindungen zum Server mehr als 150 beträgt, wird die IP-Adresse blockiert. Sicherer Ausgang.

/etc/csf/csf.conf

###############################################################################
# SECTION:Connection Tracking
###############################################################################
# Connection Tracking. This option enables tracking of all connections from IP
# addresses to the server. If the total number of connections is greater than
# this value then the offending IP address is blocked. This can be used to help
# prevent some types of DOS attack.
#
# Care should be taken with this option. It's entirely possible that you will
# see false-positives. Some protocols can be connection hungry, e.g. FTP, IMAPD
# and HTTP so it could be quite easy to trigger, especially with a lot of
# closed connections in TIME_WAIT. However, for a server that is prone to DOS
# attacks this may be very useful. A reasonable setting for this option might
# be around 300.
#
# To disable this feature, set this to 0
CT_LIMIT = "150"

3. Starten Sie CSF neu

$ csf -r