[HC Official] Port Scanner - static_cast - 05-21-2013
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.php?action=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?☑☐
RE: [HC Official] Port Scanner - noize - 05-21-2013
I think you're a very good coder. Jaja.
Unluckily, I don't know VB and so I won't be able to give any source feedback.
RE: [HC Official] Port Scanner - static_cast - 05-24-2013
Version 1.2 is out now! Go get it will it lasts. XD
RE: [HC Official] Port Scanner - noize - 05-24-2013
(05-24-2013, 08:40 PM)static_cast Wrote: Version 1.2 is out now! Go get it will it lasts. XD
Timeout is a good add and saving too. Just how about having the "Save" btn appear when there's something to save only. It also covers the down-arrow to scroll the output there.
I'd also suggest you to have "port scanner" typograph with an image instead of static text and to have it a bit tauter on the height.
Is the "Total scan time" in format h:mm .s/1000? If it is it took 28 minutes to scan www.google.com; don't know if you can do anything to speed it up, but if you could do, really anything, it'd be obviously lots better.
RE: [HC Official] Port Scanner - static_cast - 05-25-2013
(05-24-2013, 10:29 PM)noize Wrote: (05-24-2013, 08:40 PM)static_cast Wrote: Version 1.2 is out now! Go get it will it lasts. XD
Timeout is a good add and saving too. Just how about having the "Save" btn appear when there's something to save only. It also covers the down-arrow to scroll the output there.
I'd also suggest you to have "port scanner" typograph with an image instead of static text and to have it a bit tauter on the height.
Is the "Total scan time" in format h:mm .s/1000? If it is it took 28 minutes to scan www.google.com; don't know if you can do anything to speed it up, but if you could do, really anything, it'd be obviously lots better.
1) Thanks, will do.
2) ?
3) H:mm .ms, I believe you are correct. The only way to tell if it took 28 minutes is to time it yourself. For me, I have an issue with port 21 or 21 [idk which one], and it freezes for a long time.
EDIT: Uh oh~! I can't find my project files. Oh noes!!1!
RE: [HC Official] Port Scanner - noize - 05-25-2013
(05-25-2013, 12:57 AM)static_cast Wrote: (05-24-2013, 10:29 PM)noize Wrote: Timeout is a good add and saving too. Just how about having the "Save" btn appear when there's something to save only. It also covers the down-arrow to scroll the output there.
I'd also suggest you to have "port scanner" typograph with an image instead of static text and to have it a bit tauter on the height.
Is the "Total scan time" in format h:mm .s/1000? If it is it took 28 minutes to scan www.google.com; don't know if you can do anything to speed it up, but if you could do, really anything, it'd be obviously lots better.
1) Thanks, will do.
2) ?
3) H:mm .ms, I believe you are correct. The only way to tell if it took 28 minutes is to time it yourself. For me, I have an issue with port 21 or 21 [idk which one], and it freezes for a long time.
EDIT: Uh oh~! I can't find my project files. Oh noes!!1!
2. the port scanner text upon the HC logo. Well, that's not a big matter but,.. well, later today I'll upload an image of what I meant.
3. Well, that actually took much time, I'm pretty sure. I'll later try excluding port 21 ("port 21 or 21" ?) and scanning again to let you know.
EDIT: Oh, noise!
Actual edit:
Code: Scanned ports: 1-20, 3389
Target: www.google.com
Total scan time: 0:7:23.89
That's also to be said that the last time I launched a port scan (28 minutes) I had my RAM and CPU more jaded, so I'm not sure if it's a matter of port 21 or not. I'll just launch a 1-80,3389 scan again now and let you know.
Edit: 10 minutes for ports 1-80,3389 on www.google.com. I guess it's not a matter of port 21.
RE: [HC Official] Port Scanner - static_cast - 05-25-2013
Here's the deal: google.com will have a LOT of closed ports, so you have to wait (timeout) every time there is a closed one. [which makes sense, but I wish it could be improved]
1) Does anybody mind writing a description? All I have is, "A port scanner." XD
2) Does anybody mind writing a sample output file? I don't really like mine:
Scan started at x. Elapsed time: x
Host: x | Ports: x | Timeout: x
I suggest timeout 100 or 250, btw.
RE: [HC Official] Port Scanner - noize - 05-25-2013
(05-25-2013, 03:54 PM)static_cast Wrote: 2) Does anybody mind writing a sample output file? I don't really like mine:
Scan started at x. Elapsed time: x
Host: x | Ports: x | Timeout: x
I suggest timeout 100 or 250, btw.
How about this?
Code: #####################################################
## ##
## HC Official Port Scanner ##
## ##
## Coded by static_cast ##
## at www.hackcommunity.com ##
## ##
#####################################################
----------------------------------------------------
Time format: [h:m.s]
Scan started at: [2:15.06] PM
Scan ended at: [2:17.40] PM
----------------------------------------------------
________________________________
Target: |www.google.com |
Ports range: |1-20,443 |
Timeout: |100ms __________________________|
----------------------------------------------------
Or this (I like better this latter one):
Code: #####################################################
## ##
## HC Official Port Scanner ##
## ##
## Coded by static_cast ##
## at www.hackcommunity.com ##
## ##
#####################################################
----------------------------------------------------
Time format: [h:m.s]
Scan started at: [2:15.06] PM
Scan ended at: [2:17.40] PM
----------------------------------------------------
Target: www.google.com
Ports range: 1-20,443
Timeout: 100ms
----------------------------------------------------
And I was using 100ms as timeout.
RE: [HC Official] Port Scanner - static_cast - 05-25-2013
You have an interesting time format. I prefer h:m .ms, for total time.
I like the bottom one better, but I don't really like the huge credits.
RE: [HC Official] Port Scanner - noize - 05-25-2013
I like the bottom one better too.
How about this?
Code: #####################################################
## HC Official Port Scanner ##
## Coded by static_cast at www.hackcommunity.com ##
#####################################################
----------------------------------------------------
Time format: [h:m:s.cs]
Scan started at: [2:15:06.33] PM
Scan ended at: [2:17:40.12] PM
----------------------------------------------------
Target: www.google.com
Ports range: 1-20,443
Timeout: 100ms
----------------------------------------------------
|