I am attempting to use SYNPROXY to protect my mail server from an ongoing SYN Flood attack. The mail server is on my green network for which I have generated this port forwarding rule:
I am generally interested in this, but I do not follow entirely where this is going wrong.
So you want IPFire to not forward those TCP connections just yet, but rather have it establish it first and then forward it to the internal mail server. Makes sense.
Did you run these commands exactly like this? IPFire has many things in those INPUT/PREROUTING chains which should always be processed first.
The last command is just a port forwarding rule (or half of it).
In my (ongoing) SYN Flood attack my server is being sent SYN packets with a spoofed source address which obviously donât get the SYN-ACK reply because they are being sent from a foreign address. I have been getting up to 70,000 of these per day and have managed to block them with iptables so far but now the spoofed address are from /17 net blocks and the block list has become unmanageable.
I have enabled SYNPROXY on my debian server which is blocking the unreplied connection attempts at the server but since I am port forwarding from my firewall the connections are still being made to IPFire first. If I can enable synproxy in IPFire the bogus connections should be rejected at the firewall.
but this failed to forward any genuine smtp packets through the firewall when I applied the above commands to IPFire although I did confirm that synproxy was enabled OK.
I am pretty sure that the problem is caused by a conntrack / nat conflict as advised here:
but I am not sure how the rules in this article should be applied to IPFire.
I am fairly confident that if suitable INPUT/PREROUTING can be applied it should work OK.
If you have any ideas, I would be more than happy to test them here.
Hi all,
IPFires firewall WUI do have the âRate-Limit new Connectionsâ which is also outlined as useful in the wiki --> https://wiki.ipfire.org/configuration/firewall/rules for Syn-Flood attacks. May âConcurrent-Connectionsâ can also serves some protection ?
I have Rate-Limit new Connections set to 2 per second but at last count I still had over 100 âSYNâ SMTP connections to IPFire. Itâs a difficult setting to get right because I donât want to prejudice legitimate mail.
I need an automated way of blocking connections and have had some success with FAIL2BAN running on the server but that is only really effective when they are targetting specific IPs but it isnât very useful when they are cycling IPs around a netblock . I have also had some success with âBanishâ which I ported over from IPCop and can block netblocks with iptables but entries need to be manually added.
SYNPROXY running on the server is doing a good job of rejecting the flood from the server but would be much better if I could get it to work on IPFire.
Ah okay. That would have helped us to prioritise this topic.
From what it looks like, the IPFire kernel has everything we need enabled, but it will be slightly tricky to get it into the firewall scripts and avoid any interference with other things.
That was my impression and as I said above it looks like synproxy is working OK when enabled, it looks like just not playing very nice with port forwarding.
I would be very pleased if I can help in any way if I can.
Incidently synproxy is an option from the gui in pfSense although I have never used it.
Rob
Yes, that pretty much sums it up what has to be done. However, IPFire has a hundred other features here which mark packets for NAT and other things and we need to take care of them.
It is not super-major work, but it will be at least half a day and of course needs to be added to the UI.
Thank you for this Michael, although for me I have been somewhat overtaken by events. I had some good results from fail2ban on my mail server with a âSYNPROXYâ jail which detected the synflood packets and added an iptables rule to the CUSTOMFORWARD chain which blocked the incoming address.
Although my fail2ban jail is still active I havenât detected and âhitsâ since the end of 2021. This maybe due to other blocking techniques (eg ipblocklist) introduced since then.
The addition of SYNPROXY to ipfire will be a very useful addition to protect from DoS attacks.
I think you need to be running at least CU 187 so upgrade if necessary with Pakfire.
Iâve not used the IPFire version of Synproxy as I ran a version on my server.
as explained in the blog post I linked above, the SYN flood protection only works on TCP, because UDP is an entirely different protocol that just doesnât work the way TCP does.
As this thread is on the SYN flood protection feature, please open a new thread for discussing your scenario, so this thread will stay focused.