Filip Huysmans Filip Huysmans - 1 year ago 80
C# Question

Detect whether a site is build on sitecore

I am building a webpage that gives statistics about websites of the user.

You enter your URL and get a bunch of results.

My main focus are websites that are build on the Sitecore cms.

At the moment I can detect if the site uses Sitecore only when the

page is availabe.

For this I use:

var webclient = new WebClient();
var source = webclient.DownloadString(url);

But when admins decide to crank up the security they can make
unaccessible for random users.
When this is the case my code obviously does not work.

Does anyone know a better solution how to detect if the Sitecore cms is used?

Remember it is an external website so no access to the sitecore backend.

(p.s. I do not want to use 3th party tools)

Thanks in advance!

Answer Source

Common one would be to check if .ashx is used for a media extension, or they are prefixed with /~/media/ or /-/media/ but all of these are obviously subject to change depending on config settings. This would require you to check the source code too.

You could check for other Sitecore files, but again depending on the deployment these may or may not be there or accessible to the public at least. I would look for files outside of the /sitecore folder, e.g.:

  • default.aspx
  • default.css
  • default.js
  • webedit.css

You need to check the contents of the files to make sure they are default Sitecore files. You are relying on the fact that these files would be left over from a default installation, but there is no guarantee so there may be no possible way of being able to tell.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download