How to detect if browser instance is selenium webdriver instance

3,667 views
Skip to first unread message

alext

unread,
Jan 6, 2015, 12:51:50 PM1/6/15
to seleniu...@googlegroups.com

I'm working on solutions to prevent crawlers/bots/spiders etc. working with my site. As part of this work, there is strong JS script which creates cookies based on tonns of JS code which should be rewritten to get the valid session if are talking about "REST clients using c#/python/java etc" combination.

However, the protection is not working if attacker is using selenium webdriver instances which work pretty the same as original browser which means executing JS code without rewriting it.

I'd like to know if there is any property or whatever else of selenium webdriver instance, which can help me identify that the person is using selenium webdriver instance.

  • Please don't suggest checking UA or something else which can be spoofed by attacker's code;
  • Please don't suggest adding event listeners to check if user hovered by mouse any element - it is pretty simple to avoid via WebDriver Actions class;

Suggest only particular "JS code examples/general suggestions" how would you create such protection

Thanks.

Krishnan Mahadevan

unread,
Jan 7, 2015, 3:54:20 AM1/7/15
to Selenium Users
To the best of my knowledge I dont think you have any such mechanism within Selenium/Webdriver that would differentiate between a browser opened up by an actual user Vs a browser opened up via a selenium based automation test.

Selenium by default gurantees that it would open up a site without any cookies. But I guess this statement wouldnt be true in the case of IE. I may be wrong here and I would let Jim Evans correct me if am wrong here.



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9f51d5d-35ac-4a33-92b1-3e1270626d9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Leyba

unread,
Jan 8, 2015, 4:30:10 PM1/8/15
to seleniu...@googlegroups.com
There really isn't anything you can check for with the current implementations.

The upcoming W3C WebDriver spec currently requires a fingerprint to indicate when WebDriver is present: https://w3c.github.io/webdriver/webdriver-spec.html#fingerprinting

Ajay Gupta

unread,
Feb 22, 2017, 3:14:37 PM2/22/17
to Selenium Users
Hi Jason,

Is there any way for detecting selenium in chrome browser?

Thanks
Reply all
Reply to author
Forward
0 new messages