Raw Socket Send TCP SYN packet

  • Thread starter Thread starter Marco Spiga
  • Start date Start date
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
 
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
 
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
 
Back
Top