Does anyone knows of any .Net library or resources that will assist me to implement a TCP port scanner?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
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
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
andSystem.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).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.
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.