本文章来给大家介绍PHPCMS 2008 最新漏洞图文测试详解,有需要了解的同学可进入参考参考。
Phpcms2008 是一款基于 PHP+Mysql 架构的网站内容管理系统,也是一个开源的 PHP 开发平台。Phpcms 采用模块化方式开发,功能易用便于扩展,可面向大中型站点提供重量级网站建设解决方案。3年来,凭借 Phpcms 团队长期积累的丰富的Web开发及数据库经验和勇于创新追求完美的设计理念,使得 Phpcms 得到了近10万网站的认可,并且越来越多地被应用到大中型商业网站。
0x02 写在前面的话
$dbclass = 'db_'.DB_DATABASE; require $dbclass.'.class.php'; $db = new $dbclass; $db->connect(DB_HOST, DB_USER, DB_PW, DB_NAME, DB_PCONNECT, DB_CHARSET); require 'session_'.SESSION_STORAGE.'.class.php'; $session = new session(); session_set_cookie_params(0, COOKIE_PATH, COOKIE_DOMAIN); if($_REQUEST) { if(MAGIC_QUOTES_GPC) { $_REQUEST = new_stripslashes($_REQUEST); if($_COOKIE) $_COOKIE = new_stripslashes($_COOKIE); extract($db->escape($_REQUEST), EXTR_SKIP); } else { $_POST = $db->escape($_POST); $_GET = $db->escape($_GET); $_COOKIE = $db->escape($_COOKIE); @extract($_POST,EXTR_SKIP); @extract($_GET,EXTR_SKIP); @extract($_COOKIE,EXTR_SKIP); } if(!defined('IN_ADMIN')) $_REQUEST = filter_xss($_REQUEST, ALLOWED_HTMLTAGS); if($_COOKIE) $db->escape($_COOKIE); } //echo QUERY_STRING; if(QUERY_STRING && strpos(QUERY_STRING, '=') === false && preg_match("/^(.*).(htm|html|shtm|shtml)$/", QUERY_STRING, $urlvar)) { //var_dump($urlvar[1]); //echo 'test'; parse_str(str_replace(array('/', '-', ' '), array('&', '=', ''), $urlvar[1])); } Salin selepas log masuk |
if(QUERY_STRING && strpos(QUERY_STRING, '=') === false && preg_match("/^(.*).(htm|html|shtm|shtml)$/", QUERY_STRING, $urlvar)) { //var_dump($urlvar[1]); //echo 'test'; parse_str(str_replace(array('/', '-', ' '), array('&', '=', ''), $urlvar[1])); } Salin selepas log masuk |
define('HTTP_REFERER', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''); define('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : preg_replace("/(.*).php(.*)/i", "<span>\1.php"</span>, $_SERVER['PHP_SELF'])); define('QUERY_STRING', safe_replace($_SERVER['QUERY_STRING'])); Salin selepas log masuk |
$db->query("UPDATE ".DB_PRE."ads SET `clicks`=clicks+1 WHERE adsid=".$ads['adsid']); $info['username'] = $_username; $info['clicktime'] = time(); $info['ip'] = IP; $info['adsid'] = $id; $info['referer'] = HTTP_REFERER; $year = date('ym',TIME); $table = DB_PRE.'ads_'.$year; $table_status = $db->table_status($table); //echo 'test'; if(!$table_status) { include MOD_ROOT.'include/create.table.php'; } $db->insert($table, $info); Salin selepas log masuk |
function insert($tablename, $array) { $this->check_fields($tablename, $array); return $this->query("INSERT INTO `<span>$tablename`(`"</span>.implode('`,`', array_keys($array))."`) VALUES('".implode("','", $array)."')"); //echo "INSERT INTO `$tablename`(`".implode('`,`', array_keys($array))."`) VALUES('".implode("','", $array)."')"; } Salin selepas log masuk |