KyranRana / cloudflare-bypass

A new and improved PHP library which bypasses the Cloudflare IUAM page using cURL
MIT License
275 stars 98 forks source link

no s parameter but r #146

Closed momala454 closed 4 years ago

momala454 commented 4 years ago
<form id="challenge-form" action=".......8lDcmEdl" method="POST" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="r" value=""></input>
    <input type="hidden" name="jschl_vc" value="c09178......42977"/>
    <input type="hidden" name="pass" value="15747....WT"/>
    <input type="hidden" id="jschl-answer" name="jschl_answer"/>
  </form>

causes Notice: Undefined offset: 1 in /CloudflareBypass/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php on line 40

Fatal error: Uncaught TypeError: Argument 1 passed to CloudflareBypass\Model\UAM\UAMPageFormParams::__construct() must be of the type string, null given, called in /CloudflareBypass/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php on line 40 and defined in /CloudflareBypass/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php:97 Stack trace:

fullsharez commented 4 years ago

yes the same it does not work anymore

arabcoders commented 4 years ago

Indeed it started to happen few hours ago, no longer works.

fullsharez commented 4 years ago

someone found the solution?

momala454 commented 4 years ago

i think it may have been tested previously randomly by cloudflare as i had the same kind of error a month ago : https://github.com/KyranRana/cloudflare-bypass/issues/140

arabcoders commented 4 years ago

it seems this patch has the new working version for node https://github.com/codemanki/cloudscraper/pull/287/files

sadly im at work and unable to test it

bert-w commented 4 years ago

if you look at the form closely, it now also uses a POST request instead of a GET. I think maintaining this package is going to be a pain since PHP is not meant to deal with javascript. Cloudflare will keep changing this protection page in the future. The best solution is to use an actual javascript solution to solve the challenge (like V8Js PHP extension or setup your own Node.js server).

Or improve this script to use something like symfony/dom-crawler to atleast polish some of the hardcoded form properties out (like <input name="s" change to <input name="r")

arabcoders commented 4 years ago

if you look at the form closely, it now also uses a POST request instead of a GET. I think maintaining this package is going to be a pain since PHP is not meant to deal with javascript. Cloudflare will keep changing this protection page in the future. The best solution is to use an actual javascript solution to solve the challenge (like V8Js PHP extension or setup your own Node.js server).

Or improve this script to use something like symfony/dom-crawler to atleast polish some of the hardcoded form properties out (like <input name="s" change to <input name="r")

indeed i was thinking of using headless chrome, but right now i am content to just use this package as middleware for guzzle, i only have problem with one side.

arabcoders commented 4 years ago

thanks to the contributors it seems to be working now again, to start using it before the version is tagged you could just require this

    "kyranrana/cloudflare-bypass": "dev-master#4e7a6f57df9884e450e7e02ef067425cc1f8801d",

in your composer.json

momala454 commented 4 years ago

a suggestion, cloudflare use this header: server: cloudflare

so you could use this and the http code 503 to detect cloudflare