我检查了我的access.log
文件,发现了以下几行:
66.240.236.119 - - [26/Apr/2019:04:15:56 +0200] "\n" 400 3245 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:15:58 +0200] "\n" 400 3261 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:15:58 +0200] "\n" 400 3239 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:15:59 +0200] "\n" 400 3239 "-" "-"
66.240.236.119 - - [26/Apr/2019:04:16:00 +0200] "\n" 400 3239 "-" "-"
方法是怎么来的\n
?我以前没有在访问日志中遇到过这个问题,所以我有点担心。
答案1
看起来有人触发了“换行请求”,例如
printf '\n' | nc localhost 80
这会在 access.log 中生成以下内容:
127.0.0.1 - - [27/Apr/2019:01:39:38 +0200] "\n" 400 0 "-" "-"
可能是为了测试你的服务器......