[VB.Net]Port Scanner

Results 1 to 9 of 9
  1. #1
    Ω -DefaulT is offline
    MemberRank
    Aug 2006 Join Date
    Emerald CityLocation
    1,429Posts

    [VB.Net]Port Scanner

    Just a simple project i started to see if i could do it.

    Screen shot:



    Download:
    http://default.site40.net/release/PortScanner.zip

    Source:
    http://forum.ragezone.com/f86/vb-net...5/#post5967166
    Last edited by -DefaulT; 20-10-10 at 10:43 PM.


  2. #2
    Valued Member [K]yth is offline
    MemberRank
    Oct 2010 Join Date
    SingaporeLocation
    117Posts

    Re: [VB.Net]Port Scanner

    Look nice, Good job i guess. (Y)

  3. #3
    Ω -DefaulT is offline
    MemberRank
    Aug 2006 Join Date
    Emerald CityLocation
    1,429Posts

    Re: [VB.Net]Port Scanner

    thanks :D

  4. #4
    something Erlend is offline
    MemberRank
    Dec 2007 Join Date
    Oslo, NorwayLocation
    791Posts

    Re: [VB.Net]Port Scanner

    Could you send me the source code on PM or something? would be awesome to see how it works :)

    Edit: download to exe file doesnt work :(

  5. #5
    Gamma Sparrow is offline
    MemberRank
    Mar 2009 Join Date
    SydneyLocation
    2,960Posts

    Re: [VB.Net]Port Scanner

    Could you please post the source? Same reasons as the person above ^.

    ---------- Post added at 01:18 AM ---------- Previous post was at 01:12 AM ----------

    Quote Originally Posted by emineem View Post
    Could you send me the source code on PM or something? would be awesome to see how it works :)

    Edit: download to exe file doesnt work :(
    Last edited by Sparrow; 20-10-10 at 02:38 AM.

  6. #6
    Revolution-Entrepreneur MrTay is offline
    MemberRank
    Apr 2009 Join Date
    Fatherboard.Location
    711Posts

    Re: [VB.Net]Port Scanner

    My god, this helps alot for me, thanks!

  7. #7
    Ω -DefaulT is offline
    MemberRank
    Aug 2006 Join Date
    Emerald CityLocation
    1,429Posts

    Re: [VB.Net]Port Scanner

    sure here is the source:

    frmMain.vb
    Code:
    Imports System.Threading
    
    Public Class frmMain
        Inherits System.Windows.Forms.Form
    
        Private dtResults As DataTable
        Private WithEvents myScanner As clsScanner
        Private WithEvents MainMenu1 As System.Windows.Forms.MainMenu
        Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
        Friend WithEvents mnuScan As System.Windows.Forms.MenuItem
        Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
        Friend WithEvents mnuSaveResults As System.Windows.Forms.MenuItem
        Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
        Friend WithEvents mnuExit As System.Windows.Forms.MenuItem
        Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
        Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
        Friend WithEvents Label2 As System.Windows.Forms.Label
    
        ''Used to Invoke the IncrementProgressBar sub in the same thread as the Form
        Dim CallIncrementProgressBar As New MethodInvoker(AddressOf Me.IncrementProgressBar)
    
    #Region " Windows Form Designer generated code "
    
        Public Sub New()
            MyBase.New()
    
            'This call is required by the Windows Form Designer.
            InitializeComponent()
    
            'Add any initialization after the InitializeComponent() call
            Application.EnableVisualStyles()
        End Sub
    
        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub
    
        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer
    
        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        Friend WithEvents btnScan As System.Windows.Forms.Button
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents Label3 As System.Windows.Forms.Label
        Friend WithEvents Label4 As System.Windows.Forms.Label
        Friend WithEvents txtHost As System.Windows.Forms.TextBox
        Friend WithEvents txtFrom As System.Windows.Forms.TextBox
        Friend WithEvents txtTo As System.Windows.Forms.TextBox
        Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
        Friend WithEvents checkOpen As System.Windows.Forms.CheckBox
        Friend WithEvents dgResults As System.Windows.Forms.DataGrid
        Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
        Friend WithEvents SaveResultXML As System.Windows.Forms.SaveFileDialog
        Friend WithEvents cmScanResults As System.Windows.Forms.ContextMenu
        Friend WithEvents mnuSRSaveResultXML As System.Windows.Forms.MenuItem
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            Me.components = New System.ComponentModel.Container()
            Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain))
            Me.btnScan = New System.Windows.Forms.Button()
            Me.Label1 = New System.Windows.Forms.Label()
            Me.Label3 = New System.Windows.Forms.Label()
            Me.Label4 = New System.Windows.Forms.Label()
            Me.txtHost = New System.Windows.Forms.TextBox()
            Me.txtFrom = New System.Windows.Forms.TextBox()
            Me.txtTo = New System.Windows.Forms.TextBox()
            Me.GroupBox1 = New System.Windows.Forms.GroupBox()
            Me.checkOpen = New System.Windows.Forms.CheckBox()
            Me.dgResults = New System.Windows.Forms.DataGrid()
            Me.cmScanResults = New System.Windows.Forms.ContextMenu()
            Me.mnuSRSaveResultXML = New System.Windows.Forms.MenuItem()
            Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
            Me.SaveResultXML = New System.Windows.Forms.SaveFileDialog()
            Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)
            Me.MenuItem4 = New System.Windows.Forms.MenuItem()
            Me.MenuItem2 = New System.Windows.Forms.MenuItem()
            Me.mnuScan = New System.Windows.Forms.MenuItem()
            Me.MenuItem3 = New System.Windows.Forms.MenuItem()
            Me.mnuSaveResults = New System.Windows.Forms.MenuItem()
            Me.MenuItem5 = New System.Windows.Forms.MenuItem()
            Me.mnuExit = New System.Windows.Forms.MenuItem()
            Me.MenuItem1 = New System.Windows.Forms.MenuItem()
            Me.Label2 = New System.Windows.Forms.Label()
            Me.GroupBox1.SuspendLayout()
            CType(Me.dgResults, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'btnScan
            '
            Me.btnScan.FlatStyle = System.Windows.Forms.FlatStyle.System
            Me.btnScan.Location = New System.Drawing.Point(96, 176)
            Me.btnScan.Name = "btnScan"
            Me.btnScan.Size = New System.Drawing.Size(75, 23)
            Me.btnScan.TabIndex = 1
            Me.btnScan.Text = "Scan"
            '
            'Label1
            '
            Me.Label1.BackColor = System.Drawing.Color.Transparent
            Me.Label1.ForeColor = System.Drawing.Color.White
            Me.Label1.Location = New System.Drawing.Point(16, 16)
            Me.Label1.Name = "Label1"
            Me.Label1.Size = New System.Drawing.Size(40, 16)
            Me.Label1.TabIndex = 2
            Me.Label1.Text = "Host:"
            '
            'Label3
            '
            Me.Label3.ForeColor = System.Drawing.Color.White
            Me.Label3.Location = New System.Drawing.Point(16, 24)
            Me.Label3.Name = "Label3"
            Me.Label3.Size = New System.Drawing.Size(40, 16)
            Me.Label3.TabIndex = 4
            Me.Label3.Text = "From:"
            '
            'Label4
            '
            Me.Label4.ForeColor = System.Drawing.Color.White
            Me.Label4.Location = New System.Drawing.Point(16, 56)
            Me.Label4.Name = "Label4"
            Me.Label4.Size = New System.Drawing.Size(24, 16)
            Me.Label4.TabIndex = 5
            Me.Label4.Text = "To:"
            '
            'txtHost
            '
            Me.txtHost.Location = New System.Drawing.Point(64, 16)
            Me.txtHost.Name = "txtHost"
            Me.txtHost.Size = New System.Drawing.Size(100, 20)
            Me.txtHost.TabIndex = 6
            Me.txtHost.Text = "127.0.0.1"
            '
            'txtFrom
            '
            Me.txtFrom.Location = New System.Drawing.Point(56, 24)
            Me.txtFrom.Name = "txtFrom"
            Me.txtFrom.Size = New System.Drawing.Size(100, 20)
            Me.txtFrom.TabIndex = 7
            Me.txtFrom.Text = "1"
            '
            'txtTo
            '
            Me.txtTo.Location = New System.Drawing.Point(56, 56)
            Me.txtTo.Name = "txtTo"
            Me.txtTo.Size = New System.Drawing.Size(100, 20)
            Me.txtTo.TabIndex = 8
            Me.txtTo.Text = "100"
            '
            'GroupBox1
            '
            Me.GroupBox1.BackColor = System.Drawing.Color.Transparent
            Me.GroupBox1.Controls.Add(Me.txtTo)
            Me.GroupBox1.Controls.Add(Me.txtFrom)
            Me.GroupBox1.Controls.Add(Me.Label4)
            Me.GroupBox1.Controls.Add(Me.Label3)
            Me.GroupBox1.ForeColor = System.Drawing.Color.White
            Me.GroupBox1.Location = New System.Drawing.Point(8, 48)
            Me.GroupBox1.Name = "GroupBox1"
            Me.GroupBox1.Size = New System.Drawing.Size(168, 88)
            Me.GroupBox1.TabIndex = 9
            Me.GroupBox1.TabStop = False
            Me.GroupBox1.Text = "Ports"
            '
            'checkOpen
            '
            Me.checkOpen.BackColor = System.Drawing.Color.Transparent
            Me.checkOpen.Checked = True
            Me.checkOpen.CheckState = System.Windows.Forms.CheckState.Checked
            Me.checkOpen.ForeColor = System.Drawing.Color.White
            Me.checkOpen.Location = New System.Drawing.Point(16, 144)
            Me.checkOpen.Name = "checkOpen"
            Me.checkOpen.Size = New System.Drawing.Size(144, 24)
            Me.checkOpen.TabIndex = 10
            Me.checkOpen.Text = "Only Show Open Ports"
            Me.checkOpen.UseVisualStyleBackColor = False
            '
            'dgResults
            '
            Me.dgResults.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                        Or System.Windows.Forms.AnchorStyles.Left) _
                        Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
            Me.dgResults.CaptionText = "Scan Results"
            Me.dgResults.ContextMenu = Me.cmScanResults
            Me.dgResults.DataMember = ""
            Me.dgResults.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dgResults.Location = New System.Drawing.Point(184, 8)
            Me.dgResults.Name = "dgResults"
            Me.dgResults.ReadOnly = True
            Me.dgResults.Size = New System.Drawing.Size(341, 194)
            Me.dgResults.TabIndex = 11
            '
            'cmScanResults
            '
            Me.cmScanResults.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuSRSaveResultXML})
            '
            'mnuSRSaveResultXML
            '
            Me.mnuSRSaveResultXML.Enabled = False
            Me.mnuSRSaveResultXML.Index = 0
            Me.mnuSRSaveResultXML.Text = "S&ave Result as XML"
            '
            'ProgressBar1
            '
            Me.ProgressBar1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                        Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
            Me.ProgressBar1.Location = New System.Drawing.Point(184, 202)
            Me.ProgressBar1.Name = "ProgressBar1"
            Me.ProgressBar1.Size = New System.Drawing.Size(341, 23)
            Me.ProgressBar1.TabIndex = 12
            '
            'SaveResultXML
            '
            Me.SaveResultXML.DefaultExt = "xml"
            Me.SaveResultXML.FileName = "PortScan.xml"
            Me.SaveResultXML.Filter = "XML files|*.xml|All files|*.*"
            Me.SaveResultXML.Title = "Save Result as XML"
            '
            'MainMenu1
            '
            Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2})
            '
            'MenuItem4
            '
            Me.MenuItem4.Index = 0
            Me.MenuItem4.Text = "&About"
            '
            'MenuItem2
            '
            Me.MenuItem2.Index = 1
            Me.MenuItem2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem4})
            Me.MenuItem2.Text = "&Help"
            '
            'mnuScan
            '
            Me.mnuScan.Index = 0
            Me.mnuScan.Text = "&Scan"
            '
            'MenuItem3
            '
            Me.MenuItem3.Index = 1
            Me.MenuItem3.Text = "-"
            '
            'mnuSaveResults
            '
            Me.mnuSaveResults.Enabled = False
            Me.mnuSaveResults.Index = 2
            Me.mnuSaveResults.Text = "S&ave Result as XML"
            '
            'MenuItem5
            '
            Me.MenuItem5.Index = 3
            Me.MenuItem5.Text = "-"
            '
            'mnuExit
            '
            Me.mnuExit.Index = 4
            Me.mnuExit.Text = "E&xit"
            '
            'MenuItem1
            '
            Me.MenuItem1.Index = 0
            Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuScan, Me.MenuItem3, Me.mnuSaveResults, Me.MenuItem5, Me.mnuExit})
            Me.MenuItem1.Text = "&File"
            '
            'Label2
            '
            Me.Label2.AutoSize = True
            Me.Label2.BackColor = System.Drawing.Color.Transparent
            Me.Label2.ForeColor = System.Drawing.Color.White
            Me.Label2.Location = New System.Drawing.Point(145, 206)
            Me.Label2.Name = "Label2"
            Me.Label2.Size = New System.Drawing.Size(33, 13)
            Me.Label2.TabIndex = 13
            Me.Label2.Text = "100%"
            Me.Label2.Visible = False
            '
            'frmMain
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
            Me.ClientSize = New System.Drawing.Size(529, 228)
            Me.Controls.Add(Me.Label2)
            Me.Controls.Add(Me.ProgressBar1)
            Me.Controls.Add(Me.dgResults)
            Me.Controls.Add(Me.checkOpen)
            Me.Controls.Add(Me.GroupBox1)
            Me.Controls.Add(Me.txtHost)
            Me.Controls.Add(Me.Label1)
            Me.Controls.Add(Me.btnScan)
            Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
            Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
            Me.MaximizeBox = False
            Me.Menu = Me.MainMenu1
            Me.MinimizeBox = False
            Me.Name = "frmMain"
            Me.Text = "Port Scanner"
            Me.GroupBox1.ResumeLayout(False)
            Me.GroupBox1.PerformLayout()
            CType(Me.dgResults, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
            Me.PerformLayout()
    
        End Sub
    
    #End Region
    
        Private Sub Scan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScan.Click, mnuScan.Click
            dtResults.Clear()
            dgResults.DataSource = Nothing
    
            txtHost.Enabled = False
            txtFrom.Enabled = False
            txtTo.Enabled = False
            checkOpen.Enabled = False
            btnScan.Enabled = False
            mnuScan.Enabled = False
            mnuSaveResults.Enabled = False
            mnuSRSaveResultXML.Enabled = False
    
            myScanner = New clsScanner(txtHost.Text, Int(txtFrom.Text), Int(txtTo.Text))
            ProgressBar1.Minimum = Int(txtFrom.Text)
            ProgressBar1.Maximum = Int(txtTo.Text)
            ProgressBar1.Value = Int(txtFrom.Text)
            myScanner.Start()
        End Sub
    
        Private Sub PortOpen_myScanner(ByVal Host As String, ByVal Port As Integer) Handles myScanner.PortOpen
            WritePort(Host, Port, clsScanner.portState.Open)
            Me.BeginInvoke(CallIncrementProgressBar) ''Invoke the IncrementProgressBar sub in the same thread as the Form
        End Sub
    
        Private Sub PortClosed_myScanner(ByVal Host As String, ByVal Port As Integer) Handles myScanner.PortClosed
            WritePort(Host, Port, clsScanner.portState.Closed)
            Me.BeginInvoke(CallIncrementProgressBar) ''Invoke the IncrementProgressBar sub in the same thread as the Form
        End Sub
    
        Private Sub IncrementProgressBar()
            If ProgressBar1.Value < ProgressBar1.Maximum Then
                ProgressBar1.Value += 1
                If dgResults.CaptionText <> "Scanning..." Then dgResults.CaptionText = "Scanning..."
                Label2.Visible = True
                Label2.Text = "[" & Int((ProgressBar1.Value - ProgressBar1.Minimum) / (ProgressBar1.Maximum - ProgressBar1.Minimum) * 100) & "%]"
            Else
                dgResults.DataSource = dtResults
                dgResults.CaptionText = "Scan Results"
                Me.Text = "Port Scanner"
                txtHost.Enabled = True
                txtFrom.Enabled = True
                txtTo.Enabled = True
                checkOpen.Enabled = True
                btnScan.Enabled = True
                mnuScan.Enabled = True
                mnuSaveResults.Enabled = True
                mnuSRSaveResultXML.Enabled = True
            End If
        End Sub
    
        Private Function WritePort(ByVal Host As String, ByVal Port As Integer, ByVal State As clsScanner.portState)
            If (checkOpen.Checked And State = clsScanner.portState.Open) Or (Not (checkOpen.Checked)) Then
                Dim myRow As DataRow = dtResults.NewRow
                myRow("Host") = Host
                myRow("Port") = Port
                myRow("State") = State.ToString
                If State = clsScanner.portState.Open Then myRow("Service") = GetServiceName(Port)
                dtResults.Rows.Add(myRow)
            End If
        End Function
    
        Public Function GetServiceName(ByVal Port As Integer) As String
            Dim strName As String = System.Configuration.ConfigurationSettings.AppSettings("Port" & Port)
            If Len(strName) = 0 Then
                strName = ""
            End If
            Return strName
        End Function
    
        Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            dtResults = New DataTable
            dtResults.Columns.Add("Host", GetType(String))
            dtResults.Columns.Add("Port", GetType(Integer))
            dtResults.Columns.Add("State", GetType(String))
            dtResults.Columns.Add("Service", GetType(String))
        End Sub
    
        Private Sub Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
            Application.Exit()
        End Sub
    
        Private Sub mnuSaveResults_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSRSaveResultXML.Click, mnuSaveResults.Click
            If SaveResultXML.ShowDialog = DialogResult.OK Then
                Dim dsResult As New DataSet
                dsResult.Tables.Add(dtResults)
                dsResult.Tables(0).TableName = "ScanResults"
                dsResult.DataSetName = "PortScanner"
                dsResult.WriteXml(SaveResultXML.FileName)
            End If
        End Sub
    
        Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
            Dim strMessage As String = "Port Scanner " & Application.ProductVersion & vbNewLine & "Written by: -DefaulT" & vbNewLine & "http://default.site40.net"
            MessageBox.Show(strMessage, "Port Scanner")
        End Sub
    
        Private Sub txtFrom_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtFrom.KeyPress, txtTo.KeyPress
            If e.KeyChar.IsLetter(e.KeyChar) Or e.KeyChar.IsSymbol(e.KeyChar) Or e.KeyChar.IsPunctuation(e.KeyChar) Then
                e.Handled = True
            End If
        End Sub
    End Class
    clsScanner.vb
    Code:
    Imports System.Threading
    
    Public Class clsScanner
        Event PortOpen(ByVal Host As String, ByVal Port As Integer)
        Event PortClosed(ByVal Host As String, ByVal Port As Integer)
        Event ErrorOccurred(ByVal ex As Exception)
        Event ScanComplete()
    
        Private _Host As String
        Private _PortFrom As Integer
        Private _PortTo As Integer
    
        Public Enum portState
            Open
            Closed
        End Enum
    
        Sub New(ByVal Host As String, ByVal PortFrom As Integer, ByVal PortTo As Integer)
            _Host = Host
            _PortFrom = PortFrom
            _PortTo = PortTo
        End Sub
    
        Friend ReadOnly Property Host() As String
            Get
                Return _Host
            End Get
        End Property
    
        Friend ReadOnly Property PortFrom() As Integer
            Get
                Return _PortFrom
            End Get
        End Property
    
        Friend ReadOnly Property PortTo() As Integer
            Get
                Return _PortTo
            End Get
        End Property
    
        Friend Function Start()
            Dim wcb As WaitCallback = New WaitCallback(AddressOf StarterCallbackMethod)
            Try
                Threading.ThreadPool.QueueUserWorkItem(wcb, 0)
            Catch ex As Exception
                RaiseEvent ErrorOccurred(ex)
            End Try
        End Function
    
        Private Sub StarterCallbackMethod(ByVal state As Object)
            Dim wcb As WaitCallback = New WaitCallback(AddressOf CallbackMethod)
            Dim i As Integer
            Try
                For i = _PortFrom To _PortTo
                    Threading.ThreadPool.QueueUserWorkItem(wcb, i)
                Next
            Catch ex As Exception
                RaiseEvent ErrorOccurred(ex)
            End Try
        End Sub
    
        Private Sub CallbackMethod(ByVal state As Object)
            Dim returnValue As portState
            returnValue = portState.Closed
            Dim HostAddress As System.Net.IPAddress = System.Net.Dns.Resolve(_Host).AddressList(0)
            Dim EPhost As New System.Net.IPEndPoint(HostAddress, Int(state))
            Dim mySocket As New System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp)
            Try
                mySocket.Connect(EPhost)
                If mySocket.Connected Then
                    returnValue = portState.Open
                    mySocket.Close()
                Else
                    returnValue = portState.Closed
                End If
            Catch ex As Exception
                RaiseEvent ErrorOccurred(ex)
                returnValue = portState.Closed
            Finally
                If returnValue = portState.Open Then
                    RaiseEvent PortOpen(_Host, Int(state))
                Else
                    RaiseEvent PortClosed(_Host, Int(state))
                End If
            End Try
        End Sub
    
    End Class
    AssemblyInfo.vb
    Code:
    Imports System
    Imports System.Reflection
    Imports System.Runtime.InteropServices
    
    ' General Information about an assembly is controlled through the following 
    ' set of attributes. Change these attribute values to modify the information
    ' associated with an assembly.
    
    ' Review the values of the assembly attributes
    
    <Assembly: AssemblyTitle("Port Scanner")> 
    <Assembly: AssemblyDescription("TCP/IP Port Scanner")> 
    <Assembly: AssemblyCompany("http://default.site40.net/")> 
    <Assembly: AssemblyProduct("Port Scanner")> 
    <Assembly: AssemblyCopyright("-DefaulT")> 
    <Assembly: AssemblyTrademark("")> 
    <Assembly: CLSCompliant(True)> 
    
    'The following GUID is for the ID of the typelib if this project is exposed to COM
    <Assembly: Guid("846E51DD-2482-46E6-955A-D80211CA3368")> 
    
    ' Version information for an assembly consists of the following four values:
    '
    '      Major Version
    '      Minor Version 
    '      Build Number
    '      Revision
    '
    ' You can specify all the values or you can default the Build and Revision Numbers 
    ' by using the '*' as shown below:
    
    <Assembly: AssemblyVersion("1.1.*")>
    App.config
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
    	<add key="PortList" value="http://www.iss.net/security_center/advice/Exploits/Ports/" />
    	<add key="Port1" value="tcpmux" />
    	<add key="Port5" value="rje" />
    	<add key="Port7" value="echo" />
    	<add key="Port9" value="discard" />
    	<add key="Port11" value="systat" />
    	<add key="Port13" value="daytime" />
    	<add key="Port15" value="netstat" />
    	<add key="Port17" value="qotd" />
    	<add key="Port18" value="send/rwp" />
    	<add key="Port19" value="chargen" />
    	<add key="Port20" value="FTP-Data" />
        <add key="Port21" value="FTP" />
        <add key="Port22" value="SSH, PCAnywhere" />
        <add key="Port23" value="Telnet" />
        <add key="Port25" value="SMTP" />
        <add key="Port27" value="ETRN" />
        <add key="Port29" value="msg-icp" />
        <add key="Port31" value="msg-auth" />
        <add key="Port33" value="dsp" />
        <add key="Port37" value="time" />
        <add key="Port38" value="RAP" />
        <add key="Port39" value="rlp" />
        <add key="Port41" value="DeepThroat (FTP)" />
        <add key="Port42" value="nameserv, WINS" />
        <add key="Port43" value="whois, nickname" />
        <add key="Port49" value="TACACS, Login Host Protocol" />
        <add key="Port50" value="RMCP, re-mail-ck" />
        <add key="Port53" value="DNS" />
        <add key="Port57" value="MTP" />
        <add key="Port59" value="NFILE" />
        <add key="Port63" value="whois++" />
        <add key="Port66" value="sql*net" />
        <add key="Port67" value="bootps" />
        <add key="Port68" value="bootpd/dhcp" />
        <add key="Port69" value="Trivial File Transfer Protocol (TFTP)" />
        <add key="Port70" value="Gopher" />
        <add key="Port79" value="finger" />
        <add key="Port87" value="link (a talk/chat style protocol)" />
        <add key="Port80" value="HTTP" />
        <add key="Port88" value="Kerberos, WWW" />
        <add key="Port95" value="supdup" />
        <add key="Port96" value="DIXIE" />
        <add key="Port98" value="linuxconf" />
        <add key="Port101" value="HOSTNAME" />
        <add key="Port102" value="ISO, X.400, ITOT" />
        <add key="Port105" value="cso" />
        <add key="Port106" value="poppassd" />
        <add key="Port109" value="POP2" />
        <add key="Port110" value="POP3" />
        <add key="Port111" value="Sun RPC Portmapper" />
        <add key="Port113" value="identd/auth" />
        <add key="Port115" value="sftp" />
        <add key="Port117" value="uucp" />
        <add key="Port119" value="NNTP" />
        <add key="Port120" value="CFDP" />
        <add key="Port123" value="NTP" />
        <add key="Port124" value="SecureID" />
        <add key="Port129" value="PWDGEN" />
        <add key="Port133" value="statsrv" />
        <add key="Port135" value="loc-src/epmap" />
        <add key="Port137" value="netbios-ns" />
        <add key="Port138" value="netbios-dgm" />
        <add key="Port139" value="NetBIOS" />
        <add key="Port143" value="IMAP" />
        <add key="Port144" value="NewS" />
        <add key="Port150" value="SQL-NET" />
        <add key="Port152" value="BFTP" />
        <add key="Port153" value="SGMP" />
        <add key="Port161" value="SNMP" />
        <add key="Port175" value="vmnet" />
        <add key="Port177" value="XDMCP" />
        <add key="Port178" value="NextStep Window Server" />
        <add key="Port179" value="BGP" />
        <add key="Port180" value="SLmail admin" />
        <add key="Port199" value="smux" />
        <add key="Port210" value="Z39.50" />
        <add key="Port213" value="Novell IPTUNNEL NLM" />
        <add key="Port218" value="MPP" />
        <add key="Port220" value="IMAP3" />
        <add key="Port259" value="ESRO" />
        <add key="Port264" value="FW1_topo" />
        <add key="Port311" value="Apple WebAdmin" />
        <add key="Port350" value="MATIP type A" />
        <add key="Port351" value="MATIP type B" />
        <add key="Port360" value="i2odialogd (SCO Unixware)" />
        <add key="Port363" value="RSVP tunnel" />
        <add key="Port366" value="ODMR (On-Demand Mail Relay)" />
        <add key="Port371" value="ClearCase (source control system from Rational Software)" />
        <add key="Port387" value="AURP (AppleTalk Update-Based Routing Protocol)" />
        <add key="Port389" value="LDAP" />
        <add key="Port407" value="Timbuktu" />
        <add key="Port427" value="SLP (Service Location Protocol)" />
        <add key="Port434" value="Mobile IP" />
        <add key="Port443" value="SSL" />
        <add key="Port444" value="snpp (Simple Network Paging Protocol)" />
        <add key="Port445" value="SMB" />
        <add key="Port458" value="QuickTime TV/Conferencing" />
        <add key="Port468" value="Photuris" />
        <add key="Port500" value="ISAKMP, pluto" />
        <add key="Port512" value="bigg, rexec" />
        <add key="Port513" value="who, rlogin" />
        <add key="Port514" value="syslog, rsh" />
        <add key="Port515" value="lp, lpr, line printer" />
        <add key="Port517" value="talk" />
        <add key="Port520" value="RIP (Routing Information Protocol)" />
        <add key="Port521" value="RIPng" />
        <add key="Port522" value="ULS" />
        <add key="Port531" value="IRC" />
        <add key="Port543" value="KLogin, AppleShare over IP" />
        <add key="Port545" value="QuickTime" />
        <add key="Port548" value="AFP" />
        <add key="Port554" value="Real Time Streaming Protocol" />
        <add key="Port555" value="phAse Zero" />
        <add key="Port563" value="NNTP over SSL" />
        <add key="Port575" value="VEMMI" />
        <add key="Port581" value="Bundle Discovery Protocol" />
        <add key="Port593" value="MS-RPC" />
        <add key="Port608" value="SIFT/UFT" />
        <add key="Port626" value="Apple ASIA" />
        <add key="Port631" value="IPP (Internet Printing Protocol)" />
        <add key="Port635" value="mountd" />
        <add key="Port636" value="sldap" />
        <add key="Port642" value="EMSD" />
        <add key="Port648" value="RRP (NSI Registry Registrar Protocol)" />
        <add key="Port655" value="tinc" />
        <add key="Port660" value="Apple MacOS Server Admin" />
        <add key="Port666" value="Doom" />
        <add key="Port674" value="ACAP" />
        <add key="Port687" value="AppleShare IP Registry" />
        <add key="Port700" value="buddyphone" />
        <add key="Port705" value="AgentX for SNMP" />
        <add key="Port901" value="swat, realsecure" />
        <add key="Port993" value="s-imap" />
        <add key="Port995" value="s-pop" />
        <add key="Port999" value="DeepThroat (key logger)" />
        <add key="Port1114" value="mini-SQL" />
        <add key="Port1062" value="Veracity" />
        <add key="Port1080" value="SOCKS" />
        <add key="Port1085" value="WebObjects" />
        <add key="Port1227" value="DNS2Go" />
        <add key="Port1243" value="SubSeven" />
        <add key="Port1338" value="Millennium Worm" />
        <add key="Port1352" value="Lotus Notes" />
        <add key="Port1381" value="Apple Network License Manager" />
        <add key="Port1417" value="Timbuktu" />
        <add key="Port1418" value="Timbuktu" />
        <add key="Port1419" value="Timbuktu" />
        <add key="Port1433" value="Microsoft SQL Server" />
        <add key="Port1434" value="Microsoft SQL Monitor" />
        <add key="Port1477" value="Microsoft SNA Server" />
        <add key="Port1478" value="Microsoft SNA Server" />
        <add key="Port1490" value="VocalTec Internet Phone" />
        <add key="Port1494" value="Citrix ICA Protocol" />
        <add key="Port1498" value="Sybase SQL AnyWhere" />
        <add key="Port1500" value="ADSM/Tivoli Storage Manager (backup software)" />
        <add key="Port1503" value="T.120" />
        <add key="Port1521" value="Oracle SQL" />
        <add key="Port1522" value="Oracle SqlNet 2" />
        <add key="Port1525" value="prospero" />
        <add key="Port1526" value="prospero" />
        <add key="Port1527" value="tlisrv" />
        <add key="Port1529" value="Oracle SqlNet 2" />
        <add key="Port1547" value="LapLink" />
        <add key="Port1604" value="Citrix ICA, MS Terminal Server" />
        <add key="Port1645" value="RADIUS Authentication" />
        <add key="Port1646" value="RADIUA Accounting" />
        <add key="Port1680" value="Carbon Copy" />
        <add key="Port1701" value="L2TP/LSF" />
        <add key="Port1717" value="Convoy" />
        <add key="Port1720" value="H.323/Q.931" />
        <add key="Port1723" value="PPTP control port" />
        <add key="Port1731" value="Microsoft NetMeeting (audio call setup)" />
        <add key="Port1755" value="Windows Media .asf" />
        <add key="Port1758" value="TFTP multicast" />
        <add key="Port1761" value="SMS v1.2 wuser32.exe" />
        <add key="Port1808" value="Oracle VP2" />
        <add key="Port1812" value="RADIUS server" />
        <add key="Port1813" value="RADIUS accounting" />
        <add key="Port1818" value="ETFTP" />
        <add key="Port1973" value="DLSw DCAP/DRAP" />
        <add key="Port1985" value="HSRP" />
        <add key="Port1999" value="Cisco AUTH" />
        <add key="Port2000" value="NeWS/OpenWin (Sun's older technology like X Windows), RemotelyAnywhere (web server)" />
        <add key="Port2001" value="glimpse" />
        <add key="Port2049" value="NFS" />
        <add key="Port2064" value="distributed.net" />
        <add key="Port2065" value="DLSw" />
        <add key="Port2066" value="DLSw" />
        <add key="Port2106" value="MZAP" />
        <add key="Port2140" value="DeepThroat" />
        <add key="Port2301" value="Compaq Insight Management Web Agents" />
        <add key="Port2327" value="Netscape Conference" />
        <add key="Port2336" value="Apple UG Control" />
        <add key="Port2427" value="MGCP gateway" />
        <add key="Port2504" value="WLBS" />
        <add key="Port2535" value="MADCAP" />
        <add key="Port2543" value="sip" />
        <add key="Port2592" value="netrek" />
        <add key="Port2727" value="MGCP call agent" />
        <add key="Port2628" value="DICT" />
        <add key="Port2998" value="ISS Real Secure Console Service Port" />
        <add key="Port3000" value="Firstclass" />
        <add key="Port3031" value="Apple AgentVU" />
        <add key="Port3128" value="squid" />
        <add key="Port3130" value="ICP" />
        <add key="Port3150" value="DeepThroat" />
        <add key="Port3264" value="ccmail" />
        <add key="Port3283" value="Apple NetAssistant" />
        <add key="Port3288" value="COPS" />
        <add key="Port3305" value="ODETTE" />
        <add key="Port3306" value="mySQL" />
        <add key="Port3389" value="RDP Protocol (Terminal Server)" />
        <add key="Port3521" value="netrek" />
        <add key="Port4000" value="ICQ, Command-n-Conquer" />
        <add key="Port4144" value="CIM (Compuserve Information Manager)" />
        <add key="Port4321" value="rwhois" />
        <add key="Port4333" value="mSQL" />
        <add key="Port4827" value="HTCP" />
        <add key="Port5004" value="RTP" />
        <add key="Port5005" value="RTP" />
        <add key="Port5010" value="Yahoo! Messenger" />
        <add key="Port5060" value="SIP" />
        <add key="Port5190" value="AIM (AOL Instant Messenger)" />
        <add key="Port5222" value="Jabber (Instant Messenging software)" />
        <add key="Port5500" value="securid" />
        <add key="Port5501" value="securidprop" />
        <add key="Port5423" value="Apple VirtualUser" />
        <add key="Port5631" value="PCAnywhere data" />
        <add key="Port5632" value="PCAnywhere" />
        <add key="Port5800" value="VNC" />
        <add key="Port5801" value="VNC" />
        <add key="Port5843" value="IIS Admin Service" />
        <add key="Port5900" value="VNC" />
        <add key="Port5901" value="VNC" />
        <add key="Port6000" value="X-Windows" />
        <add key="Port6112" value="BattleNet" />
        <add key="Port6502" value="Netscape Conference" />
        <add key="Port6667" value="IRC" />
        <add key="Port6670" value="VocalTec Internet Phone, DeepThroat" />
        <add key="Port6699" value="Napster" />
        <add key="Port6776" value="Sub7" />
        <add key="Port6970" value="RTP" />
        <add key="Port7007" value="MSBD, Windows Media encoder" />
        <add key="Port7070" value="RealServer/QuickTime" />
        <add key="Port7778" value="Unreal" />
        <add key="Port7648" value="CU-SeeMe" />
        <add key="Port7649" value="CU-SeeMe" />
        <add key="Port8010" value="WinGate 2.1" />
        <add key="Port8080" value="HTTP" />
        <add key="Port8181" value="HTTP" />
        <add key="Port8383" value="IMail WWW" />
        <add key="Port8875" value="napster" />
        <add key="Port8888" value="napster" />
        <add key="Port10008" value="cheese worm" />
        <add key="Port11371" value="PGP 5 Keyserver" />
        <add key="Port13223" value="PowWow" />
        <add key="Port13224" value="PowWow" />
        <add key="Port14237" value="Palm" />
        <add key="Port14238" value="Palm" />
        <add key="Port18888" value="LiquidAudio" />
        <add key="Port21157" value="Activision" />
        <add key="Port23213" value="PowWow" />
        <add key="Port23214" value="PowWow" />
        <add key="Port23456" value="EvilFTP" />
        <add key="Port26000" value="Quake" />
        <add key="Port27001" value="QuakeWorld" />
        <add key="Port27010" value="Half-Life" />
        <add key="Port27015" value="Half-Life" />
        <add key="Port27960" value="QuakeIII" />
        <add key="Port30029" value="AOL Admin" />
        <add key="Port31337" value="Back Orifice" />
        <add key="Port32773" value="rpc.ttdbserverd" />
        <add key="Port32776" value="rpc.spray" />
        <add key="Port32777" value="rpc.walld" />
        <add key="Port32779" value="rpc.cmsd" />
        <add key="Port38036" value="timestep" />
        <add key="Port40193" value="Novell" />
        <add key="Port41524" value="arcserve discovery" />
        <add key="Port45000" value="Cisco SAFE IDS / NetRanger" />
      </appSettings>
    </configuration>

    ill fix the download.

  8. #8
    something Erlend is offline
    MemberRank
    Dec 2007 Join Date
    Oslo, NorwayLocation
    791Posts

    Re: [VB.Net]Port Scanner

    Woah, this is just complete awesomeness!

    Can i bring a addition? 25565 <- minecraft server

    btw you have to fix download link :)

  9. #9
    Ω -DefaulT is offline
    MemberRank
    Aug 2006 Join Date
    Emerald CityLocation
    1,429Posts

    Re: [VB.Net]Port Scanner

    fixed the download link
    http://default.site40.net/release/PortScanner.zip

    to add another port edit
    App.config

    under
    Code:
    <add key="Port40193" value="Novell" />
    add
    Code:
    <add key="Port25565" value="Minecraft" />
    Example
    Last edited by -DefaulT; 20-10-10 at 11:13 PM.



Advertisement