Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Source] Port Scanning Utility
#1
[Image: 9JZqa.png]

Full Codes:
Code:
Imports System.Net.Sockets, System.Threading, System.Net

Public Class Form1

    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
        Label1.Text = "Threads: " & TrackBar1.Value
    End Sub

    Dim Active As Boolean
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Active Then
            Toggle(True)
        Else
            Toggle(False)

            ListBox1.Items.Clear()
            ProgressBar1.Maximum = NumericUpDown2.Value + 1
            ProgressBar1.Minimum = NumericUpDown1.Value
            ProgressBar1.Value = NumericUpDown1.Value

            Try
                Dim Host = Resolve(TextBox1.Text)
                For O = 0 To TrackBar1.Value - 1
                    Dim T As New Thread(AddressOf DoScan)
                    T.Start(New Object() {NumericUpDown1.Value + O, NumericUpDown2.Value, TrackBar1.Value, Host, NumericUpDown3.Value})
                Next
            Catch
            End Try
        End If
    End Sub

    Private Sub Toggle(ByVal b As Boolean)
        NumericUpDown1.Enabled = b
        NumericUpDown2.Enabled = b
        NumericUpDown3.Enabled = b
        TrackBar1.Enabled = b
        Button1.Text = If(b, "Begin", "Cancel")
        Active = Not b
    End Sub

    Private Sub DoScan(ByVal data As Object)
        For I = data(0) To data(1) Step data(2)
            If Not Active Then Exit For
            Output(Scan(data(3), I, data(4)), I)
        Next
    End Sub

    Delegate Sub OD(ByVal open As Boolean, ByVal port As Integer)
    Private Sub Output(ByVal open As Boolean, ByVal port As Integer)
        If InvokeRequired Then
            Invoke(New OD(AddressOf Output), open, port)
        Else
            If open Then ListBox1.Items.Add(port)
            ProgressBar1.Value += 1
            If ProgressBar1.Value = ProgressBar1.Maximum Then Toggle(True)
        End If
    End Sub

    Private Shared Function Resolve(ByVal host As String) As IPAddress
        Return Dns.GetHostEntry(host).AddressList(0)
    End Function

    Private Shared Function Scan(ByVal host As IPAddress, ByVal port As Integer, ByVal timeout As Integer) As Boolean
        Using T As New Socket(2, 1, 6)
            Try
                T.BeginConnect(host, port, Nothing, 0)
                Dim I = Now.AddMilliseconds(timeout)
                While Now < I
                    Thread.Sleep(1)
                    If T.Connected Then Return True
                End While
            Catch
            End Try
        End Using
    End Function
End Class

I don't claim to be the author of this source.
USB Anti-virus? Try USB Drive Defender
[Image: 8bQCusS.jpg]
Reply
#2
Havent seen this on Supportforums before, thanks for bringing this out for us mate
[Image: NfAze.gif]
Reply
#3
Thanks for sharing..

(05-15-2011, 06:12 PM)euverve Wrote: I don't claim to be the author of this source.
If you remember, you should give a shout out to the original Author.
Reply
#4
(05-16-2011, 08:01 PM)KoBE Wrote: Thanks for sharing..

If you remember, you should give a shout out to the original Author.

Here is the video in youtube.
Code:
http://www.youtube.com/watch?v=HwNjA0UPgYA

Website:
Code:
http://www.elitevs.net/

Now I remember I got this from Aeonhack's website.
USB Anti-virus? Try USB Drive Defender
[Image: 8bQCusS.jpg]
Reply
#5
Vouch for you, You had made a cool VB App Smile
[Image: UTLN2.gif]
That's not my Sig . So don't flame me.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] Print Spooler Utility euverve 0 942 03-26-2013, 08:52 AM
Last Post: euverve
  Free Advanced Port Scanner SOURCE [ VB.NET ] Filefinder 6 5,355 01-22-2013, 04:27 AM
Last Post: TalishHF
  [Source ] Hemp Tycoon App [/Source] VB.net KoBE 8 9,359 03-05-2012, 10:30 PM
Last Post: SomeWhiteGuy?
  [Source]Sql Database Project [Source] Digital-Punk 0 1,358 10-16-2011, 07:01 AM
Last Post: Digital-Punk
  [Source]Batch to Exe converter[Source] Digital-Punk 6 2,669 10-15-2011, 03:00 AM
Last Post: Digital-Punk

Forum Jump:


Users browsing this thread: 1 Guest(s)