cookie刷新限制的方式:当前时间-上一次请求的时间<1的时候会有页面重载的提示。
- if(($attackevasive & 2) && ($_SERVER['HTTP_X_FORWARDED_FOR'] ||
- $_SERVER['HTTP_VIA'] || $_SERVER['HTTP_PROXY_CONNECTION'] ||
- $_SERVER['HTTP_USER_AGENT_VIA'] || $_SERVER['HTTP_CACHE_INFO'] ||
- $_SERVER['HTTP_PROXY_CONNECTION'])) {
- securitymessage('attackevasive_2_subject', 'attackevasive_2_message', FALSE);
- }
限制代理访问的方式。
- if($attackevasive & 4) {
- if(empty($lastrequest) || TIMESTAMP - $lastrequest > 300) {
- securitymessage('attackevasive_4_subject', 'attackevasive_4_message');
- }
- }
二次请求的方式:当前时间-上一次请求时间>300秒的时候会有页面重载的提示。
- if($attackevasive & 8) {
- list($visitcode, $visitcheck, $visittime) = explode('|', authcode($_G['cookie']['visitcode'], 'DECODE'));
- if(!$visitcode || !$visitcheck || !$visittime || TIMESTAMP - $visittime > 60 * 60 * 4 ) {
- if(empty($_POST['secqsubmit']) || ($visitcode != md5($_POST['answer']))) {
- $answer = 0;
- $question = '';
- for ($i = 0; $i< rand(2, 5); $i ++) {
- $r = rand(1, 20);
- $question .= $question ? ' + '.$r : $r;
- $answer += $r;
- }
- $question .= ' = ?';
- dsetcookie('visitcode', authcode(md5($answer).'|0|'.TIMESTAMP, 'ENCODE'), TIMESTAMP + 816400, 1, true);
- securitymessage($question, '<input type="text" name="answer" size="8" maxlength="150" />
<input type="submit" name="secqsubmit" class="button" value=" Submit " />', FALSE, TRUE);- } else {
- dsetcookie('visitcode', authcode($visitcode.'|1|'.TIMESTAMP, 'ENCODE'), TIMESTAMP + 816400, 1, true);
- }
- }
- }