![]() |
|
[.NET] [tut] creating a TCP port scanner in Visual Basic.net - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [tut] creating a TCP port scanner in Visual Basic.net (/showthread.php?tid=1225127) |
[tut] creating a TCP port scanner in Visual Basic.net - ***** - Apr 18, 2011 Today i will demonstrate how to create your own port scanner in Visual basic.net Basically, it will preform the same function as n-map (albeit with much less features) How will this work? Basically, this port scanner will try to create a TCP connection to every port within the specified port range. If the connection can be successfully established, than the port will be listed as open, if the connection cannot be opened, than the port will be listed as closed. Basically, this is how every port scanner works. However, better port scanners like n-map can scan using more methods than just attempting to establish a tcp connection. fur example the syn scan. unfortunately, this port scanner will list every port that it cannot establish a connection with as "closed". this might not be accurate, as there can be many reasons why a connection cannot be established. creating the port scanner first of all, create a new console application, and delete all the code import the required stuff: Code Imports System.Net.Socketsnow the class: Code Public Class psAPPand declare the variables Code Dim portStart As Integerthe user imput: Code Console.Write("Host: ")scanning the host: Code For lngPort = portStart To portEndthis works by trying to connect to every port within the scan range, and see if a connection can be established or not output code: Code Console.Write(" " & openPorts.ToString & " open port(s) : ")this is the final code that displays the out come to the user example code Code Imports System.Net.Sockets* - SoulZeh - Apr 18, 2011 Post a Screen Shot pleasee but nice tut <3 * - ***** - Apr 18, 2011 (Apr 18, 2011 07:49 PM)KevvYE Wrote: Post a Screen Shot pleasee the result (not created by me though): [img]http://img38.imageshack.us/img38/6430/finishedporj.png[/img] * - Arjun21 - Oct 18, 2011 Very nice tutorial man.. Thanks.. Keep posting |