views:

31

answers:

1

Hi, I'm writing a windows driver (of course in c and I'm in kernel mode) and I'd like to open a tcp socket from the outside specifying the sequence number the first SYN packet should have.

I tried modifying the packet filtering it with Windows Filtering Platform, but of course it doesn't work because the stack think that the correct number is the original one and the recipient's stack think that the correct one is modified one.

I'm looking somethink like: OpenSocket(..., UINT32 seqNum, UINT16 winSize) or anything equivalent.

There is a way to do that?

Thanks, Marco

A: 

Seems like a strange thing to be doing, but if your filter can modify both incoming and outgoing packets then it can fix the sequence number in both directions.

Just figure out the offset from the orignal sequence number. Then you can add it to the sequence number for outgoing packets and subtract it from the acknowledgment numbers for incoming packets.

Each side of the conversation gets exactly what they expect, even though they disagree on what is expected.

torak