I have a Java code that can create a socket and initiate ssl handshake with a remote host. I need to know what type of OS the remote host is running. Is this possible with Java ? How? If not, any other solutions to make my Java program get this piece of information ?
I have checked similar question in: How to check programmatically the OS of remote host? Unfortunately, no answer was accepted. So, I post the question, possibly someone can provide an answer now.
This is known as Host Fingerprinting, and is a very broad and deep topic with lots of research. Your best bet is to invoke a tool such as nmap in a subprocess and read its output. Remember that even the best fingerprinting algorithm will be easily misled by NAT firewalls and proxies.