John
John

Reputation: 4028

Check port function

How can I check that which port for which function in java ? Example:

Port xx is for webserver

Port xx is for fpt server

port xx is for mail server. ...

Thanks

Upvotes: 0

Views: 413

Answers (1)

Matten
Matten

Reputation: 17621

Unless you're opening connections to the ports and trying every possible server protocol, you won't be able to check which service is accessible through a given port.

An example: Port 80 ist HTTPd, but the server admin could map port 80 to smtpd, so you have to connect to the port and try http, smtp, ssh, ....

Edit

I would say it's only feasible for some protocols like HTTP and SMTP. If the server side is encrypted, you can't tell which service is answering. There are lots of possible services (check the first comment's link), encrypted services, and other problems awaiting you :)

Upvotes: 3

Related Questions