0

I need to send a tcp SYN packet with timestamp value in tcp option. Since tcp opts should be prepacked in 32-bit representation, can anyone brief me how to set the value in 32 bit packet representaion with a example.

Thanks in advance

1 Answer 1

1

You should be able to do that pretty easily with Scapy. When defining your TCP layer, just use

TCP(flags='S', options=[('Timestamp', (TSval, 0))])

where TSval is your timestamp value. If you want to convert the resultant packet to its binary representation, call str() on it.

In future packets, you can replace the 0 with the appropriate TS echo reply per RFC 1323.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.