views:

657

answers:

12

Assuming that the .php and .aspx extensions have been hidden from the URLs, are there any clues in the HTML that might suggest the site is coded in either php or asp?

Cheers.

A: 

A lot of times ASP.Net websites will have ViewState, so you can look for that attribute in a tag on a page. Other than that, there is no real distinguishable differences (as far as I know) that are noticeable strictly from looking at the page and it's HTML. Granted, there are probably things that are ASP.Net specific - like certain controls such as some third party controls.

MunkiPhD
Also if the viewstate is disabled then what happens.
rahul
as far as author said about aspx extensions, i suppose he meant ASP.NET
Bogdan_Ch
.asp = classic ASP. .aspx = ASP.Net. If it's disabled, then you're out of luck with using that method - thus why I stated "A lot of times"
MunkiPhD
A: 

Look for a form submission page and check what extension the action is submitting to.

It doesn't catch a lot of MVC frameworks, but it does provide a few quick wins.

Steerpike
Just take the source of this page and see.
rahul
+22  A: 

You can take a look at the HTTP headers the server is sending as part of its response, with a firefox extension like LiveHTTPHeaders or firebug.

Sometimes (not always), this information is given in one of those.

For instance, on SO, you only have :

Server: Microsoft-IIS/7.0

On microsoft.com, you have more informations :

Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET

On wikipedia :

Server: Apache
X-Powered-By: PHP/5.2.4-2ubuntu5wm1

And, on sun.com :

Server: Sun-Java-System-Web-Server/7.0

So, depends on the configuration of the server... But it sometimes allow you to get the information you are looking for ;-)


If those headers (and/or others) don't get you the information you need... Having a look at the source of the HTML page, or at the name of some cookies can help ; but generally much harder to say :-(

For cookies, for instance :

  • in PHP, the session id is often stored in a cookie calle PHPSESSID (that's it's default name)
  • in JAVA, I believe there is sometimes a cookie called JSESSIONID


Yet another way is if you can get the server to display a page that shouldn't be displayed to "normal users" -- like an error page : developpers don't always think to hide informations on these ones ; and some webservers include the name of the server at the bottom of technical pages ^^

Or, as a last possibility, you can try "dumb pages" like phpinfo.php, test.php, info.php, and so on : sometimes, developpers forget to remove those -- but it's really an idea that you'll use as a last hope, I suppose ^^

Pascal MARTIN
Good stuff thanks!
Nai
+5  A: 

If the HTML is a mess then you have 90% chance it's been developed in .NET.

Max
No so much the messiness, but the spacing is sometimes a giveaway. Since the ASP.NET controls take up more space than their HTML counterparts (frequently), a page that has been designed to be readable will render with lots of extra spacing in ASP.NET. This is true of MVC as well due to the inline view logic.
tvanfosson
@tvanfosson: Same is true of PHP using eg `<?php foreach () : ?>` (maybe that's what you mean by MVC). Though normally the hint is excessive indentation rather than a lot of new lines.
DisgruntledGoat
Actually the best way to detect .NET is if every form element (inputs, buttons, labels, fieldsets, etc), as well as other page elements, has an ID - particularly generic ones likes "Label1" or "ctl00_ContentPlaceHolder1".
DisgruntledGoat
Don't forget the whole page wrapped in a form tag, hidden viewstate form field with a pile of gibberish, the javascript that takes an eon to load, just so it can capture and override the behavior of LINKS to submit the giant form. The 7 levels of nested tables. The nonsensical misspelled attributes that leak through to the rendered html...
Breton
the other 10% is with ASP.NET MVC
mgroves
A: 

Look at session tokens. PHP by default uses a PHPSESSID cookie name.

Joeri Sebrechts
+2  A: 

Examine HTML, JavaScripts, headers and everything you have carefully and you may get some clues. For example, in StackOverflow HTML you can find code like this

http://ads.stackoverflow.com/a.aspx?ZoneID=0&amp;amp;BannerID=323&amp;amp;AdvertiserID=5&amp;amp;CampaignID=194&amp;amp;Task=Click&amp;amp;SiteID=1

so, it is asp.net (or at least advertisment engine use ASP.NET) :)

However, if author of the web site will be very carefull, he can clean up all clues (and probably even give you wrong clues, like assigning *.PHP files to be processed by aspnet_iisapi filter. Why not ?

When you se controls names like ctl00_Blogs_usercontrols_public_community_latestblogposts_ascx1_repeaterBlogPosts_ctl03_hlTitle this is for sure ASP.NET :)

Also, look at JavaScript function/file/variable names. Sometimes developers use 3rd party products and tools. If you see vendor or product name is a part of javascript name you can search what is it and probably when you define a vendor, you will define a developer platform. For example code like this

Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadContextMenu ...

means that Telerik control is used and Telerik produces only .NET controls.

Bogdan_Ch
+14  A: 

Check the website out @ BuiltWith

Alix Axel
Great link thanks
Nai
I would upvote this, except that whenever you submit a site you're hit with a big ad for their software...
DisgruntledGoat
+1 Yeah, but everyone needs to make a living.
Alix Axel
@eyze: Sure, but it doesn't mean they have to mislead me. All the info is below the fold - I hit Search and all I see is "INSTALL OUR SOFTWARE". (Though at least it's not as terrible as experts-exchange.)
DisgruntledGoat
Agreed, when I first discovered the site it was ads-free now it's annoying with that giant ad.
Alix Axel
Looks like those guys read the comments at SO, and removed their giant ads. I don't see any now!
Bart J
Yep, seems like they do. =)
Alix Axel
+1  A: 

There are clues you can look for as many have pointed out, but I don't believe any of it is really that reliable. If someone really wanted to make you think their PHP site is developed in ASP.NET or vice versa, they probably could.

Keep in mind also that the two aren't mutually exclusive. You could build a single site from both technologies.

Jack Leow
A: 

All the answers are correct, but at the end it is still possible that you can't determine with what a website is built except by asking the developer directly.

nanda
A: 

One possibility to determine whether PHP is installed on the server is described at http://shiflett.org/blog/2006/feb/php-easter-eggs

Try http://yoursite/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42

This can also be disabled by server conf and some people do.

Anti Veeranna
A: 

Send an e-mail to the site administrator saying you really like their site and were wondering what technologies were used to crerate it. Some people are very helpful and will reply (some, of course, aren't or are forbidden by corporate policy).

Jeff Hornby
A: 

You can use a site like : http://www.examineurl.com

You give the URL of the server and it can show you information of the server !

Jérôme