c# tcp port scanner resources [closed]

流过昼夜 提交于 2019-12-01 06:25:37

问题


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


回答1:


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).




回答2:


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.




回答3:


You can try my open source program here ;)

http://dercousin.xhost.ro/index.php?option=com_content&view=category&layout=blog&id=35&Itemid=53




回答4:


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.



来源:https://stackoverflow.com/questions/1331902/c-sharp-tcp-port-scanner-resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!