Avenger's news系统存在远程命令可执行漏洞发布时间:2002-02-26 更新时间:2002-02-26 严重程度:高 威胁程度:普通用户访问权限 错误类型:输入验证错误 利用方式:服务器模式 BUGTRAQ ID:4149 受影响系统 Avenger's News System Avenger's News System 2.01详细描述 Avenger's News System (ANS) 是一款基于WEB的新闻管理系统。 ANS没有过滤从WEB请求的SHELL元字符,可以导致远程命令可执行,结果导致远程 用户以WEB用户身份执行任意代码。 测试代码 ans.pl?p=../../../../bin/command argument|&blah 解决方案 采用如下补丁代码: if (substr($QUERY, 0, 2) eq "p="){ $QUERY =~ s/([\&;\`'\\\|"*?~<>^\(\)\[\]\{\}\$\n\r])/\\$1/g; #filter meta characters $QUERY =~ s/\.\.//g; #filter double dot (..) $plugin = substr((split /&/, $QUERY)[0], 2); if (index("$QUERY", "&") < 0) { $QUERY = ""; } else { $QUERY = substr($QUERY, index("$QUERY", "&")+1); } open (PLUGIN, "<$FILE_LOCATION/$plugin"); #added a < to the open() - readonly @plugin = <PLUGIN>; close (PLUGIN); eval("@plugin"); exit; } 相关信息 "b0iler _" <b0iler@hotmail.com>. 参考:http://online.securityfocus.com/archive/1/257367 相关主页:http://ans.gq.nu/ |