Files
BlueLotus_XSSReceiver/auth.php
firesun 82227be6bd Version 3.5.3
1. 增加referer校验防御CSRF
2. 修复若干小bug
3. 更新IP库
2022-05-24 00:13:20 +08:00

35 lines
1020 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if (!defined('IN_XSS_PLATFORM')) {
exit('Access Denied');
}
require_once('functions.php');
//设置httponly
ini_set('session.cookie_httponly', 1);
session_start();
//判断登陆情况ip和useragent是否改变改变则强制退出
if ( !(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true && isset($_SESSION['user_agent']) && $_SESSION['user_agent'] != "" && $_SESSION['user_agent'] === $_SERVER['HTTP_USER_AGENT']) ) {
$_SESSION['isLogin'] = false;
$_SESSION['user_IP'] = "";
$_SESSION['user_agent'] = "";
session_unset();
session_destroy();
header('Location: login.php');
exit();
}
if ( ADMIN_IP_CHECK_ENABLE && !(isset($_SESSION['user_IP']) && $_SESSION['user_IP'] != '' && $_SESSION['user_IP'] === getRealIP()) ) {
$_SESSION['isLogin'] = false;
$_SESSION['user_IP'] = '';
$_SESSION['user_agent'] = '';
session_unset();
session_destroy();
header('Location: login.php');
exit();
}
//开启CSP
require_once('waf.php');