Actually, I looked into this some more after I submitted this. It looks like the pipe is messing with the regex matching in the line searching.
This is what I am seeing with
csf Version 5.09.
This appears to be correctable by escaping the pipe out before any regex searching is done.
On line 844 of csf.pl add the line:
I am not sure what other subroutines would need this or if line 844 is an optimal placement for this. I suspect that the
doakill subroutine would also need this and anything else that does regex searching.
To duplicate this issue and see what I am talking about, add lines into your csf.deny file:
Code: Select all
tcp:in:d=25:s=192.168.0.13
tcp:in:d=443:s=192.168.0.13
192.168.0.100
192.168.0.200
tcp|in|d=110:s=192.168.0.20
Now add a new deny rule from the command line
Code: Select all
csf -d "tcp|in|d=143|s=192.168.0.26"
And then remove that rule from the command line:
Code: Select all
csf -dr "tcp|in|d=143|s=192.168.0.26"
Because the pipe's are not escaped out, either on the command line or the csf.pl script, they are treated as or statements in the regex matching.
Your csf.deny file will now consist of just:
Escaping out the pipe characters either on the command line or in the csf.pl script will insure that the regex matching is exact.