LostGamerz
VB 6.0: Tutorial, Making a Port Scanner 1296785282
LostGamerz
VB 6.0: Tutorial, Making a Port Scanner 1296785282
LostGamerz
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePinoy VendeTaLatest imagesRegisterLog in

 

 VB 6.0: Tutorial, Making a Port Scanner

Go down 
AuthorMessage
Crowd™
Administrator
Administrator
Crowd™


Join date : 31/01/2011
LostPoints : 10383
Thanks & Rep : 28
Posts : 229
Age : 33
Location : 6ret
Warning Level : VB 6.0: Tutorial, Making a Port Scanner WarningBar-Gloss1

VB 6.0: Tutorial, Making a Port Scanner Empty
PostSubject: VB 6.0: Tutorial, Making a Port Scanner   VB 6.0: Tutorial, Making a Port Scanner Icon_minitimeSun Aug 05, 2012 3:56 am

Introduction/Problem:-
Well I was searching the net for a port scanner and you know what! Some of them didn't work, others froze my PC, and others were soooo somplicated with alot of BS! So I decided to make mine and I decided to make a TUT for you my friends!

Usage:-
Well simple, scan an IP for open ports, you can scan your own PC so to see if you have any open ports, if you find any open ports you may be infected from or Virus or trojan and a hacker can connect and can control your PC by connecting to your PC from that port!

Requirements:-
Visual Basic (prefiribly 6.0)

Solution:-

Ok So as usual open VB, and choose Standars EXE, i will not post a picture of this step coz I posted this on other Tuts so if you dont know how see the other tuts!

What you need:-
2 Text boxes ( Text1,Text2 )
1 ListBox ( List1 )
3 Command Buttons ( Command1, Command2, Command3 )
1 Timer ( Timer1 )
1 Winsock Component ( Winsock1 )
If you can't find the Winsock do as below:-

[Only admins are allowed to see this image]

And after a dialog box will be displayed scroll down till you find "Microsoft Winsock Control 6.0 (SP6)"
here is how:-

[Only admins are allowed to see this image]

Ok so now we have everything setup here is the GUI I used, you can make your own, but I will just "inspire' you lol!:-

[Only admins are allowed to see this image]


Ok now that you setup everything its time for the code( I know its a bit long but dont worry I will explain EVERYTHING!):-


Code:
Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = False
Text2.Text = "0"
End Sub
Private Sub Timer1_Timer()
On Error Resume Next
Winsock1.Close
Text2.Text = Text2.Text + 1
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = Text2.Text
Winsock1.Connect
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Text2.Text = "0"
End Sub
Private Sub Command3_Click()
List1.Clear
End Sub
Private Sub Winsock1_Connect()
List1.AddItem Winsock1.RemotePort & " is open!"
End Sub

Code Explanation:-

Code:
Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = False
Text2.Text = "0"
End Sub


Here we are Disabling the timer so when we start our program the it will not start scanning!
and then we are setting Text2 to 0 ( this is the port number to start with )


Code:
Private Sub Timer1_Timer()
On Error Resume Next
Winsock1.Close
Text2.Text = Text2.Text + 1
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = Text2.Text
Winsock1.Connect
End Sub


Here is the main program, when an error is encountered it will still continue,Closes the conenction, increase the port number by 1, and tries to connect!


Code:
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

Start Scanning

Code:
Private Sub Command2_Click()
Timer1.Enabled = False
Text2.Text = "0"
End Sub

Stop and reset the port number to 0

Code:
Private Sub Command3_Click()
List1.Clear
End Sub


Here it clears the list of the open ports that were found!


Code:
Private Sub Winsock1_Connect()
List1.AddItem Winsock1.RemotePort & " is open!"
End Sub

When an open port is found it adds the port number to the listbox!

How does this works?

Just enter an IP ( if you want to scan your own PC go on [Only admins are allowed to see this link] ) and copy the IP and paste it in the Textbox ( text1 ) and hit the command1 button! text2 ( from what port to start scanning )is 0 by default but you can set it to any port number you want!

Complete Source Code:-
Well I included the FULL source code its an attachment, its the complete project just compile and have fun

Ending:-
If you have any questions/problems/feedback pls post here and I will sureley Help you!
So I'm waiting for your feedback
Ow and if you want me to make you some tutorials request what you want and I will see what I can do! I will be happy making some tuts here!

Back to top Go down
https://pinoyvendetta.forumtl.com
 
VB 6.0: Tutorial, Making a Port Scanner
Back to top 
Page 1 of 1
 Similar topics
-
» C# Tutorial - How To Open New Forms
» Basic Decryption Tutorial
» Easy -Swf - Tutorial (For Bym Or Any Game)
»  Basic Decryption Tutorial
» HACK WEBSITE USING SIMPLE SQL INJECTION TUTORIAL.

Permissions in this forum:You cannot reply to topics in this forum
LostGamerz :: Coding Section :: Visual Basic and .NET Framework-
Jump to: