• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I find out what services occupy which port?

 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,
I ran a port scanner Java program (taken from the O'reilly Java Networking Book). The program identified various servers running on my localhost machine (localhost). My question is, what do I do to find out the names of the services/servers which are running on the ports? Here is the output of the program:
There is a server on port 7 of localhost
There is a server on port 9 of localhost
There is a server on port 13 of localhost
There is a server on port 17 of localhost
There is a server on port 19 of localhost
There is a server on port 21 of localhost
There is a server on port 25 of localhost
There is a server on port 80 of localhost
There is a server on port 110 of localhost
There is a server on port 135 of localhost
There is a server on port 443 of localhost
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are all standard port numbers.
Since you're running a SMTP(25) server, web server(80 and 443), FTP server(21), and POP(110) server, I'm guessing this is a UNIX-like machine, in which case you've got the file /etc/services in which you can look up names the port numbers.
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ernest for the reply. Actually, I'm running a Win 2K pro box. DO you know a way to find out the names of these services in this system? I know the standard services such as SMTP, but sometimes there are other open ports which I'm not sure what they are serving to the Internet. Thanks.
 
Abdul Basit
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am also working on this , well i am trying to send http packet on port 80 and waiting for the reply from the server so i find out which server is running on this port but still i not get any success . if u find any solution so plz update me .
Thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MABASIT --
Welcome to JavaRanch!
We don't have many rules round these parts, but we do have our naming policy which requires a first and last name. Please head over here and update your display name, pronto! Thanks, parder, and hope to see you around the Ranch!
Now, as to your question: you're trying to identify what particular brand of web server is running on a machine?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest --
Well, the official port number registry is at http://www.iana.org/assignments/port-numbers; servers are supposed to use only the ports assigned to them by the IANA. But of course, our friends in Redmond think they are above such things, so they just use whatever they damn well please. Here's a document that has a more pragmatic approach.
 
Anurag Gupta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Windows following file contains port numbers for well-known services defined by IANA :
C:\WINNT\system32\drivers\etc\services
 
Abdul Basit
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but if i am scaning a network system so how it is possible ?
I think this is not the right way of doing this .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!