Hallo,
ich bin gerade am Verzweifeln.
Aktuell kämpfe ich an meinem Server mit massiven Scan-Attacken und versuche bestimmten IP-Adressen per pf den Zugang zu verweigern. Eine Adresse (hier die 172.245.177.162) scheint sich aber massiv zu weigern, sich an der Aussperrung zu halten.
Hier ein Auszug aus den Versuchen mit /etc/pf.conf:
Wie bekomme ich diese Flut an Request gestoppt bzw. wie muss ich meine pf.conf anpassen?
Könnte es an meiner pass ... http - Regel liegen?
Ich bin im Moment für jeden Hinweis dankbar...
Viele Grüße,
[KB]
ich bin gerade am Verzweifeln.
Aktuell kämpfe ich an meinem Server mit massiven Scan-Attacken und versuche bestimmten IP-Adressen per pf den Zugang zu verweigern. Eine Adresse (hier die 172.245.177.162) scheint sich aber massiv zu weigern, sich an der Aussperrung zu halten.
Hier ein Auszug aus den Versuchen mit /etc/pf.conf:
#------------------------------------------------------------------------
ext_if_lan = "em0"
# Private Netzwerke
ext_priv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
# Any host or range listed in this macro will be blocked.
badguys="{ 172.245.177.162 }"
# Regeln
#-------------------------------------------------------------------------
# Keine Rückmeldung bei Blockierungen
set block-policy drop
# Normalisierung
scrub in all
# Standardmäßig alles verbieten
#
block drop in log all
block drop out log all
# Wir wollen kein IPv6.0
block quick inet6
# über Loopback alles durchlassen
pass quick on lo0 all
# Blockiere den externen Verkehr mit privaten Adressen
block drop in log on $ext_if_lan from $ext_priv_nets to any
block drop out log on $ext_if_lan from any to $ext_priv_nets
# With logging ( chews up CPU during dDoS )
# block in log quick on $ext_if_lan from $badguys
# Without logging
block in quick on $ext_if_lan from $badguys
# sperre eine IP temporär
block drop in log quick on $ext_if_lan from 208.77.156.165 to any
block drop out log quick on $ext_if_lan from 208.77.156.165 to any
block drop in log quick on $ext_if_lan from 195.154.128.174 to any
block drop out log quick on $ext_if_lan from 195.154.128.174 to any
block drop in log quick on $ext_if_lan from 198.46.141.122 to any
block drop out log quick on $ext_if_lan from 198.46.141.122 to any
block drop in log quick on $ext_if_lan from 198.12.76.172 to any
block drop out log quick on $ext_if_lan from 198.12.76.172 to any
block drop in log quick on $ext_if_lan from 216.246.49.0/24 to any
block drop out log quick on $ext_if_lan from 216.246.49.0/24 to any
block drop in log quick on $ext_if_lan from 172.245.0.0/16 to any
block drop out log quick on $ext_if_lan from 172.245.0.0/16 to any
block drop in log quick on $ext_if_lan from 173.252.100.0/24 to any
block drop out log quick on $ext_if_lan from 173.252.100.0/24 to any
ext_if_lan = "em0"
# Private Netzwerke
ext_priv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
# Any host or range listed in this macro will be blocked.
badguys="{ 172.245.177.162 }"
# Regeln
#-------------------------------------------------------------------------
# Keine Rückmeldung bei Blockierungen
set block-policy drop
# Normalisierung
scrub in all
# Standardmäßig alles verbieten
#
block drop in log all
block drop out log all
# Wir wollen kein IPv6.0
block quick inet6
# über Loopback alles durchlassen
pass quick on lo0 all
# Blockiere den externen Verkehr mit privaten Adressen
block drop in log on $ext_if_lan from $ext_priv_nets to any
block drop out log on $ext_if_lan from any to $ext_priv_nets
# With logging ( chews up CPU during dDoS )
# block in log quick on $ext_if_lan from $badguys
# Without logging
block in quick on $ext_if_lan from $badguys
# sperre eine IP temporär
block drop in log quick on $ext_if_lan from 208.77.156.165 to any
block drop out log quick on $ext_if_lan from 208.77.156.165 to any
block drop in log quick on $ext_if_lan from 195.154.128.174 to any
block drop out log quick on $ext_if_lan from 195.154.128.174 to any
block drop in log quick on $ext_if_lan from 198.46.141.122 to any
block drop out log quick on $ext_if_lan from 198.46.141.122 to any
block drop in log quick on $ext_if_lan from 198.12.76.172 to any
block drop out log quick on $ext_if_lan from 198.12.76.172 to any
block drop in log quick on $ext_if_lan from 216.246.49.0/24 to any
block drop out log quick on $ext_if_lan from 216.246.49.0/24 to any
block drop in log quick on $ext_if_lan from 172.245.0.0/16 to any
block drop out log quick on $ext_if_lan from 172.245.0.0/16 to any
block drop in log quick on $ext_if_lan from 173.252.100.0/24 to any
block drop out log quick on $ext_if_lan from 173.252.100.0/24 to any
...
pass ...
...
pass in log on $ext_if_lan proto tcp from any to ($ext_if_lan) port http flags S/SA synproxy state (max 200, source-track rule, max-src-nodes 100, max-src-states 3)
...
Wie man sieht versuche ich hier auf zwei Wegen die entsprechende IP daran zu hindern, meinen Server lahm zu legen. Das Ergebnis: Hier mal einen Auszug nach Aufruf von "netstat -l -finet -n":pass ...
...
pass in log on $ext_if_lan proto tcp from any to ($ext_if_lan) port http flags S/SA synproxy state (max 200, source-track rule, max-src-nodes 100, max-src-states 3)
...
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37588 SYN_RCVD
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37313 LAST_ACK
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37162 CLOSE_WAIT
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37022 CLOSE_WAIT
tcp4 0 558 xx.xx.xx.xx.80 172.245.177.162.36538 LAST_ACK
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37588 SYN_RCVD
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37313 LAST_ACK
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37162 CLOSE_WAIT
tcp4 0 0 xx.xx.xx.xx.80 172.245.177.162.37022 CLOSE_WAIT
tcp4 0 558 xx.xx.xx.xx.80 172.245.177.162.36538 LAST_ACK
Wie bekomme ich diese Flut an Request gestoppt bzw. wie muss ich meine pf.conf anpassen?
Könnte es an meiner pass ... http - Regel liegen?
Ich bin im Moment für jeden Hinweis dankbar...
Viele Grüße,
[KB]