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!
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.
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.:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With