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.
Parents
  • 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

  • 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
  • Good question - please ask Sophos. If I had time I would have done already but these days I wish I had 8 arms like an octopus...

  • FormerMember
    0 FormerMember in reply to Chris69

    You may also try to set up 1 blackhole DNAT rule to drop all the IPsec connections and then create a new DNAT on top of it to allow IPsec connections from required source IPs(Branch/Client location).

    Attaching few snapshots for reference.

    ==> Create 2 service definitions for TCP/UDP port 500 and port 4500

    ==> Use default IPsec service group and add above service definitions to it.



    ==> Create availability group under network definitions with allowed source IPs for IPsec connections. Add all remote location source IP to it.



    ==> Create 2 DNAT rules as shown below.



    ==> By configuring this you'll not have to add a single IPsec flooded IP in blackhole DNAT to drop its connection.

    Let me know if you've any queries.

  • looks interesting. will try that.

  • Hi Yash,

    this is not a real opportunity for remote access IPSEC because I cannot predict any random IP my roadwarriors might get by their ISPs.

    It would be way more useful to allow the following setting on the UTM:

    In "normal" mode:

    Pluto should not answer to such malformed requests and wrong PSK - pluto should simply drop these attempts for not giving the aggressor an answer that he can try the next one.

    In "debug" mode

    When I have to debug sessions I should be able to switch on answering & logging

    Cheers - Chris

  • That's true. in our case there is only static IPSec for Site-2-Site but in a case where IPSec is used for User VPN this is a no-go.

    There are many approaches out there to automatically ban IPs that exceed a no of bad packets or connection attempts. Sophos is using these techniques only for bad logons. Thats a lack of security.

  • Guys, you've heard me say it before: best practice for IPsec and L2TP/IPsec remote access is to use X509 certs instead of PSKs.

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Would this change the behaviour of SG replying to malformed requests?

  • I don't think the "conversation" would ever get that far if using X509 certs.

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I am suffering with the exact same log entries. Sometimes the attacker will use the entire subnet of 255 IP's during the attempt to make an IPSec connection.  I opened a case with Sophos and they said they cannot block/deny these unwanted log entries.

    Doing the Blackhole scenario seems never ending and the whitelist approach is a bit tricky as I have 100+ VPN entries including allowed subnets.  The question I have is WHY do they do it ?  Just to get a reply back saying "sending notification PAYLOAD_MALFORMED to 94.x.x.x" so they know they hit a firewall to later attack ??

    What a waste of time !

Reply
  • I am suffering with the exact same log entries. Sometimes the attacker will use the entire subnet of 255 IP's during the attempt to make an IPSec connection.  I opened a case with Sophos and they said they cannot block/deny these unwanted log entries.

    Doing the Blackhole scenario seems never ending and the whitelist approach is a bit tricky as I have 100+ VPN entries including allowed subnets.  The question I have is WHY do they do it ?  Just to get a reply back saying "sending notification PAYLOAD_MALFORMED to 94.x.x.x" so they know they hit a firewall to later attack ??

    What a waste of time !

Children
No Data