Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if a webserver is running Linux or Windows? [closed]

Tags:

linux

windows

I've been asked to find out if a particular site is running Windows or Linux as its webserver - usually we'd have access and I would just upload a phpinfo file and that would give me all the relevant information I need - however we've not been able to get access to FTP details yet.

Is there a simple method using a Firefox plugin like Web Developer Toolbar that will indicate if the server is running Windows/Linux etc?

like image 704
Zabs Avatar asked Apr 18 '12 08:04

Zabs


People also ask

How do I know if my server is Linux or Windows?

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. What about TTL=255?

How do I find out what webserver is running on Windows?

First, fire up the command prompt and type in netstat . Netstat (available in all versions of Windows) lists all active connections from your local IP address to the outside world. Add the -b parameter ( netstat -b ) to get a list by .exe files and services so you know exactly what's causing the connection.

How do you check whether the server is running or not?

Use the following steps to check server uptime by using the systeminfo command: Connect to your cloud server on the command line. Type systeminfo and press Enter. Look for the line that starts with Statistics since , which indicates the date and time when the uptime started.


1 Answers

You can usually get some pretty good clues by looking at the HTTP headers, which you can do using curl (with the -I flag). For example,

$ curl -I www.microsoft.com
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 0
Server: Microsoft-IIS/8.0
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM
INT     NAV     ONL PHY PRE PUR UNI"
X-AspNet-Version: 2.0.50727
VTag: 279958544400000000
X-Powered-By: ASP.NET
X-Powered-By: ARR/2.5
X-Powered-By: ASP.NET
Date: Fri, 20 Sep 2013 20:50:16 GMT

Note the line above that says Server: Microsoft-IIS/8.0. By contrast, try:

$ curl -I www.php.net
HTTP/1.1 200 OK
Date: Fri, 20 Sep 2013 20:53:05 GMT
Server: Apache/2.2.21 (FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q PHP/5.4.16-dev
X-Powered-By: PHP/5.4.16-dev
Content-language: en
Set-Cookie: COUNTRY=USA%2C173.203.108.101; expires=Fri, 27-Sep-2013 20:53:05 GMT; path=/;     
domain=.php.net
Last-Modified: Sat, 21 Sep 2013 02:21:12 GMT
Vary: User-Agent,Accept-Encoding
Connection: close
Content-Type: text/html;charset=utf-8

and, it's pretty clear that this is a LAMP setup.

like image 148
mti2935 Avatar answered Oct 29 '22 01:10

mti2935