荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: michaelx (Tiger Lazy), 信区: Security
标  题: Squid缓冲溢出
发信站: 荔园晨风BBS站 (Thu Feb 28 10:58:31 2002), 转信

Squid缓冲溢出 (APP,缺陷)

涉及程序:
Squid2.3/2.4

描述:
Squid(web proxy/cache server)存在缓冲溢出漏洞

详细:
Squid,是一个常用的web proxy/cache server。这个软件在解析FTP请求时,存在
缓冲区溢出可能。特定的FTP请求可以引起Squid子进程崩溃,而且如果重复这些请
求的话,将使server不可访问。这个错误可能导致远程黑客通过exploit程序获取
root shell控制权。攻击成功的条件是server允许攻击者使用该server。

程序溢出的错误在ftp.c的ftpBuildTitleUrl()函数。当建立一个URL时,程序首先
计算所需要的空间:
   len = 64
      + strlen(ftpState->user)
      + strlen(ftpState->password)
      + strlen(request->host)
      + strLen(request->urlpath);

然后分配内存:
Then it allocates memory:

   t = ftpState->base_href = xcalloc(len, 1);

然后用strcat函数放置URL字符串:
And then puts together the URL string with strcat:

   strcat(t, "ftp://");
   if (strcmp(ftpState->user, "anonymous")) {
      strcat(t, rfc1738_escape_part(ftpState->user));
      if (ftpState->password_url) {
         strcat(t, ":");
         strcat(t, rfc1738_escape_part(ftpState->password));
      }
      strcat(t, "@");
   }
   strcat(t, request->host);
   if (request->port != urlDefaultPort(PROTO_FTP))
      snprintf(&t[strlen(t)], len - strlen(t), ":%d", request->port);
   strcat(t, strBuf(request->urlpath));
   strcat(t, "/");

在rfc1738_escape_part()的使用中,如果user和password两个参量由过长的特殊
字符组成,则将发生溢出错误,可能在原来分配的内存
空间之外运行指令。
利用该弱点可以导致拒绝服务和编写shell code入侵程序。由于默认情况下Squid
允许以root身份运行(除非在squid.conf中使用chroot选项),此漏洞使入侵者可
能获取root权限。




解决方案:
SOLUTIONSquid开发者在2月16日收到漏洞通报后在3小时以内即给漏洞发现者发送
了补丁程序。可见开发者早已经了解该问题。
参见: http://www.squid-cache.org/Advisories/SQUID-2002_1.txt
升级版本:
http://www.squid-cache.org/Versions/v2/2.4/
补丁:
http://www.squid-cache.org/Versions/v2/2.4/bugs/

检测方式:
enable-snmp configure option,enabled in squid.conf (snmp_port option).
You can check to see whether the SNMP code is enabled by looking for the
 following message in cache.log when Squid is started:

  'Accepting SNMP messages on port'

Similarly for the HTCP issue, but looking for the message

  'Accepting HTCP messages on port'

The ftp:// issue cannot be verified as easily, but if you are running
Squid-2.3 or Squid-2.4 up to and including
Squid-2.4.STABLE3 then you are most likely vulnerable to the ftp://
issue unless you have taken action.



--
M.X的FTP SERVER
ftp://192.168.55.18

※ 来源:·荔园晨风BBS站 bbs.szu.edu.cn·[FROM: 203.93.19.1]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店