Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there some way to run a command (such as ICMP message or another protocol), get a response from a remote machine (not on my own private local network) and analyze the message to find some evidence that this machine is running a Windows or a Linux operating system?

share|improve this question
    
What do you plan to do with this information? It may not be reliable... – pjc50 Feb 24 '12 at 16:24
    
Actually I was on a custumer last week and he was using a system that prevent anyone to use a Windows system on his network. It was made by a remote server that was not one the same network, I thout it very strange because I didn't know how it was made. – Diogo Feb 24 '12 at 16:33
    
There are any number of ways you might do that. For example, if you are using DHCP to provide network addresses, the DHCP request includes information about the client OS. – Harry Johnston Feb 28 '12 at 21:15
up vote 12 down vote accepted

It isn't definitive but nmap will do this with the command nmap -O -v (see docs for more details) If you're running windows or want a gui, look at zenmap

share|improve this answer
    
Mind you - some providers will detect port scanning using nmap as abuse. – Jeroen Baert Nov 9 '12 at 1:42

If you're on an IPv4 network, just use ping. If the response has a TTL of 128, the target is probably running Windows. If the TTL is 64, the target is probably running some variant of Unix.

share|improve this answer
    
What do you mean by propably? – Dchris Sep 5 '13 at 9:00
    
What about TTL=255? I think is Unix.. – Dchris Sep 5 '13 at 9:01
    
I don't think I've ever seen a TTL of 255. – Harry Johnston Sep 5 '13 at 21:32
: Presumes ping service enabled on Windows local and remote hosts
:
del _IX.txt, Windows.txt
ping -n 1 [computername|ipaddress] | findstr /i /c:"Reply" > ttl.txt
for /f "tokens=1-9* delims=:=< " %%a in (ttl.txt) do (
    if %%i leq 130 (
       if %%i geq 100 (
          echo Windows & rem or echo %%c >> Windows.txt
       ) else (
          if %%i equ 64 (
             echo *IX & rem or echo %%c >> _IX.txt
          )
       )
    )
)
share|improve this answer

One way to go is to use NMap. From the response, it can guess the remote OS.

share|improve this answer

Package: xprobe 'OR' xprobe2
Description: Remote OS identification Xprobe2 allows you to determine what operating system is running on a remote host. It sends several packets to a host and analyses the returned answers. Xprobe2's functionality is comparable to the OS fingerprinting feature in nmap.

Example:
$ sudo apt-get install xprobe
$ sudo xprobe2 -T21-23,80,53,110 ###.###.###.###

Reference:
http://www.sys-security.com/html/projects/X.html
http://sourceforge.net/projects/xprobe/

share|improve this answer

Old post but thought I would add to this too, if the device is SNMP enabled you can also query for the sysDescr which will tell you the OS it is using.

Download a MIB browser, a good one that I use is here: http://www.ireasoning.com/downloadmibbrowserfree.php. You basically give it the IP address of the device and do a walk operation.

share|improve this answer
    
Can you expand your answer to explain how to accomplish that? Thanks. – fixer1234 Jul 22 '15 at 8:14
    
You can download a MIB browser, a good one that I use is here ireasoning.com/downloadmibbrowserfree.php. You basically give it the ip address of the device and do a walk operation – Johnathon64 Jul 22 '15 at 9:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .