SYNPROXY with CSF
Posted: 11 Dec 2018, 12:18
I am trying to implement SYNPROXY for the http/https ports with csfpre.sh
is what I have added in the pre script .
Above works with LF_SPI = "0" , but the ports are closed when LF_SPI = "1"
The difference I see when LF_SPI = 1 is the iptables rule
this somehow blocks the traffic.
Is there a way around to have stateful packet inspection and SYNPROXY together?
Code: Select all
iptables -t raw -I PREROUTING -p tcp -m tcp --syn --dport 80 -j CT --notrack
iptables -t raw -I PREROUTING -p tcp -m tcp --syn --dport 443 -j CT --notrack
iptables -t filter -I INPUT -p tcp -m tcp --dport 80 -m state --state INVALID,UNTRACKED -j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
iptables -t filter -I INPUT -p tcp -m tcp --dport 443 -m state --state INVALID,UNTRACKED -j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
iptables -t filter -A INPUT -p tcp -m tcp --dport 80 -m state --state INVALID -j DROP
iptables -t filter -A INPUT -p tcp -m tcp --dport 443 -m state --state INVALID -j DROP
Above works with LF_SPI = "0" , but the ports are closed when LF_SPI = "1"
The difference I see when LF_SPI = 1 is the iptables rule
Code: Select all
target prot opt source destination
INVALID tcp -- anywhere anywhere
Is there a way around to have stateful packet inspection and SYNPROXY together?