嘿,我正在尝试找到每个ip每天记录的许多攻击。我正在读取syslog文件。
这里有几行我正在读的代码
引述:
Jan 10 09:32:09 j4-be03 sshd[3876]: Failed password for root from 218.241.173.35 port 47084 ssh2
Jan 10 09:32:19 j4-be03 sshd[3879]: Failed password for root from 218.241.173.35 port 47901 ssh2
Feb 7 17:19:16 j4-be03 sshd[10736]: Failed password
我需要设置一个cookie来保持用户登录状态。我将对用户名、密码和IP进行哈希处理。我的代码:
login process:
$hashed = md5($username.$pwd.IP);
setcookie('userstate', $username.':'.$hashed);
restore user state:
$vars = split(':', $_COOKIE['userstate']);
pseudo: get user with username in $vars[0]
$hashed = md5($us