A TCP SYN flood attack exploits the TCP three-way handshake by overwhelming a server with connection requests, exhausting its resources and blocking legitimate users. This content covers how the attack works and demonstrates it using Kali Linux in a controlled lab environment.
TCP SYN Flood Attack
TCP is a critical protocol that we use for a ton of the communication we do across the internet, or really across any of our networks. It is part of layer 4, a transport protocol, and it is a big part of the TCP/IP stack, which is the primary stack we use for communication using our computers.
Let us say our machine was connecting to a web page. Before that web page could even be requested, TCP needs to do its thing. It needs to make a connection, and it does that by doing a three-way handshake. This client machine says, "Hey, can we communicate?" And the server replies back and says, "Yeah, let's communicate." Great, we are communicating now. So this is the three-way handshake that happens, with a SYN, a SYN-ACK, and an ACK.
This is what that TCP header looks like. I do not want to get real in depth into this, but just know that when we are establishing that connection, the first thing it does is say, "Hey, let's communicate," by putting a one in that SYN flag right there. The rest of these would be zero. Then the reply back is yes, let us communicate, and the SYN-ACK means that both of those flags are turned on. Then the client machine sends a one in the acknowledgement back, saying great, we are communicating now.
What this three-way handshake does is open up a connection that remains open between the client and the server until one of those closes the connection, or the connection times out. So this server is keeping track of that connection.
What we are doing with a TCP SYN flood is that we are sending a bunch of these "hey, can we make a connection here" SYN messages. We are turning that flag on and trying to establish and make a ton of connections with the server. We can make more than one connection; this server will allow it. So it is going to be opening and tracking all those connections and responding back with this SYN acknowledgement, SYN-ACK, back.
It is actually very simple to carry out this type of attack, but make sure you are practicing ethical hacking only. This is really meant just for you to test within your own network, or a network that you have got permission to use and carry out this type of attack on.
I am on a demo laptop right here, and as you can see I have got this 10.130.23 website up. I can hit refresh and you can see that it refreshes, so it is all fresh, and we also have this ping going through. So what we are going to do is attack this website and see if we can bring it down.
I am on my Kali Linux here, and what I am going to do is hit the up key, because in a prior lesson I talked about doing an amp flood attack, and we can see now that this says ICMP. All we have to do for opening up these SYN connections, these TCP connections, is type in SYN. That is going to be the big change with this. Essentially what this is doing is setting that flag, turning that flag on, saying, "Hey, we want to talk to you."
The other thing that we are going to do is specify the destination port. In order to specify the destination port, what we are going to type in with this is dash dst port, space, 80. So we have got that typed in there, and then we are going to hit enter and see what happens.
As we can see, it did it. It is no longer pingable here, so it is using those resources. I hit refresh on the computer here, on the web browser here, and that is not coming up either. So what we have in fact done is we are still making those requests, "hey, can we open up a connection with you," and that has caused this problem.
Now let us bring up our Kali box again and hit control C to end that. Notice now our ping comes up and we are now connected to this website; it has been brought back up as well.
We did have part of this command, the flood, which allows us to send multiple requests at any given time, and the random source, so that we are choosing an address, we are sending a source address that is randomized, so that these requests are not coming back to this machine.
So here is our attack card on the TCP SYN flood. Essentially we are just overwhelming this server with enough SYN requests so that regular users are no longer able to access those resources.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →