[HC Official] Port Scanner 05-21-2013, 09:18 PM
#1
Hack Community Remote Administration Tool
Version 1.2 [IS OUT NOW!!]
Hello [username].
I have written a port scanner in VB for the community's own use.
Download Links:
http://static_cast.home.comcast.net/ports.zip
https://dl.dropboxusercontent.com/u/125590256/ports.zip
![[Image: ns1.jpg]](http://s7.postimg.org/jg3tip5lz/ns1.jpg)
![[Image: ns2.jpg]](http://s23.postimg.org/p49dbkdav/ns2.jpg)
![[Image: results.jpg]](http://s9.postimg.org/o3p9fjaxn/results.jpg)
Donate HC Coins:
http://www.hackcommunity.com/newpoints.p...ion=donate
VB Code:
Code:
Option Strict On
Imports System.Net.Sockets
Imports System.IO
Public Class Form1
Dim startTime As DateTime
Private Function ScanPort(address As String, port As Integer, timeout As Integer) As Boolean
Dim client As New TcpClient
Dim connected As Boolean
Try
client.BeginConnect(address, port, Nothing, Nothing)
For index = 0 To timeout
Threading.Thread.Sleep(1)
If client.Connected = True Then
connected = True
index = timeout
End If
Next
Catch ex As SocketException
connected = False
Finally
client.Close()
End Try
If connected = True Then
ListBox1.Items.Add("Port " + port.ToString() + " status: Open")
TextBox3.AppendText(port.ToString() + ",")
Else
ListBox1.Items.Add("Port " + port.ToString() + " status: Closed")
End If
Return connected
End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim endTime As DateTime
Dim totalTime As TimeSpan
startTime = Now
ListBox1.Items.Clear()
TextBox3.Clear()
Dim address As String = TextBox1.Text
Dim ports As String = TextBox2.Text
Dim timeout As String = TextBox4.Text
Dim temp1(), temp2() As String
temp1 = Split(ports, ",")
For Each item In temp1
If CBool(InStr(item, "-")) Then
temp2 = Split(item, "-")
For index As Integer = CInt(temp2.ElementAt(0)) To CInt(temp2.ElementAt(1))
ScanPort(address, index, CInt(timeout))
Next
Else
ScanPort(address, CInt(item), CInt(timeout))
End If
Next
endTime = Now
totalTime = endTime - startTime
Label9.Text = CStr(totalTime.Hours) + ":" + CStr(totalTime.Minutes) + ":" + CStr(totalTime.Seconds) + "." + CStr(totalTime.Milliseconds)
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim openPorts() As String = Split(TextBox3.Text, ",")
Dim results(ListBox1.Items.Count) As String
Dim totalTime As String = Label9.Text
Dim filename As String = "results_" & startTime.ToString("yyyy-MM-dd_HH-mm-ss") & ".txt"
MsgBox(filename)
For index = 0 To ListBox1.Items.Count - 1
results(index) = ListBox1.Items(index).ToString()
Next
Try
Using writer As StreamWriter = New StreamWriter(filename, False)
writer.WriteLine("Scan started at " + startTime.ToString("yyyy-MM-dd [HH-mm-ss]") + ". Elapsed time: " + totalTime)
writer.WriteLine("host: " + TextBox1.Text + " | ports: " + TextBox2.Text + " | timeout: " + TextBox4.Text)
writer.WriteLine()
writer.WriteLine("Open ports:")
For index = 0 To openPorts.Length - 2
writer.WriteLine("Port " + openPorts(index) + " is open.")
Next
writer.WriteLine()
writer.WriteLine("Scan details:")
For index = 0 To results.Length - 1
writer.WriteLine(results(index))
Next
End Using
Catch ex As Exception
MsgBox(ex.Message())
End Try
End Sub
End Class
Known Issues:
_☐_ - None
Update 1.3 Features:
_☐_ - None
Future Features:
_☐_ - Skins
_☑_ - Saved searches
--
I wouldn't mind 10 HC coins per download, eh?☑☐
Apparently to the media, the best hacking tool around is a magnifying glass to the monitor. Ooh, pretty colors.
![Biggrin Biggrin](https://sinister.ly/images/smilies/set/biggrin.png)