newbie
newbie

Reputation: 161

Is there a way to get operating systems of remote host in java

I want to learn how I can get the type of operating system of remote host. When I use System.properties, I can learn my machine's properties but is there any way to learn for remote host?

Upvotes: 0

Views: 250

Answers (4)

yǝsʞǝla
yǝsʞǝla

Reputation: 16422

If your machine talks SNMP you could query it for this information. There are Java implementations for SNMP. I would NOT hope that it would usually be the case though.

You could also remotely execute any command to get this info like via ssh or similar.

Some hope in using reverse DNS lookup: how to make reverse dns lookup in Java.

Otherwise you have to use forensics like nmap and such.

Upvotes: 0

Hüseyin BABAL
Hüseyin BABAL

Reputation: 15550

You can use nmap4j for this operation. It is uses nmap on background. And note that, it is bounded with nmap capabilities. This lib only provides you using nmap and parse nmap response. Nmap does not always return you exact information such as operating system

Upvotes: 0

Nicolas Zozol
Nicolas Zozol

Reputation: 7048

You have to ask a remote method and get the result in its return.

Upvotes: 0

Kayaman
Kayaman

Reputation: 73568

No. There are utilities such as nmap that can make an educated guess on an operating system based on open ports and other such things of a remote computer, but that's not Java related and it's not reliable.

Upvotes: 3

Related Questions