Portál AbcLinuxu, 10. května 2025 07:13
iptables
alebo nejako inak nastaviť čas medzi opakovaným pripojeniami cez ssh. Logy sú plné pokusov z rôznych adries. Najlepšie ak sa niekto pripojí povedzme 10x za minútu, tak si musí dať hodinu pauzu. Dá sa to?
limit This module matches at a limited rate using a token bucket filter. A rule using this extension will match until this limit is reached (unless the ‘!’ flag is used). It can be used in combination with the LOG target to give limited logging, for example. --limit rate Maximum average matching rate: specified as a number, with an optional ‘/second’, ‘/minute’, ‘/hour’, or ‘/day’ suffix; the default is 3/hour. --limit-burst number Maximum initial number of packets to match: this number gets recharged by one every time the limit specified above is not reached, up to this number; the default is 5.
# Retezec pro stanoveni limitu prichozich SYN konexi (ochrana pred SYN floods) # propusti pouze 4 SYN segmenty/sec $IPTABLES -N syn-flood $IPTABLES -F syn-flood $IPTABLES -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN $IPTABLES -A syn-flood -j DROP # Odfiltrovat pokusy o syn-flooding $IPTABLES -A INPUT -p tcp --syn --dport ssh -j syn-floodSamozřejmě si to musíš upravit podle sebe.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.