首页 -> 安全研究

安全研究

安全漏洞
Extropia WebBanner 输入验证漏洞

发布日期:2000-06-16
更新日期:2000-06-16

受影响系统:

Extropia WebBanner 4.0
描述:

Extropia WeBanner 是一个开放源码的PERL CGI工具包,WEB管理员利用它可以随机
显示banner。工具包中有一个组件index.cgi,使用了一个用户可输入的http变量
html_file,它最终传递该变量到open()调用,但是没有检查元字符,于是有可能在
目标主机上远程执行任意命令、获取当前WEB服务所拥有的全部特权。

<* 来源:Johannes Westerink (jwesterink@johannes2.daxis.nl) *>



测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!


http://yourdomain/random_banner/index.cgi?image_list=alternative_image.list&
html_file=../../../../../etc/passwd

建议:

Johannes Westerink 提供了一个临时的补丁程序:

>---[ line 195 + ]-------------------------------------------------
open (HTML_FILE, "$html_file") ||
&CgiDie (" blablabla... ");
while (<HTML_FILE>)
{
if (/\<!--IMG GOES HERE--\>/)
{
print qq!
<A HREF = "$random_url">
<IMG SRC = "$image_url/$random_image"></A>!;
} else

print "$_";
}
}
close (HTML_FILE);
<------------------------------------------------------------------
上面是有问题的代码部分,建议改成下面的代码:

>---[ change above snippet to this snippet! ]----------------------
$html_file =~ s/\%([\d\w]{2})/pack('c',hex($1))/gie;

if( $html_file =~ /\.\.\/|\|/ )
{
&CgiDie( "Not allowed... " );
} else {
open (HTML_FILE, "$html_file") ||
&CgiDie ( "I'm sorry, but I was unable to open the requested
HTML file in the Insert Random Banner Into Page routine. The
value I have is $html_file. Would you please check the path and
the permissions for the file." );
while (<HTML_FILE>)
{
if (/\<!--IMG GOES HERE--\>/)
{
print qq!
<A HREF = "$random_url">
<IMG SRC = "$image_url/$random_image"></A>!;
} else

print "$_";
}
}
close (HTML_FILE);
}


浏览次数:6138
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障