From da5d8223b28ea18a3fd50cc80f75f08dd061a9ff Mon Sep 17 00:00:00 2001 From: Hakase Date: Thu, 22 Mar 2018 21:18:45 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=AC=EB=9F=AC=20=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=88=98=EC=A0=95...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- _function.php | 191 ++++++++++++++++++++++++++++++++++++++++++++++++-- fmaru.php | 10 +-- index.php | 22 ++---- manga.php | 6 +- mangalist.php | 8 +-- 6 files changed, 203 insertions(+), 36 deletions(-) diff --git a/LICENSE b/LICENSE index 563fab6..a74c336 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2017 hakasenyang +Copyright (c) 2016-2018 hakasenyang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/_function.php b/_function.php index f668983..2ccbbf5 100644 --- a/_function.php +++ b/_function.php @@ -1,7 +1,43 @@ linkencode($url); $opts = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $url, - CURLOPT_TIMEOUT => 10, - CURLOPT_CONNECTTIMEOUT => 5, + CURLOPT_TIMEOUT => 60, + CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_HEADER => $headershow, CURLOPT_USERAGENT => $this->httph @@ -35,6 +73,144 @@ curl_close($ch); return ($data) ? $data : false; } + /** + * sucuri - sucuri 프록시 관련 쿠키 우회 + * 소스 : https://github.com/organization/cloudflare-bypass + * 소스 : http://cafe.naver.com/gogoomas/337647 + * @param string $result 쿠키 string 입력 + * @return strring 쿠키 데이터 출력 + * 사용하지 않음. + */ + /*public function sucuri($result) + { + if(strpos($result, 'sucuri_cloudproxy_js') !== false) + { + $cp_temp1 = explode('S=\'', $result); + $cp_temp2 = explode(';', $cp_temp1[1]); + $cp_script = $cp_temp2[0]; + $cp_temp1 = explode('A=\'', $result); + $cp_temp2 = explode('\';', $cp_temp1[1]); + $cp_chlist = $cp_temp2[0]; + $cp_charr = array(); + for($i = 0; $i < 64; $i++) + $cp_charr[$cp_chlist[$i]] = $i; + $cp_len = strlen($cp_script); + $cp_c = 0; + $cp_u = 0; + $cp_i = 0; + $cp_l = 0; + $cp_a = NULL; + $cp_r = NULL; + for($i = 0; $i < $cp_len; $i++) + { + $cp_c = $cp_charr[$cp_script[$i]]; + $cp_u = ($cp_u << 6) + $cp_c; + $cp_l += 6; + while($cp_l >= 8) + (($cp_a = ($cp_u >> ($cp_l -= 8)) & 0xff) || ($cp_i < ($cp_len - 2))) && ($cp_r .= chr($cp_a)); + } + $cp_temp1 = explode('document.cookie=', $cp_r); + $cp_temp2 = explode('=', $cp_temp1[1]); + $cp_cnam = str_replace('"', '\'', $cp_temp2[0]); + $cp_cnam_split = explode('+', $cp_cnam); + $cp_cnam_split_cnt = count($cp_cnam_split); + $cp_cnam_string = NULL; + for($i = 0 ; $i < $cp_cnam_split_cnt; $i++) + { + $cp_cnam = trim($cp_cnam_split[$i]); + if(strpos($cp_cnam, 'slice') !== false) + { + $cp_temp1 = explode('\'', $cp_cnam); + $cp_temp2 = explode('(', $cp_cnam); + $cp_temp3 = explode(')', $cp_temp2[1]); + $cp_temp4 = explode(',', $cp_temp3[0]); + $cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0])))); + } + elseif(strpos($cp_cnam, 'charAt') !== false) + { + $cp_temp1 = explode('\'', $cp_cnam); + $cp_temp2 = explode('(', $cp_cnam); + $cp_temp3 = explode(')', $cp_temp2[1]); + $cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1); + } + elseif(strpos($cp_cnam, 'String.fromCharCode') !== false) + { + $cp_temp1 = explode('(', $cp_cnam); + $cp_temp2 = explode(')', $cp_temp1[1]); + if(strpos($cp_temp2[0], '0x') !== false) + $cp_cnam_string .= chr(hexdec($cp_temp2[0])); + else + $cp_cnam_string .= chr($cp_temp2[0]); + } + elseif(strpos($cp_cnam, 'substr') !== false) + { + $cp_temp1 = explode('\'', $cp_cnam); + $cp_temp2 = explode('(', $cp_cnam); + $cp_temp3 = explode(')', $cp_temp2[1]); + $cp_temp4 = explode(',', $cp_temp3[0]); + $cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1])); + } + else + $cp_cnam_string .= trim(trim($cp_cnam, '\'')); + $cp_cnam_string .= NULL; + } + //$cp_temp1 = explode('=', $cp_r); + $cp_temp1 = strpos($cp_r, '='); + $cp_temp2 = explode(';document.cookie', substr($cp_r, $cp_temp1+1)); //$cp_temp[1] + $cp_cval = str_replace('"', '\'', $cp_temp2[0]); + $cp_cval_split = explode('+', $cp_cval); + $cp_cval_split_cnt = count($cp_cval_split); + $cp_cval_string = null; + for($i = 0 ; $i < $cp_cval_split_cnt; $i++) + { + $cp_nval = trim($cp_cval_split[$i]); + if(strpos($cp_nval, 'slice') !== false) + { + $cp_temp1 = explode('\'', $cp_nval); + $cp_temp2 = explode('(', $cp_nval); + $cp_temp3 = explode(')', $cp_temp2[1]); + $cp_temp4 = explode(',', $cp_temp3[0]); + $cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0])))); + } + elseif(strpos($cp_nval, 'charAt') !== false) + { + $cp_temp1 = explode("'", $cp_nval); + $cp_temp2 = explode("(", $cp_nval); + $cp_temp3 = explode(")", $cp_temp2[1]); + $cp_cval_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1); + } + elseif(strpos($cp_nval, 'String.fromCharCode') !== false) + { + $cp_temp1 = explode('(', $cp_nval); + $cp_temp2 = explode(')', $cp_temp1[1]); + if(strpos($cp_temp2[0], '0x') !== false) + { + $cp_cval_string .= chr(hexdec($cp_temp2[0])); + } + else + { + $cp_cval_string .= chr($cp_temp2[0]); + } + } + elseif(strpos($cp_nval, 'substr') !== false) + { + $cp_temp1 = explode('\'', $cp_nval); + $cp_temp2 = explode('(', $cp_nval); + $cp_temp3 = explode(')', $cp_temp2[1]); + $cp_temp4 = explode(',', $cp_temp3[0]); + $cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1])); + } + else + { + $cp_cval_string .= trim(trim($cp_nval, '\'')); + } + $cp_cval_string .= NULL; + } + + // String Output + return $cp_cnam_string."=".$cp_cval_string; + } + }*/ public function FileRead($filename=NULL) { $filename = ($filename) ? $filename : $this->fname; @@ -55,6 +231,9 @@ } public function GetCookie() { + /*$data = $this->WEBParsing('http://wasabisyrup.com/archives/'); + $cookie = $this->splits($data, ''); + $cookie = $this->sucuri($cookie);*/ $data = $this->WEBParsing('http://wasabisyrup.com/archives/455742', $cookie, true, 'pass=qndxkr', array( 'Referer: http://wasabisyrup.com/' @@ -88,9 +267,9 @@ $err='Not found comics data'; break; default: - $err='Unknown Error. Please send me an e-mail (contact@hakase.kr)'; + $err='Unknown Error. Please send me an e-mail (hakase@hakase.io)'; } die(json_encode(array('error'=>$num, 'message'=>$err))); } } - } \ No newline at end of file + } diff --git a/fmaru.php b/fmaru.php index 5489111..4a59a41 100644 --- a/fmaru.php +++ b/fmaru.php @@ -4,15 +4,15 @@ fmaru php porting by hakase - + + - +
- - + + diff --git a/index.php b/index.php index 1b36030..77e262e 100644 --- a/index.php +++ b/index.php @@ -8,16 +8,6 @@ if(isset($imgurl)) { $a = parse_url($imgurl); - // Insecure checkup causes RFI - switch($a['scheme']) - { - case 'http': - case 'https': - break; - default: - exit; - } - switch($a['host']) { case 'www.yuncomics.com': @@ -40,7 +30,6 @@ exit(); } } - header('Cache-Control: max-age=86400, public'); header('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + 86400)); header('Last-Modified: ' . gmdate('D, d M Y H:i:s',time() + 86400 ) . ' GMT' ); @@ -80,11 +69,11 @@ Number 2 : Cookie Get Error
Number 3 : Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times)
Number 4 : Not found comics data
Other error : read the message

-

Output only JSON (Example) {"error":1,"message":"Error Message)"}
+

Output only JSON (Example) {"error":1,"message":"Error Message"}
Only error / message method use

Etc...

Open Source

-

Developed by Hakase (contact@hakase.kr)
+

Developed by Hakase (hakase@hakase.io)
사용은 자유고 제한 없음. 애초에 제한 있으면 API 인증키를 넣겠지만 귀찮아서 안 넣음.

@@ -145,13 +134,12 @@ startdata: if ($image) { $jsonon = ($_GET['json'] == 1) ? true : false; - - for($i=1;$i
'; } else { - for($i=1;$i', $data2[$i])[0])) { @@ -180,7 +168,7 @@ startdata: else $aad[] = ['next'=>null]; } - for($i=2;$iWEBParsing('http://marumaru.in/'.$_GET['href']); + $data = $marumaru->WEBParsing('https://marumaru.in/'.$_GET['href']); $data = str_replace('class="con_link" ', 'target="_blank" ', $data); $data = preg_replace('/(<[^>]+) style=".*?"/i', '$1', $data); $thumb = $marumaru->splits($data, '<', $data); - for($i=1;$i', $b[$i])[0]); $id = explode('"', $a[$i])[0]; $c[] = ['href'=>'/b/manga/'.$id, 'title'=>$name, 'id'=>$id]; } $file = json_encode(array('list'=>$c)); - $marumaru->FileWrite($file, 'mangalist.txt'); + $marumaru->FileWrite($file, 'mangalist.txt', (60*30)); echo $file; exit; } echo explode(PHP_EOL, $file)[1]; - exit; \ No newline at end of file + exit;