I am trying to create a simple C# app which does port forwarding, and need to know how to use the IP_HDRINCL socket option to try to fake out the receiving end to think the connection is really to the source. Any examples would be greatly appreciated.
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Newer versions of windows restrict the use of raw sockets due to malware heavily abusing them.
Quoted from the MSDN
The only problem is that I've been able to successfully receive data from a raw socket like this, (including the IP header) but not send it.
I found this website, but not sure how well the code works: http://www.winsocketdotnetworkprogramming.com/clientserversocketnetworkcommunication8h.html
.NET's Socket type does support RAW, and there is
SocketOptionName.HeaderIncluded
for use withSocket.SetSocketOption
.You may want to use Reflector to double check the .NET implementation aligns with the enum values.