Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Tutorials > VB Tutorials

VB Tutorials Visual Basic Tutorials and Code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-2006, 12:10 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Exclamation VB 6.0: Tutorial, Making a Port Scanner

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:-



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



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!:-



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 www.whatismyip.com ) 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!

Tcm9669
Attached Files To view attachments in this forum your post count must be 1 or greater. You currently have 0 posts.

Last edited by Jordan; 10-02-2006 at 12:56 PM. Reason: Picture Location Change
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-22-2006, 07:59 PM
falco85 falco85 is offline
Programmer
 
Join Date: Apr 2006
Posts: 105
Credits: 2
Rep Power: 10
falco85 is on a distinguished road
Default

That is a nice tutorial, I think I'll use this software! I don't know VB that well so I may port this to C# or even C++. Very nice!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-23-2006, 03:38 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Thanks for your feedback! You are Welcome!
Well with this you can even play tricks on your friends!
Just ask them for their op or have their Ip from MSN or so, then scan their IP and for example if you find some port open google it and it CAN give you what prog uses that port, so then you tell your friends ow so you have the program ....... open! and he/she will be like HUH? how do you know that?

Lol its a funny thing to do!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-26-2006, 10:16 AM
gregpab gregpab is offline
Newbie
 
Join Date: Dec 2006
Posts: 1
Credits: 0
Rep Power: 0
gregpab is on a distinguished road
Default

Hi!
How can I get the full source code?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-26-2006, 10:57 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

You need to at least post 5 posts on this CodeCall ( meaning post any other 4 posts where you want ) and then go to the end of the tutorial where you will find:-
Quote:
Attached Files
File Type: zip PortScanner.zip (2.4 KB, 4 views)
Click there and you will download it!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 12-26-2006, 11:00 AM
xXHalfSliceXx's Avatar   
xXHalfSliceXx xXHalfSliceXx is offline
Co-Administrator
 
Join Date: Oct 2006
Location: Hendersonville, NC
Age: 24
Posts: 1,226
Credits: 0
Rep Power: 20
xXHalfSliceXx is on a distinguished road
Send a message via AIM to xXHalfSliceXx Send a message via MSN to xXHalfSliceXx Send a message via Yahoo to xXHalfSliceXx
Default

Yes. I think we might install a double post merge script
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Company
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-26-2006, 11:01 AM
Jordan's Avatar   
Jordan Jordan is online now
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,145
Last Blog:
Ext JS or Ext GWT
Credits: 1
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Just set the rule down to 1 post for downloads.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-09-2007, 12:37 AM
Gaurang Gaurang is offline
Newbie
 
Join Date: Feb 2007
Posts: 3
Credits: 0
Rep Power: 0
Gaurang is on a distinguished road
Default

How do i Post? is this call a post?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-09-2007, 12:42 AM
Gaurang Gaurang is offline
Newbie
 
Join Date: Feb 2007
Posts: 3
Credits: 0
Rep Power: 0
Gaurang is on a distinguished road
Default Like to download PortScanner with Programme attached with Ports

Here i only found the word Message. nowhere i can c a word like a post. so how do i post so i can get the facility of downloading. is this message increment my post status?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-09-2007, 12:45 AM
Gaurang Gaurang is offline
Newbie
 
Join Date: Feb 2007
Posts: 3
Credits: 0
Rep Power: 0
Gaurang is on a distinguished road
Default

Sorry for disturbing you guys. ok now i get it activated and downloaded. thx and sorry for abusing your spaces of good column
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 6.0: Tutorial, How to Make Glass2K!! TcM VB Tutorials 12 09-28-2008 12:53 PM
VB 6.0: Tutorial, How to make a GIF in your application TcM VB Tutorials 17 07-01-2008 04:26 PM
how to communicate with usb port using vb sayantan Visual Basic Programming 10 05-01-2008 04:29 PM
VB 6.0: Tutorial, Explaining the VB 6.0 GUI TcM VB Tutorials 1 05-18-2007 11:25 AM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 04:05 PM


All times are GMT -5. The time now is 08:50 AM.

Contest Stats

WingedPanther ........ 2656.49
Xav ........ 2581.51
Brandon W ........ 1698.26
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 959.05
dcs ........ 646.09
Steve.L ........ 475.59
orjan ........ 407.96
chili5 ........ 380.6

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads