c# tcp port scanner resources [closed]

2019-02-18 23:01发布

Does anyone knows of any .Net library or resources that will assist me to implement a TCP port scanner?

4条回答
你好瞎i
3楼-- · 2019-02-18 23:25

For simple one, that will just try to connect to each port and report success / failure, without any "tricks", like sending only ACK packets etc. - you won't need anything else than System.Net and System.Net.Sockets, create socket, try connecting to a host, check if you have succeeded. For better performance, you can create more sockets, and use asynchronous approach (BeginConnect/EndConnect).

查看更多
相关推荐>>
4楼-- · 2019-02-18 23:34

I found some example codes.

http://www.geekpedia.com/tutorial142_Creating-a-Port-Scanner-with-Csharp.html

http://www.dijksterhuis.org/building-a-simple-portscanner-in-c/

WinPcap is a network monitoring and packet capturing tool but it might be also useful because it is another way to get an idea about network transmissions. But it may not suit to your requirement.

查看更多
爷、活的狠高调
5楼-- · 2019-02-18 23:35

You can use Pcap.Net to create and send raw packets.

You can also capture packets using this framework.

It includes a packet interpretation and creation framework so it should be pretty easy to create the packets you need to scan the ports and to parse the packets returned.

查看更多
登录 后发表回答