Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Port Scanner

Hi guys, im not looking for any help just some advice. I though I make a Port scanner program. Basically I have created a client side program that increments port number starting from 0 to 65000. If a connection is made then that indicates that a program is listening on that port. If no connection is made then there is no program listening in on the port. Now this little program uses a loop to increment the port number starting from 0 to 65000, and I know it will take a very very very long time for the loop to complete.

All I just want to know is that is my program considered a port scanner? The code is below if you want to have a look.

import javax.swing.*;
import java.net.*;

public class PortScanner

{

public static void main(String args[])
{
for(int i=0; i <=65000; i++)
{
try
{
Socket ServerSok = new Socket("ip address here",i);

System.out.println("Port inuse: " + i);

ServerSok.close();
}
catch (Exception e)
{
}
}
}
}

Any help will be very appreciated. :)
[1158 byte] By [major] at [2007-11-11 7:52:24]