????sql
????????
??????????????????????????????????php?????????????????????????屨????????(die()).
??????Σ????????????????????????????????????????????У?????????????????д???????????.
?????????php???????????????????????set_error_handler()???php???????????????trigger_error()??????????????????.
????set_error_handler()?????????????????????????.???????????????????????????????????.????????????????????????????????????.
??????????÷???
????????????:
function customerror($errno?? $errstr?? $errfile?? $errline)
{
echo <b>???????:</b> ??${errno}?? ${errstr}??r??n;
echo ?????????????У? {$errline} ???{$errfile}??r??n;
echo php?汾 ??php_version?? ( ?? php_os?? )??r??n;
// die();
}
????set_error_handler(customerror??e_all| e_strict);
??????????????????????κ?????????飬????????????????и?????????????log???.
????????????:
function slog($logs)
{
$toppath=log.htm;
$ts=fopen($toppath??a+);
fputs($ts??$logs. );
fclose($ts);
}
????????????????????????????????????$errno??$errstr??$errfile??$errline.
????errno????鳣???????????????????????????????????????????????????????????????????????.????e_warning??????????????4????????????.
?????????????????????????????????????set_error_handler.????????php???????????????.?????????????й?? ????????й???????????????e_error??e_parse??e_core_error??e_core_warning?? e_compile_error??e_compile_warning?????e_strict?е????.??Щ??????????????????????????.
????stopattack()????????????????post??get??cookie????????????????slog()д??log???.
????????????:
$exec_commond  = ( \s|\s)*(exec(\s|\+)+(s|x)p\w+)(\s|\s)*;
$simple_xss = ( \s|\s)*((%3c)|<)((%2f)|/)*[a-z0-9%]+((%3e)|>)(\s|\s)*;
$eval_xss  = ( \s|\s)*((%65)|e)(\s)*((%76)|v)(\s)*((%61)|a)(\s)*((%6c)|l)(\s|\s)*;
$image_xss  = ( \s|\s)*((%3c)|<)((%69)|i|i|(%49))((%6d)|m|m|(%4d))((%67)|g|g|(%47))[^\n]+((%3e)|>)(\s|\s)* ;
$script_xss = ( \s|\s)*((%73)|s)(\s)*((%63)|c)(\s)*((%72)|r)(\s)*((%69)|i)(\s)*((%70)|p)(\s)*((%74)|t)(\s|\s)*;
$sql_injection = ( \s|\s)*((%27)|(')|(%3d)|(=)|(/)|(%2f)|()|((%22)|(-|%2d){2})|(%23)|(%3b)|(;))+(\s|\s)*;
????hp????????????????????????λ?á???????????к??????????????????.??й??????·??????????????????????Щ????????? ????????????????????????????к?????????????????????. ??Щ???????php????????е? display_errors ????? off ???????????????????????????????.??Щ????????????php?????????????????.?????????????????????????????????????????????? ??.????????set_error_handler()?????Щì???????????????.