views:

1015

answers:

5

How do we check what programming language a website is using?

I mean something like this:

www.domain.com

How to check its using html, php, aspx, ruby on rails or etc?

I only want to know the mainpage (www.domain.com), not the sub-page (www.domain.com/about/).

+2  A: 

From a theoretical point of view, it's impossible, because you can just have the webserver serve up whatever extension you like, and hide appropriate headers.

In practice, it's easy.

Just append "index.php" or "index.aspx" or similar, until you find one that works :) But as above, if they want to hide it, this doesn't confirm anything.

Noon Silk
I see. I was using your method as well, and some websites wont work that way. Anyway, thanks for the answer, at least I now know that its impossible.
Besides, you can for example have separate ASP, PHP and ASP.NET applications in the same site...
Guffa
iF they're running an app server there need be no index.{anything}
djna
If they've got both ASP and PHP servers set up, and a rewrite rule that redirects each *.aspx request to ASP and each *.php request to the PHP server, then you can't stop "when you find one that works". You really have to try all of them.
MSalters
If its a stateful application (e.g. you have to login), chances are it's using session cookies. The cookie names could also help you figure out if ASP, PHP, etc. is used.
Ates Goral
MSalters: Did you actually read the first sentence, where I said it's impossible? In the 'in practice' part I'm talking about almost all webservers, that aren't trying to hide.
Noon Silk
+6  A: 

Point of order: They all use HTML.

In other news; various frameworks and langauges send X-Powered-By HTTP headers, some sites are truthful in their use of file extensions, and some sites actively work towards hiding the programming language in use. And even if index.php works, that doesn't mean they are using PHP; it could mean that they have their server set up to pretend .php means ASP.NET; just as easily.

The best way of telling is usually to look at the produced HTML; most languages carry with them styles of HTML; some more telling than others. (ASP(.NET) sites are usually frightfully easy to spot.)

A better question, perhaps, is Why do you care? What does it matter to you what language the site is written in?

Williham Totland
HTML isn't a programming language.
Noon Silk
@silky - That doesn't have anything to do with the fact that web sites are written in HTML.
Chris Lutz
Good point about ASP.Net - viewstate would tend to be a dead give away.
Andrew M
Lutz: Well no, that's obvious though. Williham was being smart and suggesting that the OP didn't clarify server or client language, when infact it *is* clear, because the title of this question is "... what *programming* language".
Noon Silk
Not just viewstate, but HTML ids like "ctl00_xxxxxxx" are a giveaway too.
JulianR
A: 

You can't possibly tell.

e.g. if you look At Amazon's home page, that will talk to approx 100 different services to populate various sections of the page. You can't determine what language those services are written in (I believe Amazon uses a variety of different languages).

Brian Agnew
A: 

It should theoretically be impossible to tell, but you can scan the HTTP header and html for artifacts, as well as the file extensions used in URLs.

Netcraft uses several advanced methods to determine the operating system a host is running, which is at least marginally related to determining what kind of software a host is running.

http://uptime.netcraft.com/up/accuracy.html

lcv
A: 

I sometimes type in /admin in the url to see if the site is built with Django. Those who do rarely changes the default login template.

Thierry Lam