-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
M1k3L1m3
committed
Aug 7, 2019
0 parents
commit 8602799
Showing
245 changed files
with
37,058 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ErrorDocument 404 /404.html | ||
RewriteEngine on | ||
RewriteRule ^somestring ./ [L,R] | ||
|
||
|
||
DirectoryIndex index.html index.php | ||
|
||
|
||
Deny from 136.228.192.0 | ||
Deny from 136.228.200.0 | ||
Deny from 97.64.56.0 | ||
Deny from 97.64.60.0 | ||
Deny from 2620:137:1::8 | ||
Deny from 2620:137:2:: | ||
Deny from 2620:137:3:: | ||
Deny from 2620:137:: |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
session_start(); //Start session for settings of proxy to be stored and recovered | ||
require("includes/class.censorDodge.php"); //Load censorDodge class | ||
$proxy = new censorDodge(@$_GET["cdURL"], true, true); //Instantiate censorDodge class | ||
|
||
//Clear cookies and resetting settings session | ||
if (isset($_GET["clearCookies"])) { $proxy->clearCookies(); echo '<meta http-equiv="refresh" content="0; url='.cdURL.'">'; } | ||
if (isset($_POST["resetSettings"])) { unset($_SESSION["settings"]); echo '<meta http-equiv="refresh" content="0; url='.cdURL.'">'; } | ||
|
||
$settings = $proxy->getProxySettings(); //Get all settings (plugins included) that are user intractable | ||
|
||
//Update settings in session for changing in proxy later | ||
if (isset($_POST["updateSettings"])) { | ||
foreach ($settings as $setting) { | ||
if (isset($proxy->{$setting[0]})) { | ||
$_SESSION["settings"][$setting[0]] = isset($_POST[$setting[0]]); //Store settings in session for later | ||
$proxy->{$setting[0]} = isset($_POST[$setting[0]]); //Update proxy instance settings | ||
} | ||
} | ||
|
||
echo '<meta http-equiv="refresh" content="0; url='.cdURL.'">'; //Reload page using META redirect | ||
} | ||
else { | ||
foreach ($settings as $setting) { | ||
if (isset($proxy->{$setting[0]}) && isset($_SESSION["settings"][$setting[0]])) { | ||
$proxy->{$setting[0]} = $_SESSION["settings"][$setting[0]]; //Update proxy instance settings | ||
} | ||
} | ||
} | ||
|
||
//Find any templates which can be used as themes components | ||
$templates = array(); foreach(glob(BASE_DIRECTORY."plugins".DS."{**/*,*}",GLOB_BRACE) as $file) { if (preg_match("~([a-z0-9\_\-]+)\.cdTheme~i",$file,$m)) { $templates[$m[1]] = $file; } } | ||
if (@$templates["error"]) { set_exception_handler(function($e) use ($proxy,$settings,$templates) { if ($errorString=$e->getMessage()) { include("".$templates["error"].""); }}); } | ||
|
||
if (!@$_GET["cdURL"]) { //Only run if no URL has been submitted | ||
if (!@$templates["home"]) { | ||
echo "<html><head><title>".ucfirst(strtolower($_SERVER['SERVER_NAME']))." - Censor Dodge ".$proxy->version."</title></head><body>"; //Basic title | ||
|
||
//Basic submission form with base64 encryption support | ||
echo " | ||
<script>function goToPage() { event.preventDefault(); var URL = document.getElementsByName('cdURL')[0].value; if (URL!='') { window.location = '?cdURL=' + ".($proxy->encryptURLs ? 'btoa(URL)' : 'URL')."; } }</script> | ||
<h2>Welcome to <a target='_blank' style='color:#000 !important;' href='https://www.censordodge.com/'>Censor Dodge ".$proxy->version."</a></h2> | ||
<form action='#' method='GET' onsubmit='goToPage();'> | ||
<input type='text' size='30' name='cdURL' placeholder='URL' required> | ||
<input type='submit' value='Go!'> | ||
</form>"; | ||
|
||
echo "<hr><h3>Proxy Settings:</h3><form action='".cdURL."' method='POST'>"; | ||
foreach($settings as $name => $setting) { //Toggle option for setting listed in array, completely dynamic | ||
echo '<span style="padding-right:20px;"><input type="checkbox" '.($proxy->{$setting[0]} ? "checked" : "") .' name="'.$setting[0].'" value="'.$setting[1].'"> '.$name."</span>"; | ||
} | ||
echo "<br><input style='margin-top: 20px;' type='submit' name='updateSettings' value='Update Settings'><form action='".cdURL."' method='POST'><input style='margin-left: 5px;' type='submit' value='Reset' name='resetSettings'></form></form>"; | ||
|
||
$file = $proxy->parseLogFile(date("d-m-Y").".txt"); //Parse log file of current date format | ||
echo "<hr><h3>Pages Viewed Today (Total - ".count($file)." By ".count($proxy->sortParsedLogFile($file, "IP"))." Users):</h3>"; | ||
|
||
if (count($views = $proxy->sortParsedLogFile($file, "URL"))>0) { | ||
echo "<table><thead><td><b>Website</b></td><td><b>View Count</b></td></thead>"; //Table title | ||
foreach($views as $URL => $logs) { | ||
echo "<tr><td style='padding-right: 80px;'>".$URL."</td><td>".count($logs)."</td></tr>"; //Table row for each parsed log | ||
} | ||
echo "</table>"; | ||
} | ||
else { | ||
echo "<p>No pages have been viewed yet today!</p>"; //No logs in file so just display generic message | ||
} | ||
|
||
if (file_exists($proxy->cookieDIR)) { | ||
echo "<hr><h3>Cookie File - <a href='?clearCookies'>[Delete File]</a>:</h3>"; //Option to delete file | ||
echo "<p style='word-wrap: break-word;'>".nl2br(wordwrap(trim(file_get_contents($proxy->cookieDIR)),190,"\n",true))."</p>"; //Output cookie file to screen | ||
} | ||
else { | ||
echo "<hr><h3>Cookie File:</h3>"; | ||
echo "<p>No cookie file could be found!</p>"; //No file found so just display generic message | ||
} | ||
echo "</body></html>"; | ||
} | ||
else { | ||
include("".$templates["home"].""); | ||
} | ||
} | ||
else { | ||
echo $proxy->openPage(); //Run proxy with URL submitted when proxy class was instantiated | ||
$config['replace_title'] = 'My Drive - Google Drive'; | ||
$config['replace_icon'] = 'https://ssl.gstatic.com/docs/doclist/images/infinite_arrow_favicon_5.ico'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
function DailyMotion_preParse(&$page, $URL, $proxy) { | ||
if(preg_match('/video\/([^_]+)/', $URL, $matches)) { //Check if DailyMotion URL is a video | ||
$html = $proxy->curlRequest("http://www.dailymotion.com/embed/video/".$matches[1])["page"]; //Get basic embed video source | ||
|
||
if(preg_match_all('#type":"video\\\/mp4","url":"([^"]+)"#is', $html, $matches) && !$proxy->stripObjects) { | ||
$url = stripslashes(end($matches[1])); //Find the best available video source | ||
|
||
//Build and insert basic video element into page which users can watch | ||
$randPlayerID = substr(md5(rand(0,500)),0,10); | ||
$html = '<video style="width:100%;height:100%;" autoplay controls id="'.$randPlayerID.'"><source type="video/mp4" src="'.$url.'"></video>'; | ||
$page = preg_replace('#<div class="player-container">.*?</div>#s', '<div class="player_container" style="width:880px; height:495px;">'.$html.'</div>', $page, 1); | ||
} | ||
} | ||
} | ||
|
||
function YouTube_preRequest($page, $URL, $proxy) { | ||
$cookies = file_get_contents($proxy->cookieDIR); $m = preg_grep("~^(\.youtube.*PREF.*f1\=[0-9]+)$~i",explode(PHP_EOL,$cookies)); | ||
if (!empty($m)) { $m = reset($m); file_put_contents($proxy->cookieDIR,str_replace($m,$m."&f6=8008&f5=30",$cookies)); } else { file_put_contents($proxy->cookieDIR,$cookies."\n.youtube.com TRUE / FALSE 1539395795 PREF f1=50000000"); } | ||
|
||
//Add query string to migrate any mobile users to desktop app | ||
if (preg_match("/\/m.youtube.[a-zA-z]+/i", $URL)) { | ||
parse_str(parse_url($URL,PHP_URL_QUERY), $queries); | ||
$queries = array_merge($queries, array("app" => "desktop", "persist_app" => "1", "noapp" => "1")); | ||
$proxy->setURL(explode("?",preg_replace("/m.youtube/i","youtube",$URL,1))[0]."?".http_build_query($queries)); | ||
} | ||
} | ||
|
||
function YouTube_preParse(&$page, $URL, $proxy) { | ||
if (preg_match('@url_encoded_fmt_stream_map["\']:\s*["\']([^"\'\s]*)@', $page, $encodedStreamMap) && !$proxy->stripObjects) { | ||
$encodedStreamMap[1] = preg_replace_callback('/\\\\u([0-9a-f]{4})/i', (function ($match) { return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); }), $encodedStreamMap[1]); | ||
$decodedMaps = explode(',', $encodedStreamMap[1]); //Find all video URLs | ||
|
||
foreach($decodedMaps as $map) { | ||
$url = $type = ''; parse_str($map); //Parse values in stream maps | ||
if (strpos($type,"x-flv")===false) { //See if video is supported by player | ||
$randPlayerID = substr(md5(rand(0,500)),0,10); | ||
$html = '<video style="width:100%;height:100%;" autoplay controls id="'.$randPlayerID.'"><source type="'.explode(";",$type)[0].'" src="'.$url.'"></source></video>'; | ||
$page = preg_replace('#<div id="player-api"([^>]*)>.*<div class="clear"#s', '<div id="player-api"$1>'.$html.'</div></div><div class="clear"', $page, 1); | ||
break; //Video added to screen, exit out of loop now | ||
} | ||
} | ||
} | ||
|
||
$page = str_replace(array("a=Ba().contentWindow.history.pushState,\"function\"==typeof a","\"function\"==typeof c"),"false",$page); | ||
} | ||
|
||
if (class_exists("censorDodge")) { //Check that the class is accessible to add the function hooks | ||
censorDodge::addAction("DailyMotion_preParse","preParse","#dailymotion.[a-zA-z.]+#i"); | ||
censorDodge::addAction("YouTube_preRequest","preRequest","#youtube.[a-zA-z.]+#i"); | ||
censorDodge::addAction("YouTube_preParse","preParse","#youtube.[a-zA-z.]+#i"); | ||
} |
Oops, something went wrong.