的是,不象NT,您能够用以下三个简单的手段把SUN变的相对安全些,他们是:
1)防止堆栈溢出
2)关闭不用的服务
3)给系统打补丁
#1 防止堆栈溢出
至少90%以上的安全问题都是来自所谓的“堆栈溢出”。攻击者通过给一个以root身份
运行的程式提供比他所预期的输入多得多的东西,使被攻击程式无法处理而改变执行
流程去执行攻击者指定的代码。
Solaris 2.6和Solaris 7都具备把用户堆栈设成不可执行的能力,以使这种攻击不
能得逞。要使能这个特点:
0)变成root
1)对/etc/system文档做个拷贝
cp /etc/system /etc/system.BACKUP
2)用您最钟爱的编辑器编辑/etc/system文档
3)到文档的最后,插入以下几行:
set noexec_user_stack=1
set noexec_user_stack_log=1
4)保存文档,退出编辑器
一旦重启机器,这些改变就会生效。假如这不是个您能够关闭的系统,那么您用
adb来改变一个运行中的系统的参数也是可能的,但这不是我个人乐意去干的事。
当然会有些合法使用可执行堆栈的程式在您做出如上改变后而不能正常运行。所幸
的是这样的程式的并不多,我所知的就只有GNU ada 编译器。
#2 在inetd.conf中关闭用不着的服务
有许多用不着的服务自动的处于使能状态。他们中可能存在的漏洞将使攻击者甚至
无需一个账户就能控制您的机器。关闭这些无需的服务来保护您的系统,您可
以用如下方法来关闭:
0)变成root
1)对inetd的配置文档/etc/inetd.conf做个拷贝
cp /etc/inetd.conf /etc/inetd.conf.BACKUP
2)编辑/etc/inetd.conf文档
未被激活的服务是在前面被“#“符号注释掉的,举个例子,您的部份inetd.conf可能
是这样的:
# Tnamed serves the obsolete IEN-116 name server protocol.
#
name dgram udp wait root /usr/sbin/in.tnamed in.tnamed
无需这个服务,因为您们中的99.999%不会用到这个“已被废弃的IEN-116名字服务
协议“,把这个注释掉以后,这行看起来会象是:
# Tnamed serves the obsolete IEN-116 name server protocol.
#
#name dgram udp wait root /usr/sbin/in.tnamed in.tnamed
^
|
看到这个新的“#” 符号了吧
我建议注释掉几乎任何的服务,只留下:
ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd
telnet stream tcp nowait root /usr/sbin/in.telnetd in.telnetd
time stream tcp nowait root internal
time dgram udp wait root internal
echo stream tcp nowait root internal
echo dgram udp wait root internal
discard stream tcp nowait root internal
discard dgram udp wait root internal
daytime stream tcp nowait root internal
daytime dgram udp wait root internal
rstatd/2-4 tli rpc/datagram_v wait root /usr/lib/netsvc/rstat/rpc.rstatd rpc.rstatd
fs stream tcp wait nobody /usr/openwin/lib/fs.auto fs
100083/1 tli rpc/tcp wait root /usr/dt/bin/rpc.ttdbserverd rpc.ttdbserverd
在只需要不多图像操作的服务器或是要确保相当的安全,您也许应该关掉字体服务fs,也能够
关掉系统性能监控器rstatd和tooltalk服务器ttdbserverd。事实上在确实需要安全的机器上
您甚至应该注释掉telnet和ftp。
您能够用grep找出机器能过inetd所提供的服务:
grep -v "^#" /etc/inetd.conf
这将返回/etc/inetd.conf中任何没被注释掉的行。
3)在/etc/inetd.conf中做出改变之后,找到inetd进程的id号,用kill向他发送HUP信号来刷新
他。一定要确保kill了inetd进程后,他还在运行,例如:
root@multics: ps -ef | grep inetd
root 196 1 0 15:32:14 ? 0:00 /usr/sbin/inetd -s
root@multics: kill -HUP 196
root@multics: ps -ef | grep inetd
root 196 1 0 15:32:14 ? 0:00 /usr/sbin/inetd -s
#3 给系统打补丁
跟任何的复杂系统相同,SUN有他的漏洞,其中的一些从性质上来说是相当严重的。SUN公司有向
他的客户甚至是没有技术支持的客户提供补丁的优良传统。这些补丁或以集合包或以单个补
丁的形式存在的。不幸的是,要完全修补您的系统,既需要大的补丁集合包,又需要单个的补丁。
然而我们将介绍一种把补丁包和单个补丁结合起来使用的方法。
1)变成root
2)键入
umask 022
来配置您的许可模式--给系统打补丁不但需要任何的补丁被"nobody"用户可读,而且包括补丁之
前的任何目录(不要问为什么,反正是一般这么干的)。
3)创建一个叫“patch“的目录,并进入他,我一般是这样做的:
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



