예제 #1
0
/**
 *  攻击检查拦截
 */
function webscan_StopAttack($StrFiltKey, $StrFiltValue, $ArrFiltReq, $method)
{
    $StrFiltValue = webscan_arr_foreach($StrFiltValue);
    if (preg_match("/" . $ArrFiltReq . "/is", $StrFiltValue) == 1) {
        webscan_slog(array('ip' => $_SERVER["REMOTE_ADDR"], 'time' => strftime("%Y-%m-%d %H:%M:%S"), 'page' => $_SERVER["PHP_SELF"], 'method' => $method, 'rkey' => $StrFiltKey, 'rdata' => $StrFiltValue, 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'request_url' => $_SERVER["REQUEST_URI"]));
        $slog = 'ip=' . $_SERVER["REMOTE_ADDR"] . ',time=' . strftime("%Y-%m-%d %H:%M:%S") . ',page=' . $_SERVER["PHP_SELF"] . ',method=' . $method . ',rkey=' . $StrFiltKey . ',rdata=' . $StrFiltValue . ',user_agent=' . $_SERVER['HTTP_USER_AGENT'] . ',request_url=' . $_SERVER["REQUEST_URI"];
        tflog('dangerous.txt', $slog);
        exit(webscan_pape());
    }
    if (preg_match("/" . $ArrFiltReq . "/is", $StrFiltKey) == 1) {
        webscan_slog(array('ip' => $_SERVER["REMOTE_ADDR"], 'time' => strftime("%Y-%m-%d %H:%M:%S"), 'page' => $_SERVER["PHP_SELF"], 'method' => $method, 'rkey' => $StrFiltKey, 'rdata' => $StrFiltKey, 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'request_url' => $_SERVER["REQUEST_URI"]));
        $slog = 'ip=' . $_SERVER["REMOTE_ADDR"] . ',time=' . strftime("%Y-%m-%d %H:%M:%S") . ',page=' . $_SERVER["PHP_SELF"] . ',method=' . $method . ',rkey=' . $StrFiltKey . ',rdata=' . $StrFiltKey . ',user_agent=' . $_SERVER['HTTP_USER_AGENT'] . ',request_url=' . $_SERVER["REQUEST_URI"];
        tflog('dangerous.txt', $slog);
        exit(webscan_pape());
    }
    //$slog='ip='.$_SERVER["REMOTE_ADDR"].',time='.strftime("%Y-%m-%d %H:%M:%S").',page='.$_SERVER["PHP_SELF"].',method='.$method.',rkey='.$StrFiltKey.',rdata='.$StrFiltKey.',user_agent='.$_SERVER['HTTP_USER_AGENT'].',request_url='.$_SERVER["REQUEST_URI"];
    //tflog('ordinary.txt',$slog);
}
예제 #2
0
/**
 *  攻击检查拦截
 */
function webscan_StopAttack($StrFiltKey,$StrFiltValue,$ArrFiltReq,$method) {
  $StrFiltValue=webscan_arr_foreach($StrFiltValue);
  if (preg_match("/".$ArrFiltReq."/is",$StrFiltValue)==1){
    webscan_slog(array('ip' => $_SERVER["REMOTE_ADDR"],'time'=>strftime("%Y-%m-%d %H:%M:%S"),'page'=>$_SERVER["PHP_SELF"],'method'=>$method,'rkey'=>$StrFiltKey,'rdata'=>$StrFiltValue,'user_agent'=>$_SERVER['HTTP_USER_AGENT'],'request_url'=>$_SERVER["REQUEST_URI"]));
    exit(webscan_pape());
  }
  if (preg_match("/".$ArrFiltReq."/is",$StrFiltKey)==1){
    webscan_slog(array('ip' => $_SERVER["REMOTE_ADDR"],'time'=>strftime("%Y-%m-%d %H:%M:%S"),'page'=>$_SERVER["PHP_SELF"],'method'=>$method,'rkey'=>$StrFiltKey,'rdata'=>$StrFiltKey,'user_agent'=>$_SERVER['HTTP_USER_AGENT'],'request_url'=>$_SERVER["REQUEST_URI"]));
    exit(webscan_pape());
  }

}