Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

remote  udp  port scanning

Thread view: 
AmitMeMe@gmail.com - 22 Apr 2006 06:04 GMT
Hi:
> I have a question. As we know, scanning TCP ports is a lot eaiser
than UDP
> ports because active UDP ports don't respond and there are other
reasons as
> well.
>
> try{
> Socket soc= new Scoket(address, portnumber);
>
> }
>
> catch(Throwable e){ System.out.println(e)}
>
> look at the code above, it can only tell you active TCP ports for the
> Throwable e tells you nothing about UDP ports. An active UDP port
doesn'
> respond to the connection call "soc". Therefore it will throw an
> exception(connection refused) after trying to connect an active UDP
port.
> This exception is just like those of closed TCP ports.
>
> What i am saying is that active UDP ports will be treated the same as
closed
> TCP ports. They are hidden in closed TCP ports. How do i sift them
out? Any
> solutions?
Gordon Beaton - 22 Apr 2006 08:26 GMT
> Socket soc= new Scoket(address, portnumber);

> look at the code above, it can only tell you active TCP ports for
> the Throwable e tells you nothing about UDP ports. An active UDP
[quoted text clipped - 3 lines]
>
> This exception is just like those of closed TCP ports.

The Socket class is TCP only and has absolutely no relevance to UDP.
Similarly, TCP and UDP ports have nothing to do with each other.

If the Socket constructor throws an exception, it's because it failed
to connect to the specified TCP port. It says nothing about whether
the corresponding UDP port is active or not.

Instead you need to create and connect() a DatagramSocket, then
attempt to send() a datagram. Note that with UDP, connected only means
that the DatagramSocket is (locally) associated with a specific remote
address. Unlink TCP, no connection is actually established, so you
need to actually send a datagram to determine whether the remote is
active.

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.