Beispiel #1
0
 static function check($str, $v)
 {
     foreach ($v as $key => $value) {
         if (preg_match("/" . $value . "/is", $str) == 1 || preg_match("/" . $value . "/is", urlencode($str)) == 1) {
             Waf::write_log("IP: " . $_SERVER["REMOTE_ADDR"] . " - 时间: " . strftime("%Y-%m-%d %H:%M:%S") . " - 页面:" . $_SERVER["PHP_SELF"] . " - 提交方式: " . $_SERVER["REQUEST_METHOD"] . " - 提交数据: " . $str);
             waf::render('你被抓住了!你的行为已经记录在系统日志中!');
             exit;
         }
     }
 }
Beispiel #2
0
require iPHP_PATH . '/iPHP.define.php';
header('Content-Type: text/html; charset=' . iPHP_CHARSET);
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
if (function_exists('memory_get_usage') && (int) @ini_get('memory_limit') < abs(intval(iPHP_MEMORY_LIMIT))) {
    @ini_set('memory_limit', iPHP_MEMORY_LIMIT);
}
@ini_set('date.timezone', iPHP_TIME_ZONE);
//设置时区
function_exists('date_default_timezone_set') && date_default_timezone_set(iPHP_TIME_ZONE);
require iPHP_PATH . '/iPHP.compat.php';
require iPHP_PATH . '/iPHP.class.php';
set_error_handler('iPHP_ERROR_HANDLER');
iPHP::timer_start();
//waf
iPHP::LoadClass("Waf");
waf::filter();
//security
iPHP::LoadClass("Security", 'S');
iS::filter();
iS::GP('page', 'GP', 2);
define('__SELF__', $_SERVER['PHP_SELF']);
define('__REF__', $_SERVER['HTTP_REFERER']);
$iDB_CLASS = 'Mysql';
iPHP_DB_TYPE == 'mysql' && version_compare(PHP_VERSION, '5.5', '>=') && ($iDB_CLASS = 'Mysqli');
iPHP_DB_TYPE == 'pgsql' && ($iDB_CLASS = 'Pgsql');
iPHP_DB_TYPE == 'sqlite' && ($iDB_CLASS = 'SQLite');
iPHP::loadClass($iDB_CLASS, 'DB');
//加载数据库操作类
iPHP::loadClass("FileSystem", 'FS');
//加载文件操作类
iPHP::loadClass('Cache');