Question

I wanted to implement the three-way handshake using python.And here is what I did:

1-I created syn packet .

2-I send the packet to the destination .

3-I created a function that will listen to all the traffic that pass through my NIC .it's kinda like sniffer.If this function were to find a packet that is destined to my IP address and the same port that I send the syn packet through, it will parse it .

4-If the flags in the captured packet are set to syn+ack,the function will generate a TCP packet with the ack flag set.

The problem is, before I send the ack packet the system send RST packet . So , what is the meaning of the behaviour?? Is there anyway to stop it??

Note: I am not implementing the three-way handshake for production purposes.I just want to understand how the protocol TCP work.

No correct solution

OTHER TIPS

Disable the system's TCP/IP stack so that you have complete control over what it sends over the network. Usually the easiest way to do this is simply not to configure IP on the interface you are using. Note that you will need to handle ARP requests.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top