| charlie (41) | |||||||
|
Hello!Thanks for your time reading this.I was doing a Client/Server app programming the server had following routines:
client:
Using Wireshark 5 packets where sniffed: Then I wanted to make my own client to trigger the same number of packets as before my program is like:
After running the program several times the server doesn't send back SYN-ACK packet. My platform is:Ubuntu Jaunty 9.04 kernel v2.6.28 Thanks! | |||||||
|
|
|||||||
| kooth (570) | |
| I assume you are checking the return codes from these functions? If so, what errors are you getting? | |
|
|
|
| charlie (41) | |||
Here is the source code u can run it yourself:
Am trying to trigger the same effect as if it was a normal socket() and connect() procedures of normal client app.
| |||
|
|
|||
| kbw (4346) | |||
|
I don't know why it's not working and I don't have access to Linux these days. But I do have some general comments: 1. You don't fill in the ethernet frame. 2. You use the structure sizes in places and your magic numbers in others. The numbers (20 for ip and tcp record sizes are correct, but still... it's a bit sloppy):
3. Is the sendto call correct? sendto(s, packet, 40, 0, (struct sockaddr*)&sin, sizeof(sin)) Check this out: http://www.security-freak.net/packet-injection/packet-injection.html | |||
|
|
|||
| charlie (41) | |
The ethernet frame is filled automatically,yes about the numbers its standard javascript:editbox1.editTag('code')that the ip header without options is 20 bytes ,its ok if i even use sizeof(struct iphdr);still i got the same problem?Have u happened to do what am trying to do? | |
|
|
|
| kbw (4346) | |
| Have you checked what's been sent by both sides on the wire? You need to confirm why the 3-way handshake isn't being completed. | |
|
|
|