Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromedriver injected code. #19

Open
oleg-andreyev opened this issue Jan 4, 2025 · 0 comments
Open

Chromedriver injected code. #19

oleg-andreyev opened this issue Jan 4, 2025 · 0 comments

Comments

@oleg-andreyev
Copy link

oleg-andreyev commented Jan 4, 2025

Chromedriver injects following code

https://github.com/bayandin/chromedriver/blob/63aae844b03abd89e1f47ca15b1721881d040d66/chrome/devtools_client_impl.cc#L563

image

(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Object = window.Object;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_adoQpoasnfa76pfcZLmcfl_Proxy = window.Proxy;window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol = window.Symbol;window.cdc_adoQpoasnfa76pfcZLmcfl_JSON = window.JSON;window.cdc_adoQpoasnfa76pfcZLmcfl_Window = window.Window;}) ();
  const Window = window.cdc_adoQpoasnfa76pfcZLmcfl_Window || window.Window;
  const Symbol = window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol || window.Symbol;
    const Array = window.cdc_adoQpoasnfa76pfcZLmcfl_Array || window.Array;
  const Proxy = window.cdc_adoQpoasnfa76pfcZLmcfl_Proxy || window.Proxy;
  let WindowProxy = window.cdc_adoQpoasnfa76pfcZLmcfl_Window || window.Window;
    const JSON = window.cdc_adoQpoasnfa76pfcZLmcfl_JSON || window.JSON;
  const Promise = window.cdc_adoQpoasnfa76pfcZLmcfl_Promise || window.Promise;
      const JSON = window.cdc_adoQpoasnfa76pfcZLmcfl_JSON || window.JSON;
  const Promise = window.cdc_adoQpoasnfa76pfcZLmcfl_Promise || window.Promise;
    const Promise = window.cdc_adoQpoasnfa76pfcZLmcfl_Promise || window.Promise;

using quite simple code:

function getCDC(){ 
    let matches = []
    for(let prop in window) {
       prop.match(/cdc_[a-z0-9]/ig) && matches.push(prop)
    }
    return matches 
}

we can detect it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant