Using raw sockets with C#

前端 未结 3 1649
被撕碎了的回忆
被撕碎了的回忆 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: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

提交回复
热议问题