简体   繁体   中英

How to set initial sequence number of TCP socket

As a part of testing, I am needing to be able to initialize the ISN (initial sequence number) of a TCP connection to a specific value. Normally this is a randomized value picked by the OS/Network Stack, but I need to control the initial value.

Is there any way to do this in C or Python?

  • Download lwip and lwip-contrib .
  • Create a new tap interface and bridge it with your normal network card
  • Build the lwip-contrib/ports/unix/proj/minimal app and run it
  • Now you should be able to ping the lwip stack
  • TCP sequence number are in struct tcp_pcb , values rcv_nxt and snd_nxt
  • Hack the TCP code to not randomize these values and add a TCP connection to the minimal app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM