Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbany committed Oct 13, 2011
0 parents commit 36fd34a
Show file tree
Hide file tree
Showing 28 changed files with 1,840 additions and 0 deletions.
167 changes: 167 additions & 0 deletions README
@@ -0,0 +1,167 @@
-- Bugfix (Ver 4.34) --
-Fixes typo in includes/module_http.php:143 heaer
-Fixes undefined index error index.php:28 for HTTPS detection
-Fixes bug #3419799 in SF tracker, escapes ampersands in url possibly with them (still testing)
-"about:" pages introduced

-- Bugfix (Ver 4.33) --
-Fixed serious bug on version 4.32 encryption module accidentally sending unencrypted url in GET
All users on 4.32, if highly security conscious, are STRONGLY RECOMENDED to upgrade or disable the navbar!
-Changed the random number key generator to use a higher region
-Fixed bug in Url Parser processing empty path strings (link to file on root of host)

-- New Release (Ver 4.32) --
- Added Navigation Bar Feature (default on) to show addresses (Requires support for frames)
- Improved basic encryption
- Fixed small problem in Url Parser with url fragments
- Fixed problems JS url parsing, now only parses url inside of strings.
- Allows users to set 'Blank Referer'
- Users can opt to shut off GZIP retreiving (many free servers do not support gzip decoding) and force remote servers to return unzipped
- Tested with Acid3 obtaining score of 92/100
- Internationalization Supported!

-- New Release (Ver 4.30) --
- Rewritten the URL parser, solving parsing problems for many URLs
- Fixed POST/GET determination method. Solves problem of mistaking post for GET forms
- Fixed problems with addresses embedded in JS
- Fixed problems with REGEX exceeding pcre recursive/backtrack limits and returning blank pages

-- New Release (Ver 4.28) --
-Fixed BUG #3374265, #3379261
Problem with file encoding and Problem of jumping out of ssl
-Updated the main interface to prevent re-submitting the form causing address to be double-encrypted
-Fixed bug in error message to filter HTML injections
-Fixed problem parsing some GET forms
-Respects 'refresh:' http headers now

-- Bugfix --
-Fixed newline encoding in includes/plugins/youtube.php to UNIX because it caused problems

-- New Release (Ver 4.26) --
-Fixed bug with parser that changed almost all POST forms into GET forms
-Added native support for KnProxy V5

-- New Release (Ver 4.25) --
-Updated URL Parser removing problems generated in last bugfix
-Updated parser to ignore <! beginning tags (namely <!-- and <![CDATA[)
-Can now parse @import with "" '' wrapping strings
-New default salt

-- Bugfix (Ver 4.24 BUGFIX) --
-Fixed serious problem with last release caused by debugging code not removed
Sorry about that.

-- New Release (Ver 4.24) --
-Now officially supports GET forms
Which allows 'Google Search' To WORK :D
-Pushed new default SECRET into effect. Please omit config.php if you still wish to keep your urls.
-Support for You*Tube videos is in place though you cannot choose def rates [PACK:SSE-2011-07-10-PV2] Sites: You*tube
-Rolled back url parser as problems occurred in new version.

-- New Release (Ver 4.22) --
-Resolved Bug Artifacts #3358326 #3333079 on SourceForge Tracker
-Updated Parser to only process urls inside of tags
-Updated URL Parsing module resolving errors while processing urls like
?somewhere=http://someaddress/somepath/?something or /somepath/http://somesite/somepath2/

-- New Release (Ver 4.19) --
-Solved Warning Messages when php is in strict mode.
(Thanks to bug report from zhongxiaolee AT gmail DOT com)
-KNEN_SECRET allows you to define a salt for address encryption
( Graduated from -dev branch!)
-Supports GZIP on HTML/CSS/JS and other MIME:text/* files! Can be disabled in conf.php
-Autodetect page encoding (to be used in ver 4.2x for Page Encryption)
-Changed default interface to be slimmer (smaller download size)

-- Bugfix (Ver 4.16)--
-Fixed bug when parsing url( in css tags when there is a space after the bracket.
Solves problem with some @import url( somewhere ); situations

-- New Release (Ver 4.15) --
-Added support for HTTP basic authentication (username and password stored in cookies)
-Enhanced parsing engine for JS urls (better support for face*book and google ajax calls!)
Tested on Facebook, can now post status/share and all kinds of messages!
This works for general websites as well!
-Site Specific Enhancements [PACK:SSE-2011-06-11-PV1] Sites: Facebook
-Lets 404 error pages pass through instead of getting handled! (because some error pages are creative ^_^)

-- Development Release (Ver 4.10-dev) --
-Note: The DEV branch is for small features that are seasonal and used to defeat GFW
They do not provide a big improvement if you are using outside of China or networks
that have intensive censorship.
DEV branches will have a chinese versionlog file to guide users. It will not be included
in the main builds.
Some features may eventually graduate from the dev into the main builds, others will only
remain in dev.
-Added support for cloud proxying (still testing)
-Added config file. You can set your own proxy key to avoid url being caught by GFW.
-Added Chinese Versionlog (note: only dev versions have the chinese Versionlog)

-- New Release (Ver 4.10) --
-Edited the parser to support parsing of style= inside an HTML tag
Note: This fixes the problem of the Google logo not showing up
-Added a small filter for urls captured in JS to remove \" and \/ stuff.
-Fixed small problem in page encryption, but still doesn't decode GB2312 correctly


-- New Release (Ver 4.08) --
-Added page encryption support(disabled by default)
The GFW experienced an upgrade in blocking techniques.
This new version solves problem with page encryption
Small enhancement for users in China


-- New Release (Ver 4.07) --
-Fixed bug in knHTTP module. Only one request is sent to get headers and body.
-Fixed bug in parser for mime types
-Fixed regression problems in SSL enable/disable checks
-Added a JS for future use of enhanced client-side parsing

-- New Release (Ver 4.05) --
-Limited SSL Support included with a warning dialog
-Solved problem parsing cookies with Expire dates
-Solved problem of wrongly parsing Location: tags when X-Something-Location: was present
-Minor Enhancement for parser to find the mime type more accurately

-- Bugfix (Ver 4.01) --
-Last upload was not final v4 version!
-Fixed bug in parsing engine that didnt change the 'action=' field in html forms resulting in unproxified forms
Now can work with f*cebook logins and all sorts of logins!
-Fixed bug in URL parser. Now ignores javascript tags, data url scheme and anchors (eg 'javascript:','data:','#anchor').
-Added debug mode, if you get a blank white screen on loading a page, try adding &debug=true to the end of the url
you will enter debug mode. You can send the debug data to me at j_abbany@yahoo.ca or (if you can) solve it by yourself.

-- Initial release (Ver 4.00) --
Knproxy Theta (v4) is out with loads of new improvements!!
=======
1. Slimmer Engine
The method used for fetching and parsing has been greatly slimmed down. Knproxy now runs on half the processing resources!

2. Improved Parsing
New specialized parsing for css/js and html with checks on MIME type to give the best optimized effect.
The regexes have also been fixed meaning a compatibility for more websites. Tags with href=" href=' and href= are all supported in this version.
CSS parsing improvements prevent the page suffering from bad css.
JS scripts are basically ignored to speed up the loading.
Also, images and other attachments need not go through the parsing engine to prevent breaking (if a good content type is sent).

3. Better Support for POST forms and COOKIEs
Support for POST and COOKIES is now built into the knHTTP request engine. (And needs no special plugin as in v3)
COOKIES can now be stored locally instead of on server and are loaded faster.
GET requests are on the way!

4. Improved Error Checking
Error checks are built in natively. Tons of debugging info given on error to help pinpoint problem.

5. Native Encoding
Now, encoding for URL is embedded natively and not plugged in. However, we currently only support KNEN.
(You can implement your own obfuscation method!)

6. Speedup
Lots of redundant code removed. Proxy modualized and functions separately. Greatly reduced the size of master file!

7. Supports Shifting Code
You can give a shift value for the encoding to avoid blacklists. Though currently addresses are static.

Enjoy~
Author Jabbany

24 changes: 24 additions & 0 deletions conf.php
@@ -0,0 +1,24 @@
<?php
define('KNEN_SECRET','joWVexlW4fHeH/2GGNLefy8bV7JFaaTTF92AWp1k0jDsMqC8tqeAvdLo/gg');
define('KNPROXY_LANGUAGE','zh-CN');//Set the language for Knproxy!
define('USE_GZIP','true');
define('ALLOW_YOUTUBE','true');
define('ENABLE_JS_PARSING','true');
define('ACCEPT_ENCODING_GZIP','true');
define('ALLOW_NAVBAR','true');
define('NO_REFERER','true');
define('OPTIMIZE_JAVASCRIPT','false');//优化JS(去除注释,降低下载量)

/**********SET DEFAULT RUNTIME THINGS*************/
@ini_set('pcre.backtrack_limit', 10000000);//Prevent REGEXs from exceeding limit
@ini_set('pcre.recursion_limit', 10000000);
@ini_set('memory_limit','64M');//INCREASE MEMORY LIMIT
@set_time_limit(180);//Run for 3 minutes at Most
/**
* 如果你访问的一些网站页面内嵌JS或CSS代码超过 100k 字符,有些服务器不允许执行正则表达式来处理它们。
* 这些情况下,服务器可能会返回完全空白的页面
* 如果你的服务器反复出现完全空白页面,请取消下面一行的注释,这将取消JAVASCRIPT解析
**/
//define('DISABLE_JAVASCRIPT_REGEX','true');

?>
27 changes: 27 additions & 0 deletions frames/dynami_index.php
@@ -0,0 +1,27 @@
<?php
include_once('knproxy_i18n.php');
include_once('../conf.php');
$_LANG = KNPROXY_LANGUAGE;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<style>
.copyright{font: 0.8em Verdana, "Lucida Grande", Arial, Helvetica, sans-serif;}
.options{font-size:0.95em; font-family:"微软雅黑", "Microsoft Yahei", "黑体", "Heiti" , Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; }
.urlbox{background-color:#FFFFCC;color: #FF0000;font-family: Arial;font-weight: bold;font-size: 1em;}
<?php echo knproxy_translate('css',$_LANG,'.mymsg{font-family:"黑体","Heiti",Verdana;}');?>
</style>
</head>
<body bgcolor="FFFFFF">
<br>
<p align="center"><img src="../logo_new.png" width="320" height="150"></p>
<h1 align="center" class="mymsg"><?php echo knproxy_i18n('message',$_LANG);?></h1>
<div align="center">
<table border="0" width="50%" id="table1" class="copyright">
<tr>
<td valign="top" align="center">Copyright <?php echo date('Y'); ?> - Knh Internet Services Limited</td>
</tr>
</table>
</div>
</body>
7 changes: 7 additions & 0 deletions frames/i18n/en-US.ktr
@@ -0,0 +1,7 @@
title|KnProxy Browser
css|.mymsg{font-family:Verdana;font-weight:normal;}
message|Please provide a URL in the navigation bar.
navigate|Navigate to:
encode|Encode URL
debug|Debug Mode
hide_bar|Hide Address Bar
7 changes: 7 additions & 0 deletions frames/i18n/ja-JP.ktr
@@ -0,0 +1,7 @@
title|KnProxy ブラウザ
css|.mymsg{font-family:"Meiryo","MS Mincho",Verdana;font-weight:normal;}
message|URLを入力してください
navigate|移動する
encode|URL暗号化
debug|デバッグ
hide_bar|URLバーを非表示
6 changes: 6 additions & 0 deletions frames/i18n/zh-CN.ktr
@@ -0,0 +1,6 @@
title|KnProxy 浏览器
message|请在上方地址栏中输入您要访问的地址.
navigate|跳转到:
encode|加密地址
debug|调试模式
hide_bar|隐藏地址栏
25 changes: 25 additions & 0 deletions frames/index.php
@@ -0,0 +1,25 @@
<?php
include_once('knproxy_i18n.php');
include_once('../conf.php');
$_LANG = KNPROXY_LANGUAGE;
$_KNPROXY_NAVIGATOR_PAGE='navigator_bar.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<script language="javascript" type="text/javascript">
<!--
function url_change(URL)
{
fixed.KN_BFORM.url.value=URL ;
}
-->
</script>
<TITLE><?php echo knproxy_i18n('title',$_LANG)?></TITLE>
</HEAD>
<FRAMESET rows="45,*" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0" name="KNBROWSER_MAIN">
<FRAME name="fixed" src="<?php echo $_KNPROXY_NAVIGATOR_PAGE . '?lang=' . $_LANG;?>" marginwidth="2" marginheight="6" frameborder="0" noresize scrolling="no" >
<FRAME name="dynamic" src="dynami_index.php<?php echo '?lang=' . $_LANG;?>" frameborder="0" marginwidth="5" marginheight="5" >
</FRAMESET>
</HTML>
27 changes: 27 additions & 0 deletions frames/knproxy_i18n.php
@@ -0,0 +1,27 @@
<?php
function knproxy_i18n($string,$lang)
{
if(!file_exists('i18n/' . $lang . '.ktr')){
return;//FAIL
}
$f=@file_get_contents('i18n/' . $lang . '.ktr');
$f_arr=explode("\n",$f);
foreach($f_arr as $f_)
{
$f_ = explode('|',$f_);
if($f_[0]==strtolower($string))
{
return $f_[1];
}
}
return false;
}
function knproxy_translate($text,$lang,$replacement)
{
$a=knproxy_i18n($text,$lang);
if($a)
return $a;
else
return $replacement;
}
?>
47 changes: 47 additions & 0 deletions frames/navigator_bar.php
@@ -0,0 +1,47 @@
<?php
include_once('knproxy_i18n.php');
include_once('../conf.php');
if(!defined('ALLOW_NAVBAR') || ALLOW_NAVBAR!='true'){
header('HTTP/1.1 404 Not Found');
exit('<html><title>404 Not Found</title><h1>404 Not Found</h1></html>');
}
$_LANG = KNPROXY_LANGUAGE;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<script language="javascript" type="text/javascript" src="../js/denpa.js?<?php echo time();?>"></script>
<script language="javascript" type="text/javascript" src="../js/denjihou.js?<?php echo time()-56;?>"></script>
<script language="javascript" type="text/javascript">
<!--
function checkAndEncode(){
if(document.getElementById("check_enc").checked){
var random = Math.floor(Math.random() * 255)+1;
var url_value = document.getElementById("url_").value;
document.getElementById("url").value = encryptText(document.getElementById("url_").value,random);
document.getElementById("encrypt_key").value = random;
return true;
}else{
document.getElementById("url").value = document.getElementById("url_").value;
return true;
}
}
-->
</script>
<style>body{background: #000000;color: #ffffff;}a{color: #ffffff;}</style></head>
<body style="height:50px;position:fixed;top:0;left:0;width:100%;">

<form name="KN_BFORM" action="../index.php" method="GET" target="dynamic" onsubmit="return checkAndEncode();">
<div style="height: 45px;padding: 0px;">
<input type="submit" value="<?php echo knproxy_i18n('navigate',$_LANG);?>" style="font-size: 1em;">
<input type="hidden" id="url" name="url" value=""/>
<input type="text" id="url_" size="65%" value="http://" ondblclick="this.value='';" style="font-family: Arial;font-weight: bold;font-size: 1em;">
<input type="checkbox" id="check_enc" value="1" CHECKED><?php echo knproxy_i18n('encode',$_LANG);?>&nbsp;
<input type="checkbox" name="debug" value="true"><?php echo knproxy_i18n('debug',$_LANG);?>
<div style="float:right;height:44px;padding-top:5px;padding-right:5px;" valign="center"><a href="javascript:;" onclick="top.location = top.dynamic.location;"><?php echo knproxy_i18n('hide_bar',$_LANG);?></a></div>
<input type="hidden" name="encrypt_key" id="encrypt_key" value="" />
</div>
</form>

</body>
</html>

0 comments on commit 36fd34a

Please sign in to comment.