C# network - Can I set my source port ? can I set TCP flags ( syn / rst ) ?

J

Jabadia

Hi , I would like to know if it is possible to 'build' the TCP header
with Source port / destination port , and with FLAGs i.e. SYN flag ,
sequence etc.

I know this can be done in C++ of course , question is if it is
possible in C# , o r it is too low level for it .

if it is possible , please post a sample ..

thanks ,
Yossi .
 
D

Daniel O'Connell [C# MVP]

Jabadia said:
Hi , I would like to know if it is possible to 'build' the TCP header
with Source port / destination port , and with FLAGs i.e. SYN flag ,
sequence etc.

I know this can be done in C++ of course , question is if it is
possible in C# , o r it is too low level for it .

if it is possible , please post a sample ..
Although I am not entirely sure what the purpose of this would be(outside of
nefarious ones), The .NET socket class does support raw sockets to some
extent. I don't know of a class that provides services for generating a
packet(one certainly doesn't come with the framework), but the socket
support is there.

If you are able to generate your own headers(You can do this in C#, thats
not the issue), you might be able to use the raw support to achieve this.
How would you do it in C++? What api's would you use?
 

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