本文详细介绍Linux下防范缓冲区溢出攻击安全策略
通过研究,我们总结了在Linux平台下防范缓冲区溢出的安全策略,这些安全策略可以应用于一般企业内部服务器,包括web服务器、mail服务器、samba服务器、ftp服务器以及proxy服务器等。我们所总结的这些安全策略如下所示:
1. 不显示系统提示信息
如果不想让远程登录的用户看到系统的提示信息,可以改变"/etc/inetd.conf"文件中的telnet设置:
telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd -h在末尾加上"-h"参数可以让daemon不显示任何系统信息,只显示登录提示。当然,只有在服务器上装了telnet服务器才有这样做的必要。
2. 处理"rc.local"文件
在默认情况下,当登录装有Linux系统的计算机时,系统会告诉你Linux发行版的名字、版本号、内核版本和服务器名称。这泄露了太多的系统信息。出于安全的考虑,最好只显示一个"Login:"的提示信息。处理方法如下: (1)编辑"/etc/rc.d/rc.local"文件,在下面这些行的前面加上"#":
……
# This will overwrite /etc/issue at every boot. So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
#echo "" > /etc/issue
#echo "$R" >> /etc/issue
#echo "Kernel $(uname -r) on $a $(uname -m)" >> /etc/issue
#
#cp -f /etc/issue /etc/issue.net
#echo >> /etc/issue
……
(2)删除"/etc"目录下的"issue.net"和"issue"文件:
[root@snow]# rm -f /etc/issue
[root@snow]# rm -f /etc/issue.net
作者:薛静锋 责编:豆豆技术应用