Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

How is this website detecting SELENIUM?! Spent hours...

So there is this chat website where you go, click "connect as guest", enter your username, complete a ReCaptcha v2, click "CONNECT" and you're in.

If I do this in my browser, it works normally. If I do this in the chromedriver browser controlled by selenium, I get an error. (The error is "please enter the captcha", but that's irrelevant. The server is clearly detecting me because there is a special response coming from the server, triggering this error)

Important: in both cases (my browser and chromedriver browser), I'm doing everything 100% manual! I just use selenium to launch the browser and then proceed from there. I even tried adding an option to the chromedriver browser to use my actual browser settings. It loads with my history, cookies, everything. But when I try to enter the chat room, I get the error.

I also looked online and found some people claiming websites could detect selenium by noticing some specific javascript variable "cdc_". I've edited the hex code of the chromedriver, changed the variable as instructed online, tried again, same result. I spent hours trying to figure this out...

There is one interesting thing that could help find the problem: If I have my browser opened and I try to run the python script with the chromedriver using my profile, the chromedriver browser will start and the python code will return an error saying the profile is already in use (but the browser will remain opened). Now if I try to access the chat room with this chromedriver browser, it works.
Cookies, headers, user agent, stuff from https://webkay.robinlinus.com .

There's a ton of function calls that selenium does like callPhantom (https://stackoverflow.com/questions/3322...romedriver)
(Sep 13, 2020 12:00 PM)Charger Wrote:  Cookies, headers, user agent, stuff from https://webkay.robinlinus.com .

There's a ton of function calls that selenium does like callPhantom (https://stackoverflow.com/questions/3322...romedriver)

As I said, I used the same user profile I use on my browser. Everything was 100% the same (cookies, cache, history, everything).
I looked at the requests through Fiddler and in both cases the headers are 100% identical. And I mean 100%. Even the session id is the same.
(Sep 13, 2020 12:11 PM)SIM-2362662 Wrote:  As I said, I used the same user profile I use on my browser. Everything was 100% the same (cookies, cache, history,  everything).
I looked at the requests through Fiddler and in both cases the headers are 100% identical. And I mean 100%. Even the session id is the same.

It’s not. Mess with the JavaScript from the SO link I provided in chrome and from your program and you’ll see it’s different
(Sep 13, 2020 12:14 PM)Charger Wrote:  It’s not. Mess with the JavaScript from the SO link I provided in chrome and from your program and you’ll see it’s different

I did that now. Everything is the same in both browsers.
What exactly did you expect to change?
(Sep 13, 2020 12:29 PM)SIM-2362662 Wrote:  I did that now. Everything is the same in both browsers.
What exactly did you expect to change?

https://stackoverflow.com/a/41220267
(Sep 13, 2020 12:30 PM)Charger Wrote:  https://stackoverflow.com/a/41220267

Check my thread. I've already seen this question and changed the "cdc_" thing.
(Sep 13, 2020 12:34 PM)SIM-2362662 Wrote:  Check my thread. I've already seen this question and changed the "cdc_" thing.

You didn’t read the highlighted reply
(Sep 13, 2020 12:38 PM)Charger Wrote:  You didn’t read the highlighted reply

I actually did. This is where I found out I can just edit the hex. I've changed the cdc_ thing and also a few random variables I came across just in case. Am I missing something in that post?
Anyway let's assume the website is somehow detecting selenium. How is it telling the server that? The post information is 100% the same.
You could assume its somehow associating the session id with selenium. But it works in the original browser and it fails in the selenium browser with the same session id.
And there is that last thing I figured. Basically I managed to get the selenium browser to be able to access the chatroom by having the code throw that error. So the browser itself is not the problem I guess. I don't even know anymore.
(Sep 13, 2020 01:07 PM)SIM-2362662 Wrote:  I actually did. This is where I found out I can just edit the hex. I've changed the cdc_ thing and also a few random variables I came across just in case. Am I missing something in that post?
Anyway let's assume the website is somehow detecting selenium. How is it telling the server that? The post information is 100% the same.
You could assume its somehow associating the session id with selenium. But it works in the original browser and it fails in the selenium browser with the same session id.
And there is that last thing I figured. Basically I managed to get the selenium browser to be able to access the chatroom by having the code throw that _error_. So the browser itself is not the problem I guess. I don't even know anymore.
Because it’s more than what you’re sending https://www.programmersought.com/article/1418383599/
(Sep 13, 2020 01:19 PM)Charger Wrote:  Because it’s more than what you’re sending https://www.programmersought.com/article/1418383599/

Thanks mate, this was super helpful. When executing "window.navigator.webdriver" I was getting true on the selenium browser, indeed.
After googling for a while I found the solution. All I had to do was add "options.add_argument("--disable-blink-features=AutomationControlled");"
You have been really helpful as always! Thanks!


Possibly Related Threads...
Thread / Author Replies Views Last Post
by plopsApr 27, 2025 01:11 PM 0 85 Apr 27, 2025 01:11 PM
Last Post: plops
[Help] by hackishSep 10, 2024 07:33 AM 12 480 Sep 10, 2024 07:33 AM
Last Post: Yokobovich
[Help] by luctvmgrzfsxn754Apr 8, 2023 12:11 PM 0 108 Apr 8, 2023 12:11 PM
Last Post: luctvmgrzfsxn754