I need to find the type of OS installed in a Remote Machine. I know that, I can use OS Finger Printing Tools like NMap to detect the OS specific details of the Remote Machine. But I can't use such tool, since there are some licensing issues. I need to implement my own logic to detect OS. On my search I have found a link that we can find the OS type based on TTL. But using TTL is not always accurate. It is based on hop calculation.
There will be some open ports in a machine. By scanning that we can somehow manage to find the OS.
Is there any such Port which might give some idea about OS type? I need to implement a logic to run a Script based on OS. If there are some conditions which is useful to detect the OS type then It might save some time.
if(IsOpen(Some_Port_Number))
{
//This machine might be a windows based one so
if(Run_WindowsBasedScript()==False)
{
Run_LinuxBasedScript();
}
}
else
{
if(Run_LinuxBasedScript()==False)
{
Run_WindowsBasedScript();
}
}
So I need to reduce the run time by identifying the OS type.I thought based on open ports we can find OS. Any Help would be appreciated.