api 우회 curl cloudflare cookie 클라우드 플레어 쿠키

api 우회 curl cloudflare cookie 클라우드 플레어 쿠키

더시민 0 298 0

$path_cookie = $_SERVER["DOCUMENT_ROOT"]."/file/cookies.txt";
if (!file_exists(realpath($path_cookie))) touch($path_cookie);

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "site.com/main".$_SERVER['QUERY_STRING']);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, realpath($path_cookie));
$headers = array(
        'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
        'cookie: __cfduid=d0d14dfd36e0da8e7858b58873b4263181523751395');

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);


$response = curl_exec($ch);
curl_close($ch);
echo $response;

0 Comments
제목
Category
Facebook Twitter GooglePlus KakaoStory KakaoTalk NaverBand