I'm a newbie in networking, still don't quite understand about security.

Let's say a person A uses TCP to establish a TCP connection with a server. And there is a hacker B who is sniffing, so B manually creates a packet with source address and source port number to be A's and send this packet to the server, so the server thinks that this packet is from A.

I know SSL can handle this problem by including the sequence number in the MAC calculation which can be used by the server to verify the data integrity. So my questions are:

  1. If one uses normal TCP rather than SSL, so hackers can easily create packets based on original user's info and do harm on the server, is it true?

  2. Lets say the server is using Stateful Packet Filter type firewall, can it handle this problem? I don't think it can, because even though the firewall checks the connection table, but the created packet's source address and port number has been modified to the same as A's, so the firewall will still allow fake packet in?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 25, 2018 at 9:26

1 Answer 1


TCP doesn't have security. TCP creates connections between peers, and it sends segments back and forth in a handshake to create the peer connection. If your hacker tries to connect to a destination (TCP doesn't have clients or servers, which are application concepts), the destination would need to handshake back to the source, and the hacker doesn't actually have the source address, so the handshake would fail because the return packets would go to the actual source address.

A firewall tracks the TCP connection, and it will restrict, by default, outside sources connecting to inside addresses. An outside source would need to be permitted in the firewall rules to send to an inside destination, and, again, it takes a handshake process to establish a connection.

  • If a hacker captures a packet from A(so the hacker know A's source address), then he create a same packet with sequence number incremented, there no way for the server to differentiate this dodgy packet from A and the hacker, no handshake required, isn't it?
    – amjad
    Sep 13, 2018 at 6:35
  • If the hacker tries to copy As address, then it will never get any replies or acknowledgements, which are required, because they will be sent back to A. TCP is a two-way conversation, not a one-way monologue. Both sides must acknowledge receipt of what the other sends, and they both keep track of where (byte number) each is in what it has sent. The connections also must have bot source and destination IP and TCP addresses.
    – Ron Maupin
    Sep 13, 2018 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.