views:

1248

answers:

13

If there is no file extension on the end of the URL, how can I find out which programming language - PHP, .Net, ASP, etc. - was used to write a particular website?

For example - www.andromeda.mn.

Answers:

uptime.netcraft.com/ -- Dave Webb

builtwith.com -- Jason M

Insert after url ?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 -- thomasrutter

using HTTP header viewer tool -- thomasrutter

+8  A: 

If the developer don't care, they would leave the extension at the end of the URI for languages that uses the files in their URI (.php, .asp, etc.)

If the developer does care if you know what language they used, they could hide it (the .php files actually contains .asp code and the server treats them as asp code).

In short, you won't know unless the developers tell you.

MrValdez
While this is true, you can usually deduct by the type of server and hints you find in the html.
Chuck Conway
@Charles, there's nothing preventing the developer from changing the server name returned by the server (instead of APACHE, it would return IIS). For the html hints, they could change the framework to use different html ids and tags (Created by Microsoft Word Meta tags)
MrValdez
+1  A: 

Normally you can find that out from the extensions seen in the url. But that is not always correct as one can define any extension by doing configurations in webserver.

Bhushan
+5  A: 

If you do view > source in your browser, you can see the markup of the page.

Usually, this will contain some artifiacts of the language used to create the site.

E.G., asp.net pages may have viewstate etc.

This requires knowing details of each implementation and if the site is careful enough they may use obfuscation, or may devoid their markup of any good clues. So, its not sure bet, but I'd bet it applies to the majority of sites

TJB
ASP.NET doesn't always have viewstate. In fact, IMHO, it is better without it.
Jon Winstanley
Mos def, just the 1st thing that popped into my mind...
TJB
Well, my scripts return valid XHTML markup (and only that) with no language-specific artifacts whatsoever, no matter what language I wrote them in. Good luck trying to find that which is not there ;)
Piskvor
I agree, that's why I said usually. ;) But, most people use tools that spit out recognizable markup or some metadata. Of course, you could always go ahead and just obfuscate the whole thing too.
TJB
A: 

You can attempt to view source and see if there are any comments in the HTML that might indicate what is used for server side programming, but without the file extension, it may be tough.

Alan
+11  A: 

In short, if the developer doesn't want you to know, there's no way you can know.

HTTP doesn't specify any information about what handled the request on the server side. I could write an ASP.Net page and a PHP page which could return exactly the same response given a request.

If you really want to find out, I'd suggest:

  1. Looking at the file extension of the page you're accessing. If it's something like .php or .asp or .aspx, you can pretty safely assume it's the appropriate language. This can be faked easily if someone is motivated though.
  2. Looking at the html source as TJB and Alan mentioned.

If these don't give you any hints, maybe write to the webmaster?

Damovisa
It's true that HTTP doesn't specify this, but the default configuration of your server might, and in the case of PHP on Apache, it does. Of course, this option can be turned off.
thomasrutter
Just because there's mod_php enabled for that apache doesn't mean that there is even a single php page served up by that server.
innaM
A: 

You can find out which server a site uses - which might help you guess which language they're using at the Netcraft Website.

For example, here's what they have to say about biznetwork.mn.

Dave Webb
And what exactly does this tell us about the language behind the site?
innaM
I did say it "might help". For example, if a site is using Apache then it's not using ASP.
Dave Webb
@Webb Bad example: http://www.apache-asp.org/
Ward Werbrouck
@Manni - this at least tells you they are using lighttpd as a server. Better than nothing.
thomasrutter
From a quick look Apache-ASP is something that apes a small subset ASP syntax; it's not proper ASP.
Dave Webb
+3  A: 

I have tried to use builtwith.com before. It usually works pretty well, but not perfect.

jimiyash
+2  A: 

biznetwork.mn is using PHP5.

If you add the text

?=PHPE9568F34-D428-11d2-A769-00AA001ACF42

to the end of a URL on the site such as the root URL, if you see a PHP logo it is confirmation that they are running PHP. If you add

?=PHPE9568F35-D428-11d2-A769-00AA001ACF42

then you will see a Zend engine logo which is clearly different between PHP 4 and 5 (Zend engine II means PHP5).

Seeing these logos will indicate that they are using PHP. Please note however that they can be disabled, and some websites will disable them because they don't want you to know they are using PHP. Not seeing them is no indication that they're not using PHP.

thomasrutter
+1  A: 

biznetwork.mn is using:

  • PHP/5.2.4-2ubuntu5.4
  • Symfony framework
  • lighttpd/1.4.19 server
  • Ubuntu 5.4

This can be determined by looking at the HTTP headers from the site - you can use this HTTP header viewer for that.

Note that it is possible to disable the X-Powered-By: identification in PHP and Server: identification, so not seeing this notice is no indication that they not using PHP. It's just another thing you can try. But you can get a ton of clues from looking at headers like this.

thomasrutter
A: 

Yet another method to try is to add the text

index.php

to the root URL of the site. It you see the home page, they are probably using PHP. If you see a 404, then it is unlikely, though they may have done something to prevent this working.

Chances are relatively good that this will work even if they have taken other measures to prevent revealing what they are using. It's not wholly reliable though.

You could extend this to other languages, for instance ASP often uses index.asp or index.aspx as an entry point.

biznetwork appears to be using PHP because index.php works whereas other URLs like index.aspx don't work.

thomasrutter
On the other hand, this would work on many sites I've visited that don't necessarily run php. If `www.foo.com/page/` is valid, `www.foo.com/page/anything_else` would be treated as `www.foo.com/page/` if invalid. I don't recall specifically any sites that do this, but perhaps somebody else does?
Wallacoloo
Well, Stack Overflow just happens to do that. Try `http://stackoverflow.com/questions/641646/blah` for example
Wallacoloo
A: 

So one answer nobody has said is to simply email the webmaster of the site or use their contact form and ask them.

A surprising number of them don't mind telling you what they used. This is assuming you don't need an automated solution for some reason.

Jeremy Wall
No one except @Damovisa, who said, "If these don't give you any hints, maybe write to the webmaster?"
Nosredna
your right. How did I miss that?
Jeremy Wall
A: 

At a previous place of employment the answer to 'what language is behind the server' was 'all of them'. The front of the website was an apache forward proxy that handled the authentication and authorization (mod_perl) and then forwarded the request on to whatever web server was specified - foo.bar.com/qux/ would could go to an IIS server while foo.bar.com/baz/ could go to a weblogic server for j2ee and jsp and foo.bar.com/blarg/ would go to an apache server for cgi.

Without someone poking at it to see what forms of index.??? work there is no way to be guess what was used.

Furthermore, a .cgi extension just means it handles things through the common gateway interface. It could be C, perl, python, tcl, java or a shell script that runs the code.

Michael Turner