2

I'm trying to understand whether TCP packet injection into a plaintext protocol is possible within a switched network (or wherever there are no validations relating to IP legitimacy).

If I know there is a TCP connection between client A and server B with server running on port 1234. The attacker is positioned on the same switching layer, but is NOT able to intercept communications via MitM or similar. What information is required in order to spoof a TCP packet, and can it be brute forced? I am primarily interested in spoofing a packet to the server in this situation, and assume that shortly after a single spoofed packet the connection will desync and terminate.

From what I can tell, the entropy is:

  • Client port (generally between the port range 32k and 64k, but is OS / config dependent)
  • Sequence Number
  • Acknowledgement number (?)

I'm unclear on whether both the sequence and acknowledgement number is required for a single spoofed packet.

My understanding is that historically, 'TCP sequence prediction attacks' were possible, but this was mitigated by randomly generating initial Sequence and Acknowledgement numbers such that they are not easy to predict. This would result in a keyspace of (roughly) 32k * 2**32 * 2**32 (approx 604,462,909,807,314,587,353,088).

Is this math correct? Are there any other mitigations (outside of encryption) which would mitigate packet injection?

3
  • 2
    Sequence and Ack numbers cannot be random because they are used to gather chunks of bytes into a stream in the same order as they were send. They are literally position of the byte in the stream and only initial value is random. So if your attacker got one packet of the transmission - they got everything they need to predict the sequence and replace next packet with a forged one. Commented Sep 4 at 12:04
  • @user13964273 I've edited my post for clarity, but at no point was there an indication of a possible or successful packet interception so I'm unsure how you ended up where you did with that logic.
    – 90ueiomtn
    Commented Sep 4 at 22:58
  • You said "within a switched network" and packet interception is possible there by number of techniques including ARP poisoning and CAM overflow. Commented Sep 5 at 12:01

0

You must log in to answer this question.

Browse other questions tagged .