SUN系统的基本安全配置
一个SUN系统就象和NT系统一样,容易受到来自internet的各种可恶的攻击。幸运
的是,不象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 上一篇:SUN的PROM状态命令与参数 下一篇:Solaris安全FAQ 更多相关文章
|
推荐文章
精彩文章
|