Using raw sockets with C#

前端 未结 3 1643
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 23:22

I want to write a port scanner in C# and I can\'t use SocketType.Raw as raw sockets were taken out from desktop versions of windows. I can\'t use SharpPcap either or other w

相关标签:
3条回答
  • 2020-12-15 23:39

    Try running Visual Studio as Adminitrator

    Right click ---> run as administrator

    Then execute programs with raW sockets..

    0 讨论(0)
  • 2020-12-15 23:44

    Take note on how nmap did it and that for now I believe your option would be to go to a lower level at the ethernet frame.

    "Nmap only supports ethernet interfaces (including most 802.11 wireless cards and many VPN clients) for raw packet scans. Unless you use the -sT -Pn options, RAS connections (such as PPP dialups) and certain VPN clients are not supported. This support was dropped when Microsoft removed raw TCP/IP socket support in Windows XP SP2. Now Nmap must send lower-level ethernet frames instead."

    So - that brings us to:

    http://www.codeproject.com/KB/IP/sendrawpacket.aspx

    0 讨论(0)
  • 2020-12-15 23:51

    Just like this:

    http://www.winsocketdotnetworkprogramming.com/clientserversocketnetworkcommunication8h.html

    Also, at what point was it removed from Windows? I did a chat client for a friend last week; as well, http://msdn.microsoft.com/en-us/library/system.net.sockets.sockettype.aspx , still lists it as being active.

    0 讨论(0)
提交回复
热议问题