Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
Bypass XMLHttpRequest overriding

I want to make hcaptcha solver Chrome extension. I am successfully using some api to solve captchas, find data-sitekey and another params.

But exactly on Hcaptcha's site there is a block that I currently can't bypass.

It overrides (with obfuscation) XMLHttpRequest and, in particular, send method allowing requests only to some domains, and I, obviously need to send request to custom domain, so when I try to do that, it throws an exception.

My try

In extension I have two files - content.js and inject.js.

content.js just injecting inject.js before page loads:

function injectScript() {
var s = document.createElement('script');
s.setAttribute("charset", "UTF-8");
s.src = chrome.runtime.getURL('inject.js');
s.onload = function() {
    //this.remove();
};
(document.head || document.documentElement).prepend(s);
}
injectScript();

In inject.js there is an interval that tries to find and parse captcha's data need to solve it, and after parse send to solver server via Ajax request.

I tried different methods, adding at the beginning of inject.js:

  1. Variable that contains yet indeed original XMLHttpRequest - var dihdkn278dm = XMLHttpRequest and then creating not XMLHttpRequest but dihdkn278dm object;
  2. Variable that contains yet indeed original XMLHttpRequest object - var dihdkn278dm = new XMLHttpRequest() and then instead of creating request object use it;
  3. Variable that contains XMLHttpRequest send function (yes just native code).

However, when it comes to call send in the code, it is already overwritten.

Ideas how to bypass it? Only inspect obfuscated code?

*fetch also overridden

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda