代码审计之配置
register_globals:php<5.4.0 PHP_INI_ALL:可在任何地方設(shè)置
<?php
if($user == 'admin'){
echo 'true';
}
?>
?
allow_url_include:在5.2.0及以后默認(rèn)off PHP_INI_ALL:可在任何地方設(shè)置(allow_url_fopen)
<?php
include $_GET['a'];
?>
a=http://127.0.0.1/php.txt
?
magic_quotes_gpc:get/post/cookie-->',",\,NULL
php5不會(huì)處理$_SERVER,client-ip,referer
php5.4后magic_quotes_gpc取消
4.2.3之前->PHP_INI_ALL:可在任何地方設(shè)置
大于4.2.3:PHP_INI_PERDIR:php.ini,.htaccess,httpd.conf
?
magic_quotes_runtime:-->處理',",\,NULL 加\
處理對(duì)象:數(shù)據(jù)庫(kù),文件文件中獲取的數(shù)據(jù)過(guò)濾
php5.4后magic_quotes_gpc取消
配置范圍:PHP_INI_ALL:可在任何地方設(shè)置
?
magic_quotes_sybase:為on覆蓋gpc
get、post、cookie---->轉(zhuǎn)義空字符和'->"
PHP_INI_ALL,在PHP5.4.0后移除
?
safe_mode:(安全模式)
safe_mode_include_dir,safe_mode_exec_dir
open_basedir:(可訪問(wèn)目錄)
注意:設(shè)置/www/a,/www/a和/www/ab都可訪問(wèn)
?
disable_functions:( 禁用函數(shù))
dl()可加載自定義的php擴(kuò)展突破disable_functions的限制
php.ini only
display_errors和error_reporting
display_errors會(huì)先錯(cuò)誤
- display_errors=on時(shí),可配置error_reporting
轉(zhuǎn)載于:https://www.cnblogs.com/lly-lly/p/5390873.html
總結(jié)
- 上一篇: 计算机数据恢复专业,专业电脑数据恢复软件
- 下一篇: 华北电力大学计算机科学与技术考研,华北电