solaris加固.docx

上传人:b****3 文档编号:10386129 上传时间:2023-05-25 格式:DOCX 页数:12 大小:22.74KB
下载 相关 举报
solaris加固.docx_第1页
第1页 / 共12页
solaris加固.docx_第2页
第2页 / 共12页
solaris加固.docx_第3页
第3页 / 共12页
solaris加固.docx_第4页
第4页 / 共12页
solaris加固.docx_第5页
第5页 / 共12页
solaris加固.docx_第6页
第6页 / 共12页
solaris加固.docx_第7页
第7页 / 共12页
solaris加固.docx_第8页
第8页 / 共12页
solaris加固.docx_第9页
第9页 / 共12页
solaris加固.docx_第10页
第10页 / 共12页
solaris加固.docx_第11页
第11页 / 共12页
solaris加固.docx_第12页
第12页 / 共12页
亲,该文档总共12页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

solaris加固.docx

《solaris加固.docx》由会员分享,可在线阅读,更多相关《solaris加固.docx(12页珍藏版)》请在冰点文库上搜索。

solaris加固.docx

solaris加固

一、安全理念 

1、安全的隐患更多来自于企业内部 

2、对于管理员的需求:

不要信任所有人 

3、分层保护策略:

假设某些安全保护层完全失效 

4、服务最小化 

5、为最坏的情况做打算 

二、物理安全 

1、记录进出机房的人员名单,考虑安装摄像机 

2、审查PROM是否被更换,能通过记录hostid进行比较 

3、每个系统的OpenBoot口令应该不相同,口令方案不可预测 

4、系统安装完毕移除CD-ROM 

5、将版本介质放入不在本场地的介质储藏室中 

三、账号和口令策略 

1、终极用户的PATH(在/.profile中定义的)设置为:

 

PATH = /usr/bin:

/sbin:

/usr/sbin 

所有用户的PATH或LD_LIBRARY_PATH中都不应该包含“.” 

2、口令文件、影像文件、组文件 

/etc/passwd 必须所有用户都可读,root用户可写 ?

rw-r?

r?

 

/etc/shadow 只有root可读 ?

r-------- 

/etc/group 必须所有用户都可读,root用户可写 ?

rw-r?

r-- 

3、口令安全 

Solaris强制口令最少6位,不过终极用户修改口令的时候不受这个限制 

强迫test账号每隔30天修改一次口令 

#passwd ?

n 30 test 

强迫test账号在下次登录的时候修改口令 

#passwd ?

f test 

禁止test账号修改口令 

#passwd ?

n 2 ?

x 1 test 

封锁test账号,禁止登录 

#passwd ?

l test 

4、组口令 

用newgrp 命令临时改动gid 

由于sysadmin组可执行admintool,必须要保护好,增加组口令的过程:

 

删除不必的成员(如果成员属于sysadmin,改动组时不必口令) 

#passwd  (通常封锁的账号) 

提取/etc/shadow中user的口令字符串插入到/etc/group中sysadmin的口令字段 

封锁user账号 

5、修改口令策略 

/etc/default/passwd文件 

MAXWEEKS=4 口令至少每隔4星期更改一次 

MINWEEKS=1 口令至多每隔1星期更改一次 

WARNWEEKS=3 修改口令后第三个星期会收到快要修改口令的信息 

PASSLENGTH=6 用户口令长度不少于6个字符 

6、限制使用su的组(只允许sysadmin组执行su命令) 

#chgrp sysadmin /bin/su 

#chmod o-rwx /bin/su 

7、su的纪录 

/etc/default/su文件 

SULOG=/var/adm/sulog 

SYSLOG=YES 

CONSOLE=/dev/console 

PATH=/usr/bin:

 

SUPATH=/usr/sbin:

/usr/bin 

8、禁止root远程登录 

/etc/default/login中设置CONSOLE=/dev/null 

在/etc/ftpusers里加上root。

 

在SSH 设置文件加:

permitRootLogin = no 

(Solaris 9自带SSH,缺省就禁止root登陆,对 Solaris 9,/etc/ftpusers 不再使用,FTP设置文件都在 /etc/ftpd/ 下面。

如果 ftpd 启动时存在 /etc/ftpusers,他会被移动到 /etc/ftpd/下) 

四、系统加固 

1、为OpenBoot设置密码 

在Solaris中设置密码 # eeprom security-password 

在OpenBoot中设置密码 ok password 

在Solaris中设置安全级别(command) # eeprom security-mode=command 

在OpenBoot中设置安全级别(command) ok setenv security-mode command 

在OpenBoot中设置安全级别(full) ok setenv security-mode full 

2、取消不必须账号 

移去或锁定那些不是必须的帐号,比如sys\uucp\nuucp\listen等等,简单的办法是在/etc/shadow的password域中放上NP字符。

 

(简单办法是 passwd -l username) 

3、文件系统 

/etc目录中应该没有文件是组或其他用户可写的 

find /etc/ -type f ?

perm ?

g+w ?

print (查找组可写文件) 

find /etc/ -type f ?

perm ?

o+w ?

print (查找其他用户可写文件) 

chmod ?

R go-w /etc (改动所有错误的组/其他用户的写权限) 

/var/adm/utmp和/var/adm/utmpx文件的权限应该是644 

4、X-视窗系统手工锁定(当管理员离开计算机的时候) 

CDE中面板上的加锁图标 

Open视窗系统中-鼠标右键-Utilities-Lock Screen 

5、/etc的存取权限 

用chmod -R g-w /etc命令来移去组用户对/etc的写权限。

 

6、打开数据包转发 

#ndd ?

set /dev/ip ip_forwarding 1 (在系统作为路由器的情况中执行) 

关闭数据包转发 

#ndd ?

set /dev/ip ip_forwarding 0 (建议把这条命令加入/etc/init.d/inetinit中) 

忽略重定向数据包(否则有遭到DOS的隐患) 

#ndd ?

set /dev/ip ip_ignore_redirects 1 (加入/etc/init.d/inetinit) 

不发送重定向数据包 

#ndd ?

set /dev/ip ip_send_redirects 0 (加入/etc/init.d/inetinit) 

禁止转发定向广播(如果网桥连结则不禁止) 

#ndd ?

set /dev/ip ip_forward_directed_broadcasts 0 (加入/etc/init.d/inetinit) 

禁止转发在数据源设置了路由的数据包 

#ndd ?

set /dev/ip ip_forward_src_routed 0 (加入/etc/init.d/inetinit) 

7、利用/etc/notrouter关闭IP转发 

创建/etc/notrouter文件,重启计算机(入侵者如果能访问根目录,能使用ndd命令重新开启IP转发) 

/etc/inet/hosts中的设置 

127.0.0.1 Localhost (所有系统都有这一项) 

192.168.0.13 Loghost (syslog使用的) 

192.168.0.109 wy_solaris (主机IP和主机名) 

/etc/defaultrouter包含了默认路由器的名称或IP 

如果使用了默认路由器,在/etc/inet/hosts文件中必须包含路由器的名称,因为如果设置了路由表,系统将不会运行所有目录服务(DNS、NIS或NIS+) 

8、cron(任务在/var/spool/cron/crontabs/ 一般行为在/etc/default/cron) 

格式:

minute hour day-of-month month day-of-week command 

(每项间用空格,同一项两个数字间用逗号,每项为数字或星号) 

设置:

 

查看命令 crontab ?

(1)进入只有本用户可读的目录 

(2)crontab ?

l > mycronfile 

(3)编辑mycronfile 

(4)crontab < mycronfile 

不要使用crontab ?

e命令,因为他会在/tmp下建立所有用户都可读的crontab副本 

访问cron系统 

/etc/cron.d/cron.allow (允许) 

/etc/cron.d/cron.deny (不允许) 

存在cron.allow,其中没有某用户,则不允许此用户访问cron系统 

存在cron.deny,其中没有某用户,则允许此用户访问cron系统 

在/etc/default/cron里设置了"CRONLOG=yes" 来记录corn的动作 

PATH中不应包含“/tmp”“~”“.”字样 

at(任务在/var/spool/cron/atjobs) 

/etc/cron.d/at.allow和/etc/cron.d/at.deny和cron文件完全相同 

9、增加静态路由 

格式:

 route add net net-address subnet-mask router hops 

例如:

 route add net 10.15.0.0 255.255.0.0 10.14.48.2 1 

(要到达10.15.x.x的网络,需要将数据包送往路由器10.14.48.2,距离10.15.x.x有一个跃点。

这个命令将增加到启动文件/etc/rc2.d/S72inetsvc) 

增加动态路由(会带来安全隐患) 

在/etc/rc2.d/S72inetsvc中增加和是的命令行 

运行in.routed或in.rdisc 

诊断工具snoop能sniff,只有root能使用,能把snoop从不必的UNIX机器上删除 

10、root的umask设置错误 

修改/etc/profile文件,将umask设为077或027 

11、堆栈缓冲溢出攻击防护设置 

在/etc/system里加上如下语句,禁止缓冲溢出:

 

echo "set noexec_user_stack=1" >> /etc/system 

echo "set noexec_user_stack_log=1" >> /etc/system 

(对 Solaris 9,能对单个程式设定堆栈不可执行属性,前提是有该程式的源码,例如:

# cc -M /usr/lib/ld/map.noexstk myprogram.c) 

12、使IP forwarding和sourec routing(源路)由无效 

在Inetinit中使IP forwarding和sourec routing(源路)由无效(如果有超过一个网络接口的话)。

在/etc/init.d/inetinit中增加下面所示设置:

 

ndd -set /dev/ip ip_forward_directed_broadcasts 0 

ndd -set /dev/ip ip_forward_src_routed 0 

ndd -set /dev/ip ip_forwarding 0 

13、防止TCP序列号预测攻击(ip欺骗) 

建议在/etc/default/inetinit中增加如下的生成初始化序列号设置来防止TCP序列号预测攻击(ip欺骗):

TCP_STRONG_ISS=2 

14、(如果有ftp服务)不要使用匿名ftp 

/etc/inet/inetd.conf中的ftpd为(记录) 

ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd ?

dl 

决不能用root身份使用ftp(口令不加密) 

/etc/ftpusers中的增加终极用户(这里的账号禁止用ftp连接系统) 

FTP 服务暴露系统敏感信息 

编辑/etc/default/ftpd文件,如果文件不存在就新建一个,在文件中的加进以下一项:

BANNER=XXXX(XXXX能任意改动为所有一个版本信息),将该系统版本信息屏蔽. 

15、关闭NFS服务 

16、用SSH替代Telnet服务 

17、限制.rhosts、.netrc和/etc/hosts.equiv文件的使用 

限制.rhosts、.netrc和/etc/hosts.equiv文件的使用。

r系列命令使用这些文件来访问系统。

要为这些文件加锁,先创建他们,然后修改其属性为零即可。

这样除了root用户就没有其他用户能创建或修改他们了。

 

/usr/bin/touch /.rhosts /.netrc /etc/hosts.equiv 

/usr/bin/chmod 0 /.rhosts /.netrc /etc/hosts.equiv 

.rhosts文件能作为一个典型的后门文件使用,在某用户的目录下存在.rhosts文件的话,所有用户都能通过rlogin不必口令以该用户的身份登录到系统。

 

运行下面的命令全局查找.rhosts文件 

# find ?

name “.rhosts” ?

print 

18、使多路广播(multicasting)无效 

为了使多路广播(multicasting)无效请在/etc/init.d/inetsvc中注解掉"route add 224.0.0.0"周围的几行。

 

19、关闭系统的snmp服务 

更改 /etc/rc2.d/K07snmpdx 和/etc/rc3.d/S76snmpdx文件名 

20、X-视窗系统不安全,能使用ssh对其加密 

21、加强网络访问控制 

编辑/etc/inet.d/inetsvc,在inetd后面加上-t选项 

类似命令/usr/sbin/inetd ?

s ?

停止再运行inetd 

运行的使用使用 #/usr/sbin/inetd ?

s ?

22、网络访问控制 

原则:

去掉不必要的网络访问,在所需要的网络访问周围简历访问控制 

Solaris网络服务(/etc/inet/services)[没有被注释/* */的服务可关闭] 

#ident "@(#)services 1.27 00/11/06 SMI" /* SVr4.0 1.8 */ 

# Copyright (c) 1999-2000 by Sun Microsystems, Inc. 

# All rights reserved. 

# Network services, Internet style 

tcpmux 1/tcp /*必须*/ 

echo 7/tcp 

echo 7/udp 

discard 9/tcp sink null 

discard 9/udp sink null 

systat 11/tcp users 

daytime 13/tcp 

daytime 13/udp 

netstat 15/tcp 

chargen 19/tcp ttytst source 

chargen 19/udp ttytst source 

ftp-data 20/tcp /*依服务可选*/ 

ftp 21/tcp /*依服务可选*/ 

ssh 22/tcp /*依服务可选*/ 

telnet 23/tcp /*依服务可选*/ 

smtp 25/tcp mail /*依服务可选*/ 

time 37/tcp timserver 

time 37/udp timserver 

name 42/udp nameserver 

whois 43/tcp nicname # usually to sri-nic 

domain 53/udp /*依服务可选*/ 

domain 53/tcp /*依服务可选*/ 

bootps 67/udp # BOOTP/DHCP server 

bootpc 68/udp # BOOTP/DHCP client 

hostnames 101/tcp hostname # usually to sri-nic 

pop2 109/tcp pop-2 # Post Office Protocol - V2 

pop3 110/tcp # Post Office Protocol - Version 3 

sunrpc 111/udp rpcbind 

sunrpc 111/tcp rpcbind 

imap 143/tcp imap2 # Internet Mail Access Protocol v2 

ldap 389/tcp # Lightweight Directory Access Protocol 

ldap 389/udp # Lightweight Directory Access Protocol 

submission 587/tcp # Mail Message Submission 

submission 587/udp # see RFC 2476 

ldaps 636/tcp # LDAP protocol over TLS/SSL (was sldap) 

ldaps 636/udp # LDAP protocol over TLS/SSL (was sldap) 

# Host specific functions 

tftp 69/udp 

rje 77/tcp 

finger 79/tcp 

link 87/tcp ttylink 

supdup 95/tcp 

iso-tsap 102/tcp 

x400 103/tcp # ISO Mail 

x400-snd 104/tcp 

csnet-ns 105/tcp 

pop-2 109/tcp # Post Office 

uucp-path 117/tcp 

nntp 119/tcp usenet # Network News Transfer 

ntp 123/tcp # Network Time Protocol 

ntp 123/udp # Network Time Protocol 

netbios-ns 137/tcp # NETBIOS Name Service 

netbios-ns 137/udp # NETBIOS Name Service 

netbios-dgm 138/tcp # NETBIOS Datagram Service 

netbios-dgm 138/udp # NETBIOS Datagram Service 

netbios-ssn 139/tcp # NETBIOS Session Service 

netbios-ssn 139/udp # NETBIOS Session Service 

NeWS 144/tcp news # Window System 

slp 427/tcp slp # Service Location Protocol, V2 

slp 427/udp slp # Service Location Protocol, V2 

mobile-ip 434/udp mobile-ip # Mobile-IP 

cvc_hostd 442/tcp # Network Console 

# UNIX specific services 

# these are NOT officially assigned 

exec 512/tcp 

login 513/tcp 

shell 514/tcp cmd # no passwords used 

printer 515/tcp spooler # line printer spooler 

courier 530/tcp rpc # experimental 

uucp 540/tcp uucpd # uucp daemon 

biff 512/udp comsat 

who 513/udp whod 

syslog 514/udp /*依服务可选*/ 

talk 517/udp 

route 520/udp router routed 

ripng 521/udp 

klogin 543/tcp # Kerberos authenticated rlogin 

kshell 544/tcp cmd # Kerberos authenticated remote shell 

new-rwho 550/udp new-who # experimental 

rmonitor 560/udp rmonitord # experimental 

monitor 561/udp # experimental 

pcserver 600/tcp # ECD Integrated PC board srvr 

sun-dr 665/tcp # Remote Dynamic Reconfiguration 

kerberos-adm 749/tcp # Kerberos V5 Administration 

kerberos-adm 749/udp # Kerberos V5 Administration 

kerberos 750/udp kdc # Kerberos key server 

kerberos 750/tcp kdc # Kerberos key server 

krb5_prop 754/tcp # Kerberos V5 KDC propogation 

ufsd 1008/tcp ufsd # UFS-aware server 

ufsd 1008/udp ufsd 

cvc 1495/tcp # Network Console 

ingreslock 1524/tcp 

www-ldap-gw 1760/tcp # HTTP to LDAP gateway 

www-ldap-gw 1760/udp # HTTP to LDAP gateway 

listen 2766/tcp # System V listener port 

nfsd 2049/udp nfs # NFS server daemon (clts) 

nfsd 2049/tcp nfs # NFS server daemon (cots) 

eklogin 2105/tcp # Kerberos encrypted rlogin 

lockd 4045/udp # NFS lock daemon/manager 

lockd 4045/tcp 

dtspc 6112/tcp # CDE subprocess control /*依服务可选*/ 

fs 7100/tcp # Font server /*依服务可选*/ 

执行方法:

 

/etc/inet/services在相应服务前加“

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2