SYN Attacks - how i cant stop it

Anton Alin-Adrian aanton at
Fri Feb 13 08:32:01 PST 2004

JJB wrote:
> You talk about the net.inet.tcp.syncookies=1 knob,
> how about an description on what it does and why you
> are recommending using it.

The net.inet.tcp.syncookies 'knob', if set to 1, enables syn cookies. 
Syn cookies were invented specifically for syn flood protection. A brief 
description of syncookies idea can be read here:

> How would one go about mirroring back the attackers
> syn packets to port 80 or 22?
> Please describe this easy method of yours.

Mirroring back packets to the attacker is, first of all, a nasty thing. 
Secondly, it is only possible if the attacker's IP is known. If it is 
not known, then obviously it's not possible.

Knowing the attacker's IP does not necessarly mean that he is performing 
the current attacks from that IP.

Packet redirection with ipfw is done using divert sockets. One needs to 
have it compiled into the kernel. Divert sockets are also used by ipfw 
nat redirection. It's all in the man pages of ipfw.

If the flood is severly intense (from the point of stack memory 
exhaution), it might be a good improvement to drop 5% of incoming SYN 
packets. This can also be done with ipfw, and is described in the manual 
pages. However, I don't think one would ever come to this.

Asking the ISP to put the server behind a decent cisco router, and 
implement syn cookies on hardware devices, is the best protection.

Alin-Adrian Anton
Reversed Hell Networks
GPG keyID 0x1E2FFF2E (2963 0C11 1AF1 96F6 0030 6EE9 D323 639D 1E2F FF2E)
gpg --keyserver --recv-keys 1E2FFF2E

More information about the freebsd-questions mailing list