This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DNAT and IP-Filter do not block traffic

Hi there,

today I really had to block traffic coming from a specific IP going to my UTM 9.705-3 trying massive IPSEC logins. 

Adding a firewall rule at #1 position did not work so I added a DNAT-rule to NAT all traffic coming from this IP going to my UTM to 240.x.x.x. and placed it on top of all NAT-rules.

But my IPSEC-log shows me that I am still flooded by this IP.

How can I protect my network when everything is passing my rules?

Thank you -

Chris

PS: 

And: why does an "iptables - L | grep IP-address" does not show my filter rule?



This thread was automatically locked due to age.
  • OK, Chris, let's look at the Edits of the IPsec Connection and Remote Gateway with 'Advanced' open.

    I've never seen Alice in an IPsec log - what is the other endpoint?

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Thanks 

    but I don´t think that these packets have anything to do with our site-to-site connections (although there are running some fine on the same gateway) thats why the answer to your question is not so relevant I guess. The site-to-site sessions do look very clear.

    These requests are going to the endpoint for our roadwarriors, either plain IPSEC or L2TP.

    Thats why I cannot block them all beacuse I could never know where my roadwarriors do come from.
    Now I killed again 5 of these connections - and for 10min everything is quiet...as it was in former times most of the days...

    Cheers, Chris

  • And one update:

    I can really confirm that I do DNAT the right way because when I add an IP to DNAT-list to 240.0.0.1 and kill immediately via conntrack the last lines look like this:

    udp      17 27 src=5.101.38.130 dst=x.x.x.x sport=19545 dport=500 packets=1 bytes=45 [UNREPLIED] src=240.0.0.1 dst=5.101.38.130 sport=500 dport=19545 packets=0 bytes=0 mark=1572864 delta-time=2 use=1

    conntrack v1.4.2 (conntrack-tools): 71 flow entries have been deleted.

  • What does Sophos Support say about this, Chris?

    Do you have the same problem if you use X509 certs instead of preshared keys?

    Instead of IPsec or IPsec/L2TP, I've been configuring SSL VPN Remote Access on UDP 443 or 1443.  The OpenVPN clients work well where the Sophos Client can't work.

    In any case, this isn't a fun or interesting battle for you.

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I have the same question. Need to block a full /24 brazil network that is spamming on our SG IPSec interface. DNAT and FW rules do not apply to this traffic.

    UTM should automatically block hosts that have more than a definded No of bad requests per minute.

    2021:03:11-15:25:59 fw-320-1 pluto[7019]: packet from 45.5.38.162:20640: not enough room in input packet for ISAKMP Message
    2021:03:11-15:25:59 fw-320-1 pluto[7019]: packet from 45.5.38.162:20640: sending notification PAYLOAD_MALFORMED to 45.5.38.162:20640
    2021:03:11-15:25:59 fw-320-1 pluto[7019]: packet from 45.5.38.199:39527: not enough room in input packet for ISAKMP Message
    2021:03:11-15:25:59 fw-320-1 pluto[7019]: packet from 45.5.38.199:39527: sending notification PAYLOAD_MALFORMED to 45.5.38.199:39527
    2021:03:11-15:26:00 fw-320-1 pluto[7019]: packet from 45.5.38.190:23302: not enough room in input packet for ISAKMP Message
    2021:03:11-15:26:00 fw-320-1 pluto[7019]: packet from 45.5.38.190:23302: sending notification PAYLOAD_MALFORMED to 45.5.38.190:23302
    2021:03:11-15:26:00 fw-320-1 pluto[7019]: packet from 45.5.38.214:20903: not enough room in input packet for ISAKMP Message
    2021:03:11-15:26:00 fw-320-1 pluto[7019]: packet from 45.5.38.214:20903: sending notification PAYLOAD_MALFORMED to 45.5.38.214:20903
    2021:03:11-15:26:00 fw-320-1 pluto[7019]: packet from 45.5.38.176:48768: not enough room in input packet for ISAKMP Message
    2021:03:11-15:26:00 fw-320-1 pluto[7019]: packet from 45.5.38.176:48768: sending notification PAYLOAD_MALFORMED to 45.5.38.176:48768
    2021:03:11-15:26:01 fw-320-1 pluto[7019]: packet from 45.5.38.205:20741: not enough room in input packet for ISAKMP Message
  • Hi LHerzog

    You have to create a DNAT roule AND Kill the Connections at the Firewall-Console (SSH) with e.g. "conntrack -D -s 45.5.38.176".
    Also, you need to do this for each IP Address in that /24 Network, i'm normaly using Excel to generate an IP List from 45.5.38.1 - 45.5.38.255 and then paste the Lines to CLI.

    Regards,

    Michael

  • Mi Michael,

    but I will only kill existing connections with conntrack, right? So no way to keep them out permanently?

  • You will kill only existing Connections, but the DNAT rule will prevent new Connections.

  • Hi LHerzog,

    If you cannot switch on country blocking you have to create a DNAT-rule for IPs / IP-Range that do penetrate your gateway.

    After that you can kill them with conntrack and they are blocked.

    But meanwhile we have a second costumer with an UTM being flooded with probes on port 500 and we are still targeted, too.

    As said: "this isn't a fun or interesting battle".

    But during that hafnium armageddon I have no time to change auth methods for all users in their home offices...

    Cheers - Chris

  • and what would be the solution Sophos suggests in case you are really - i mean really - flooded with many of those packets?

    Why is SG even answering to bad requests with IPSec notification replies?

    2021:03:11-18:20:46 fw-320-1 pluto[7019]: packet from 74.57.197.252:80: not enough room in input packet for ISAKMP Message
    2021:03:11-18:20:46 fw-320-1 pluto[7019]: packet from 74.57.197.252:80: sending notification PAYLOAD_MALFORMED to 74.57.197.252:80
    2021:03:11-18:20:46 fw-320-1 pluto[7019]: packet from 74.57.197.252:80: not enough room in input packet for ISAKMP Message
    2021:03:11-18:20:46 fw-320-1 pluto[7019]: packet from 74.57.197.252:80: sending notification PAYLOAD_MALFORMED to 74.57.197.252:80
    2021:03:11-18:20:46 fw-320-1 pluto[7019]: packet from 74.57.197.252:80: not enough room in input packet for ISAKMP Message

    now even Microsoft IPs are causing these logs - using ports known from VoIP or video conferencing.
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: sending notification PAYLOAD_MALFORMED to 52.113.53.8:3480
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: not enough room in input packet for ISAKMP Message
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: sending notification PAYLOAD_MALFORMED to 52.113.53.8:3480
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: not enough room in input packet for ISAKMP Message
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: sending notification PAYLOAD_MALFORMED to 52.113.53.8:3480
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: not enough room in input packet for ISAKMP Message
    2021:03:11-18:37:57 fw-320-1 pluto[7019]: packet from 52.113.53.8:3480: sending notification PAYLOAD_MALFORMED to 52.113.53.8:3480