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

Call to a member function getDataType() on null #188

Open kacperkwapisz opened 4 years ago

kacperkwapisz commented 4 years ago

So yesterday the script worked but now it's showing this issue, I tried to somehow fix it but without looking into your code. I really need help because I'm a owner of a big site with big traffic & this issue is so disturbing my users.

[22-Apr-2020 10:06:21 Europe/Berlin] PHP Fatal error:  Uncaught Error: Call to a member function getDataType() on null in /path/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php:67
Stack trace:
#0 /path/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php(41): CloudflareBypass\Model\UAM\UAMPageFormParams::getJschlAnswerFromPage(Object(CloudflareBypass\Model\UAM\UAMPageAttributes))
#1 /path/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageAttributes.php(55): CloudflareBypass\Model\UAM\UAMPageFormParams::getParamsFromPage(Object(CloudflareBypass\Model\UAM\UAMPageAttributes))
#2 /path/vendor/kyranrana/cloudflare-bypass/src/main/CFCurlImpl.php(146): CloudflareBypass\Model\UAM\UAMPageAttributes->__construct('https', 'cda-hd.cc', '<!DOCTYPE HTML>...')
#3 /path/vendor/kyranrana/cloudflare-bypass/src/main/CFCurlImpl.php(96): CloudflareBypass\CFCurlImpl->bypassIUAMPage(Resource id #23, '<!DOCTYPE HTML>...', Array, 0, Object in /path/vendor/kyranrana/cloudflare-bypass/src/main/Model/UAM/UAMPageFormParams.php on line 67

I'm using PHP version 7.3 btw.

neverknoww commented 4 years ago

same here.!

ryosensei commented 4 years ago

Same here too :)

momala454 commented 4 years ago

yeah, i would like some beta test ;)

KabDeveloper commented 4 years ago

solved or not please ?

vvpgrp commented 4 years ago

Some code changes that allow you to generate an answer that cf considers incorrect:

  1. File UAMPageFormParams.php Line 33: preg_match('/name="jschl_vc" value="([^"]+)"/', $page, $jschlVcMatches); New code: preg_match('/value="(\w+)"\sid="\S+"\sname="jschl_vc"/', $page, $jschlVcMatches);

  2. File UAMPageChallengeCode.php Line 42: $code = trim(substr($code, 0, strpos($code, "}, 4000);"))); Two line of new code: preg_match("/},(\s|)\d+\);/", $code, $matches); $code = trim(substr($code, 0, strpos($code, $matches[0])));

kacperkwapisz commented 4 years ago

Some code changes that allow you to generate an answer that cf considers incorrect:

  1. File UAMPageFormParams.php Line 33: preg_match('/name="jschl_vc" value="([^"]+)"/', $page, $jschlVcMatches); New code: preg_match('/value="(\w+)"\sid="\S+"\sname="jschl_vc"/', $page, $jschlVcMatches);
  2. File UAMPageChallengeCode.php Line 42: $code = trim(substr($code, 0, strpos($code, "}, 4000);"))); Two line of new code: preg_match("/},(\s|)\d+\);/", $code, $matches); $code = trim(substr($code, 0, strpos($code, $matches[0])));

still got the same error

KabDeveloper commented 4 years ago

@vvpgrp If we make that changes, we will get a working script ? is it a fix ?

Thank you

vvpgrp commented 4 years ago

@vvpgrp If we make that changes, we will get a working script ? is it a fix ?

Thank you

No, this is not a full fix! This is only part of the changes to get a working script!

KabDeveloper commented 4 years ago

@vvpgrp Tried but unfortunately not working.

vvpgrp commented 4 years ago

I made one more small addition. Guys, can you check if this fix works for you? For my case it works!

  1. File UAMPageFormParams.php Line 33: preg_match('/name="jschl_vc" value="([^"]+)"/', $page, $jschlVcMatches); New code: preg_match('/value="(\w+)"\sid="\S+"\sname="jschl_vc"/', $page, $jschlVcMatches);

  2. File UAMPageChallengeCode.php Line 44: $code = str_replace("var s,t,o,p,b,r,e,a,k,i,n,g,f, ", "", $code); New code: $code = str_replace("var s,t,o,p, b,r,e,a,k,i,n,g,f, ", "", $code);

  3. File UAMPageChallengeCode.php Line 42: $code = trim(substr($code, 0, strpos($code, "}, 4000);"))); Two line of new code: preg_match("/},(\s|)\d+\);/", $code, $matches); $code = trim(substr($code, 0, strpos($code, $matches[0])));

kacperkwapisz commented 4 years ago

Yep, that fixed the problem. Thanks, @vvpgrp ! Now, @KyranRana could you make an official update with this fix?

zikju commented 4 years ago

@vvpgrp yes, its worked for me. Thank you for a temporarily fix!

KabDeveloper commented 4 years ago

In my case I am getting this error:

[INFO] UAM (retry: 0) -> applying HTTPS settings [INFO] UAM (retry: 0) -> waiting for 5 seconds! [INFO] UAM (retry: 0) -> getting form params... [INFO] UAM (retry: 0) -> (r param: 9ccfeb5c63e6a1769d2e67bf7578d2fb2ed263c9-1588527245-0-ATAUM2eLV4dtfzTtR+HJUyD5eYWH3hSK1gRreXJXDCaRP5descDP24JowVpYz+eSZx6GPXAt3I/8YJgip6uVUjsMA5IPCDzp3z5Rf8iwh3A8WvACw88DkVsJUmOQTFaQOZjSElZf8/aEWZC5hEyIjvOf11JBSXvm3pYM942ptGL67oHtEzjxjer5vUiPSyy5YhtrtQ3PA3ZEBN9s0baujJRirYCYarSoKPffyBhj/tejAFSWoTbXLEtHHx/Rjoh5huccneoPMBss5GW8RgeOpoCz9v9ZD8ZoPN/VpYuXnZDByNbNUoO7AZn1xYe4XRrOn0gEiijmXrz+ckNUY+/j1ozJGdZ4nPO7C4VLnbY3T+Yajxig4kclxtq41RKROmtrFfAJtBK6Vpbp65WrtIVSdJnRHBVFJFIWnQ2I+Da+BSEuCicZsu9mj81xjQUyS/T99Ouq08eJoAkVn/6IVslFq0Yg4c7/+7RvSAS8zfVTX4coxaYYXF3zxr2LpgNGldUmiFk49Cp7hdSlDhf2dratDfuRgkVwc9h6GCQ+ldiEXBnaIsepccDGgqa95ep51V+NQgEHtGPEEX3BfyCX+QJXr6jJ3y0tMWjpwYqP4/gn2d/io15uHnvyUGwEuAtj77fwle3rBaYiTtMiPWMUDv2lnaPRWjjki8RHiN9x6g5YFqy3cijUGJ45dRbYT1QLXJqhdwz2f3hhYmHL0nm6LecnKWGg/jjQhG2B0QGpATkN1PxIF3+Du89urmuqHMxvlcsuMxSEtMIva9Qu2Pd85Xb5RnWZmbYXMrh6tUynrlGGwSxnwt/WqVQIZs6TQkwvE50CaBpmFak6a0ckg4rOUxTzSwLN4nWmSbFx0kdMsTmcukc/7bl3qp/Dwj2lzTjfRRCjSk0cI4gkpjJko5iyBYcEOK90F/bTftZZDUagerKKxKXAfjQtXUN22yUdTCRusrWbrrAI/xJlr8pG6fBxR5u71obU7VnzQ1BO+WAdtkY8WJD2Vg/8ll3OwrnLy/LD84SM2G35pt0IxOrEAuyXoGsyoTwDAfgUc/ZaMfJ6c6cQCy5Nt+pH+95os3FIuCB1i+BKQ83Hpu+SvoIjrOz0coSugUZJiimTqm2/vvmIR2E+g2L+qRYenwZiUxmj7TKMcdTW12IH2l79cHbpALM7S0A5ezNWrijc28kjcmUDqb7uNEr8QZPk5aoD0dBQCgln9KmxDC4hMUY1vXqSaydbbPhlrzK/q8AzkURXUQ2MLECpnjzOTAcckezQW74gyYZT0dkPkrlGKAn60WXb3a8hVxXwtzoCoJxOqhvvj2ppofEZYjoY3eJ7ZZ8OMKetkYhKiOv53iNSAbyWTUk2IcL0MJdD49IwgF1glz6Nr2s72M/Ns87lR4gEDb5UoNXVJAvxEhXmAFlw7jXwze7VFGD5YO1Ei8mJ/LHCxsfnYu76MpTTkOwHokb6qLOkQiqiSSnD499njfaCVqr5BzzQSBikPS9nS84XSJpRjyJ79MgyYS3O3U7PX8UetQFMFrYZi+g7hVDun4bNwgvMZ1SdPMSUMMYtlvE=) [INFO] UAM (retry: 0) -> (jschl_vc param: 2bf65926dbd2d3a24f1a87302ff12ad6) [INFO] UAM (retry: 0) -> (pass param: 1588527249.749-za9QP4Oa5E) [INFO] UAM (retry: 0) -> (jschl_answer param: 1.2727743388) [ERROR] Captcha (retry: 1) -> not supported! Unknown error -> Captcha page is not supported!

vvpgrp commented 4 years ago

@bcashier

In my case I am getting this error:

[INFO] UAM (retry: 0) -> applying HTTPS settings [INFO] UAM (retry: 0) -> waiting for 5 seconds! [INFO] UAM (retry: 0) -> getting form params... [INFO] UAM (retry: 0) -> (**r** param: 9ccfeb5c63e6a1769d2e67bf7578d2fb2ed263c9-1588527245-0- ... Dun4bNwgvMZ1SdPMSUMMYtlvE=) [INFO] UAM (retry: 0) -> (**jschl_vc** param: 2bf65926dbd2d3a24f1a87302ff12ad6) [INFO] UAM (retry: 0) -> (**pass** param: 1588527249.749-za9QP4Oa5E) [INFO] UAM (retry: 0) -> (**jschl_answer** param: 1.2727743388) [ERROR] Captcha (retry: 1) -> not supported! Unknown error -> **Captcha page is not supported!**

Read carefully: Captcha page is not supported!

devoided commented 4 years ago

Seems to not be working again?

[INFO] UAM (retry: 0) -> (jschl_vc param: 8ed994d39ebe29c84cd11e49a371053c)
[INFO] UAM (retry: 0) -> (pass param: 1588679802.02-r4m69aPBHh)
[INFO] UAM (retry: 0) -> (jschl_answer param: 2.8137459666)
[INFO] UAM (retry: 1) -> applying HTTPS settings
[INFO] UAM (retry: 1) -> waiting for 5 seconds!
[INFO] UAM (retry: 1) -> getting form params...

**Notice: Undefined offset: 1 in UAMPageFormParams.php on line 38**
vvpgrp commented 4 years ago

@devoided Seems to not be working again?

[INFO] UAM (retry: 0) -> (jschl_vc param: 8ed994d39ebe29c84cd11e49a371053c)
[INFO] UAM (retry: 0) -> (pass param: 1588679802.02-r4m69aPBHh)
[INFO] UAM (retry: 0) -> (jschl_answer param: 2.8137459666)
[INFO] UAM (retry: 1) -> applying HTTPS settings
[INFO] UAM (retry: 1) -> waiting for 5 seconds!
[INFO] UAM (retry: 1) -> getting form params...

**Notice: Undefined offset: 1 in UAMPageFormParams.php on line 38**

Doesn't work or only seems to not be working again?😊 Did you executed this fix?

Please publish a link to the site to check working!

kacperkwapisz commented 4 years ago

@vvpgrp not working again sadly

vvpgrp commented 4 years ago

@vvpgrp not working again sadly

Try this fix!