Raw Socket Send TCP SYN packet

M

Marco Spiga

Hi to all,

I'm trying just for fun to writing an application that completly handle a
TCP connection.

The first problem is connect with an endPoint server.

In this case a set my remoteSocket:

Dim sck As New Sockets.Socket(Sockets.AddressFamily.InterNetwork,
Sockets.SocketType.Raw, Sockets.ProtocolType.Raw)

When I try to send a packet, it occurs an Exception. The packet is formatted
with the TCP Header (so I can handle the SYN)

What's wrong?

If I try with:
Dim sck As New Sockets.Socket(Sockets.AddressFamily.InterNetwork,
Sockets.SocketType.Raw, Sockets.ProtocolType.IP)

But it send a packet with the PROTOCOL IP Option equal to Zero, and don't
work!

I tried to bind the socket and send a packet but won't work... I haven't any
idea...

if someone can help me...thanks

Marco

p.s. I know that if can I send the SYN packet the SYN/ACK will discarded by
the stack... but I want to work with this things. :)
p.s.s. sorry for my english
 
R

Richard Grimes

Marco said:
Hi to all,

I'm trying just for fun to writing an application that completly
handle a TCP connection.

What OS are you using? Microsoft disabled user level raw socket access
in XP SP2, so if you want to do raw sockets you have to move to Linux.

I think it was a daft move from Microsoft and solved nothing, because if
someone wants to do something nasty with raw sockets they would not be
detered by Microsoft removing the ability to do this on XP.

Richard
 
M

Marco Spiga

Richard Grimes said:
What OS are you using? Microsoft disabled user level raw socket access
in XP SP2, so if you want to do raw sockets you have to move to Linux.

I think it was a daft move from Microsoft and solved nothing, because if
someone wants to do something nasty with raw sockets they would not be
detered by Microsoft removing the ability to do this on XP.

Thanks for the answer, my OS is WindowsXP SP1!, I think it's stupid too. :)
IMHO is a problem of handle in the TCP/IP stack of Windows, If I suppose
that I can send the SYN packet, the answer SYN/ACK or RST will be discarded
by the TCP/IP stack of the OS, because the sequence number isn't correct,
for that Microsoft don't permit this feature.

bye.

Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top