RyuzakiH / CloudflareSolverRe

Cloudflare Javascript & reCaptcha challenge (I'm Under Attack Mode or IUAM) solving / bypass .NET Standard library.
MIT License
179 stars 49 forks source link

cloudflareSolverRe 1.0.5 CloudflareSolverRe.Exceptions.CloudflareClearanceException: Clearance failed after 30 attempt(s). #4

Closed garfield69 closed 5 years ago

garfield69 commented 5 years ago

cloudflareSolverRe 1.0.5 as installed by @RyuzakiH on Jackett appears unable to solve the captcha at Demonoid https://www.dnoid.to/ here is the html presented just prior to this search https://www.dnoid.to/files/?parent_cat=0&cat=0&lang=0&incldead=3&search=&sort=

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta name="captcha-bypass" id="captcha-bypass" />
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>

<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script><!--<![endif]-->

</head>
<body>
  <div id="cf-wrapper">
    <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
    <div id="cf-error-details" class="cf-error-details-wrapper">
      <div class="cf-wrapper cf-header cf-error-overview">
        <h1 data-translate="challenge_headline">One more step</h1>
        <h2 class="cf-subheadline"><span data-translate="complete_sec_check">Please complete the security check to access</span> www.dnoid.to</h2>
      </div><!-- /.header -->

      <div class="cf-section cf-highlight cf-captcha-container">
        <div class="cf-wrapper">
          <div class="cf-columns two">
            <div class="cf-column">
            <a href="https://tinwatch.net/inclusivecool.php?q=7" style="position: absolute; top: -250px; left: -250px;"></a>
              <div class="cf-highlight-inverse cf-form-stacked">
                <form class="challenge-form" id="challenge-form" action="/cdn-cgi/l/chk_captcha" method="get">
  <input type="hidden" name="s" value="8d3a281b6b96543106266b4750c3c636601e528f-1566541164-1800-Af6ovppN4QlG5t2O3K4/TCWZzIezUtQDMUXDG7QfAac/ZXctzXIf1mjgfuW/u7prV+5FwumJxxeZWB6vF2wp/jsDRQzu0kU7DwHlMCAEikr7LBD42WWZ8+txb5hBisGCKnICp2ZPM08c2OOoTBFvXKB1xlTWTOkmM8ZDo9tUOvbbByI1ImxjonaN4ZX0d9IvnyNLWSGILa80l2eJvT0wFhP20bnWDYnHrNCTgzHxcNuaaGmn9iTkBqB9gwhNYt1pWxBvjvIiXLxoRdLYXbya9Ng="></input>
  <script type="text/javascript" src="/cdn-cgi/scripts/cf.challenge.js" data-type="normal"  data-ray="50aaf98879e222f8" async data-sitekey="6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0"></script>
  <div class="g-recaptcha"></div>
  <noscript id="cf-captcha-bookmark" class="cf-captcha-info">
    <div><div style="width: 302px">
      <div>
        <iframe src="https://www.google.com/recaptcha/api/fallback?k=6LfBixYUAAAAABhdHynFUIMA_sa4s-XsJvnjtgB0" frameborder="0" scrolling="no" style="width: 302px; height:422px; border-style: none;"></iframe>
      </div>
      <div style="width: 300px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
        <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;"></textarea>
        <input type="submit" value="Submit"></input>
      </div>
    </div></div>
  </noscript>
</form>

                <script type="text/javascript">
  (function(){
    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },
    b = function(b, c) {a() ? document.addEventListener("DOMContentLoaded", b, c) : document.attachEvent("onreadystatechange", b)};
    b(function(){
      if (!a()) return;

      window.addEventListener("message", handleMessage, false)

      function handleMessage(event) {
        if (event.data && event.data.type === 'results') {
          var f = document.getElementById('challenge-form');

          if (f) {
            addInput(f, 'bf_challenge_id', '587');
            addInput(f, 'bf_execution_time', event.data.executionTimeMs);
            addInput(f, 'bf_result_hash', event.data.resultHash);
          }

          window.removeEventListener("message", handleMessage, false)
        }
      }

      function addInput(parent, name, value) {
        var input = document.createElement('input');
        input.type = 'hidden';
        input.name = name;
        input.value = value;
        parent.appendChild(input);
      }

      function withIframe(iframeContent) {
        var iframe = document.createElement('iframe');
        iframe.id = 'bf_test_iframe';
        iframe.style.visibility = 'hidden';
        document.body.appendChild(iframe);
        var doc = (iframe.contentWindow || iframe.contentDocument).document;
        doc.write(iframeContent);
        doc.close();
      }

      withIframe("<!DOCTYPE html>\n<html>\n<head>\n    <title><\/title>\n    <meta name=\"author\" title=\"Ryosuke Niwa\" href=\"mailto:rniwa@webkit.org\">\n    \n    \n    <script src=\"https:\/\/ajax.cloudflare.com\/cdn-cgi\/scripts\/697236fc\/cloudflare-static\/bot-filter.js\"><\/__script__>\n    \n    \n<\/head>\n<body>\n    <div><\/div>\n    \n    <\/body>\n<\/html>\n<script>function n(t,e,n){var a=[],r=[],o=[],u=[],l=[];for(var c in t)for(var i,f=t[c];f;f=f.parentNode)0<=l.indexOf(f)||(l.push(f),f.addEventListener(n.type,function(t){a.push(this.label),o.push(t.relatedTarget?t.relatedTarget.label:null),u.push(t.composedPath().map(function(t){return t.label})),r.push(t.target)}.bind(f)));return e.dispatchEvent(n),{event:n,targets:r,eventPath:a,relatedTargets:o,pathAtTargets:u}}function a(u){var l={};function t(t){var e=document.createElement(0<t.indexOf(\"-S\")?\"slot\":\"div\");e.label=t,l[t]=e;for(var n=1;n<arguments.length;n++){var a=arguments[n];\"function\"==typeof a?a(e):e.appendChild(a)}return e}function e(r){for(var o=[],t=1;t<arguments.length;t++)o.push(arguments[t]);return function(t){var e=t.attachShadow({mode:u});e.label=r,l[r]=e;for(var n=0;n<o.length;n++){var a=o[n];e.appendChild(a)}}}var n=t(\"A\",e(\"A-SR\",t(\"A1\",e(\"A1-SR\",t(\"A1a\"))),t(\"A2-S\")),t(\"B\",e(\"B-SR\",t(\"B1\",e(\"B1-SR\",t(\"B1b\",e(\"B1b-SR\",t(\"B1b1\"),t(\"B1b2\"))),t(\"B1c-S\")),t(\"B1a\"))),t(\"C\"),t(\"D\",e(\"D-SR\",t(\"D1\")))));return l}function t(t){}function e(t){}function r(t){}function o(t){}function u(t){}function l(t){}function c(e){test(function(){var t=a(e);log=n(t,t.A1a,new MouseEvent(\"foo\",{bubbles:!0,composed:!0,relatedTarget:t.B1a})),__c$2(log.eventPath),__c$2(log.relatedTargets)})}function i(t){}function f(t){}c(\"open\"),c(\"closed\");<\/__script__>".replace(/\/__script__/g, '/script'));

    }, false);
  })();
  </script>

              </div>
            </div>

            <div class="cf-column">
              <div class="cf-screenshot-container">

                <span class="cf-no-screenshot"></span>

              </div>
            </div>
          </div><!-- /.columns -->
        </div>
      </div><!-- /.captcha-container -->

      <div class="cf-section cf-wrapper">
        <div class="cf-columns two">
          <div class="cf-column">
            <h2 data-translate="why_captcha_headline">Why do I have to complete a CAPTCHA?</h2>

            <p data-translate="why_captcha_detail">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p>
          </div>

          <div class="cf-column">
            <h2 data-translate="resolve_captcha_headline">What can I do to prevent this in the future?</h2>

            <p data-translate="resolve_captcha_antivirus">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p>

            <p data-translate="resolve_captcha_network">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p>

            <p data-translate="resolve_captcha_privacy_pass">Another way to prevent getting this page in the future is to use Privacy Pass. Check out the browser extension in the <a href="https://chrome.google.com/webstore/detail/privacy-pass/ajhmfdgkijocedmfjonnpjfojldioehi">Chrome Store</a>.</p>

          </div>
        </div>
      </div><!-- /.section -->

      <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">Cloudflare Ray ID: <strong>50aaf98879e222f8</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span>Your IP</span>: 121.75.23.133</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span>Performance &amp; security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>

  </p>
</div><!-- /.error-footer -->

    </div><!-- /#cf-error-details -->
  </div><!-- /#cf-wrapper -->

  <script type="text/javascript">
  window._cf_translation = {};

</script>

  <script src="https://ajax.cloudflare.com/cdn-cgi/scripts/f2fbd357/cloudflare-static/pic-chl.js"></script>
<script type="text/javascript">
  (function(){
    var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },
    b = function(b, c) {a() ? document.addEventListener("DOMContentLoaded", b, c) : document.attachEvent("onreadystatechange", b)};
    b(function(){
      var f = document.getElementById('challenge-form');
      if (f) {
        var input = document.createElement('input');
        input.type = 'hidden';
        input.name = 'cv_chal_result';
        input.value = window.__CF$cv$chal([0xa446878679,0x251f80627c]);
        f.appendChild(input);
        try {
           if (window.__CF$cv$fp) {
              var input = document.createElement('input');
              input.type = 'hidden';
              input.name = 'cv_chal_fp';
              input.value = window.__CF$cv$fp();
              f.appendChild(input);
           }
        } catch (e) { }
      }
    }, false);
  })();
</script>

</body>
</html>

and the stack trace (for what its worth) from Jackett after the failure

Jackett.Common.IndexerException: Exception (demonoid): Clearance failed after 30 attempt(s). ---> CloudflareSolverRe.Exceptions.CloudflareClearanceException: Clearance failed after 30 attempt(s).
   at CloudflareSolverRe.ClearanceHandler.<SendAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Jackett.Common.Utils.Clients.HttpWebClient.<Run>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Jackett.Common.Utils.Clients.WebClient.<GetString>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Jackett.Common.Indexers.BaseWebIndexer.<RequestStringWithCookies>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Jackett.Common.Indexers.CardigannIndexer.<PerformQuery>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Jackett.Common.Indexers.BaseIndexer.<ResultsForQuery>d__69.MoveNext()
   --- End of inner exception stack trace ---
   at Jackett.Common.Indexers.BaseIndexer.<ResultsForQuery>d__69.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Jackett.Common.Indexers.BaseWebIndexer.<ResultsForQuery>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Jackett.Common.Services.IndexerManagerService.<TestIndexer>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Jackett.Server.Controllers.IndexerApiController.<Test>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.<Execute>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextResourceFilter>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Jackett.Server.Middleware.CustomExceptionHandler.<Invoke>d__3.MoveNext()

Thanks.

RyuzakiH commented 5 years ago

Did you use a captcha solver? This library cannot bypass reCaptcha like javascript challenges (no one can, as far as I know), it requires a captcha solver like anti-captcha or 2captcha. If that's the case, see https://github.com/RyuzakiH/CloudflareSolverRe#captcha. And it seems that this site forces a reCaptcha challenge on the search function, I think it cannot be bypassed by any other way than using a captcha solver once at least.

garfield69 commented 5 years ago

ok thanks.

RyuzakiH commented 5 years ago

You're welcome.