NJU WEB BBS 0.9 存在远程格式化字符串漏洞
1、日期
发现日期:2001年10月
公布日期:2001年11月1日
发 现 者: By NetGuard Security Team
alert7 (alert7@netguard.com.cn)
主 页: http://www.netguard.com.cn
2、存在漏洞软件
NJUWEBBS-0.9是一个用于FB3 &FB2000的WEB to BBS系统,在中国教育网内使用极为广泛的bbs程序。
该程序存在一些格式化字符串漏洞,可能导致远程用户取得一个bbs shell并进一步提高权限。
3、受影响版本及系统
影响软件:NJU WEB BBS v0.9,可能包含以前版本
影响系统:Linux
4、细节
a、bbssig.c存在格式化字符串漏洞
$ cat bbssig.c
#include "BBSLIB.inc"
FILE *fp;
int main() {
FILE *fp;
char *ptr, path[256], buf[10000];
init_all();
if(!loginok) http_fatal("匆匆过客不能设置签名档,请先登录");
printf("
%s -- 设置签名档 [使用者: %s]
\n",
BBSNAME, currentuser.userid);
sprintf(path, "home/%c/%s/signatures",
toupper(currentuser.userid[0]), currentuser.userid);
if(!strcasecmp(getparm("type"), "1")) save_sig(path);
printf("
\n");
http_quit();
}
int save_sig(char *path) {
char *buf;
fp=fopen(path, "w");
buf=getparm("text");
fprintf(fp, "%s", buf);
fclose(fp);
printf("签名档修改成功。");
http_quit();
}
-------------
char *void1(unsigned char *s) {
int i;
int flag=0;
for(i=0; s[i]; i++) {
if(flag==0) {
if(s[i]>=128) flag=1;
continue;
}
flag=0;
if(s[i]<32) s[i-1]=32;
}
if(flag) s[strlen(s)-1]=0;
return s;
}
b、bbsmnote.c,bbsplan.c都有类似的情况
c、测试
设置签名档 为%08x.%08x.%08x.%08x.%08x
读出为0000004a.40151a60.78383025.3830252e.30252e78
设置签名档 为%n
直接coredump
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, alert7@netguard.com.cn and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log
5、利用程序
暂不提供
6、临时解决办法
将printf(void1(buf));改为printf("%s",void1(buf));
7、厂商信息
厂商主页:http://bbs.nju.edu.cn/
软件包下载地址:http://bbs.nju.edu.cn/download/NJUWEBBS-0.9.tgz
8、关于Netgaurd
------------
北京华泰网安信息技术有限公司(China Net Security Technology
Corporation)是一家专业从事计算机网络与信息安全服务、安全产品研发和销售、安全工
程系统集成、计算机网络与信息安全研究、咨询、培训、安全认证等业务的高新技术企业
,是国内领先的计算机网络与信息安全解决方案和服务提供商。