今天在我的 phpbb 论坛中受到了很多奇怪的访问,访问量大增的同时,apache 的log文件中有以下这些特殊的log文字:
213.196.37.235 - - [19/Feb/2005:02:26:54 +0800] "GET /viewtopic.php?p=2936&highlight=%2527%252Esystem(chr(112)%252Echr(101)%252Echr(114)很显然是一种扫描或者爬虫。查询了很多关于 apache 和 phpbb 的资料,现在把这些东东都整理了一下。
%252Echr(108)%252Echr(32)%252Echr(45)%252Echr(101)%252Echr(32)%252Echr(34)%252
Echr(112)%252Echr(114)%252Echr(105)%252Echr(110)%252Echr(116)%252Echr(32)%252Echr
HTTP/1.0" 200 24984 "-" "Mozilla/4.0"
137.111.13.34 - - [19/Feb/2005:02:29:29 +0800] "GET /viewtopic.php?p=1672&highlight=%2527%252Esystem(chr(112)%252Echr(101)%252Echr(114)
%252Echr(108)%252Echr(32)%252Echr(45)%252Echr(101)%252Echr(32)%252Echr(34)%252
Echr(112)%252Echr(114)%252Echr(105)%252Echr(110)%252Echr(116)%252Echr(32)%252
HTTP/1.1" 200 32237 "-" "Opera/7.50"
参考文档:
L. Walker 阐述了关于 PHPbb2 forum 的这个问题。
phpBB 对此 bug 也做出了相应的 announcement. 具体修改 < 2.0.11 版本 phpBB 中的 viewtopic.php 如下:
//
// Was a highlight request part of the URI?
//
$highlight_match = $highlight = '';
if (isset($HTTP_GET_VARS['highlight']))
{
// Split words and phrases
$words = explode(' ', trim(htmlspecialchars(urldecode($HTTP_GET_VARS['highlight']))));
for($i = 0; $i < sizeof($words); $i++)
{
替换成:
//
// Was a highlight request part of the URI?
//
$highlight_match = $highlight = '';
if (isset($HTTP_GET_VARS['highlight']))
{
// Split words and phrases
$words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight'])));
for($i = 0; $i < sizeof($words); $i++)
{
万幸的是最后发现我在很久以前就补上了这个漏洞,但直到今天才发现这个问题。以上仅供使用 phpBB 的用户参考。
(END)