Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect whether a site is build on sitecore

Tags:

c#

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 '/sitecore/login' 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 'sitecore/login' 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!

like image 999
Filip Huysmans Avatar asked Nov 29 '22 00:11

Filip Huysmans


2 Answers

There will always be a way to shield that Sitecore is in use. That being said; there are some Things you could be looking at - default settings which, in my experience, are seldom changed by Sitecore administrators and developers.

Cookies

SC_ANALYTICS_GLOBAL_COOKIE
SC_ANALYTICS_SESSION_COOKIE

If your request sends you either of these cookies, I'd Wager it is a safe bet to assume it's a Sitecore solution.

Requesting known media

Requesting this file should only work on Sitecore. But will only work for Sitecore versions 7 and up.

/~/media/System/Template%20Thumbnails/audio.ashx

or

/~/media/System/Simulator%20Backgrounds/blackberry.ashx

(the last one should work on Sitecore 6.6 as well)

or

/layouts/System/VisitorIdentification.aspx

None of these are guaranteed to work. However if you do get a "hit" on either of these, it would be a strange coincidence indeed if it wasn't a Sitecore solution behind the scenes.

like image 92
Mark Cassidy Avatar answered Dec 09 '22 06:12

Mark Cassidy


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.

like image 25
jammykam Avatar answered Dec 09 '22 07:12

jammykam