中南大学
操作系统安全
实验报告
学生姓名
学院信息科学与工程学院专业班级
完成时间
目录
1.实验内容 (3)
2.实验1:Windows系统安全设置实验 (3)
2.1 实验目的 (3)
2.2 实验要求 (3)
2.3 实验内容 (3)
2.4 实验结果 (4)
3.实验2 :Linux系统安全设置实验 (19)
3.1 实验目的 (19)
3.2实验要求 (19)
3.3实验内容 (19)
3.4 实验结果 (20)
4.实验3 :SELinux实验 (25)
4.1 实验目的 (25)
4.2实验要求 (25)
4.3实验内容 (25)
4.4 实验结果 (26)
5. 回答问题 (28)
操作系统安全
1.实验内容
实验1Windows系统安全设置实验
实验2Linux系统安全设置实验
实验 3 SELinux实验
2.实验1:Windows系统安全设置实验
2.1 实验目的
1、了解Windows操作系统的安全性
2、熟悉Windows操作系统的安全设置
3、熟悉MBSA的使用
2.2 实验要求
1、根据实验中的安全设置要求,详细观察并记录设置前后系统的变化,给出分析报告。
2、采用MBSA测试系统的安全性,并分析原因。
3、比较Windows系统的安全设置和Linux系统安全设置的异同。
2.3 实验内容
1、配置本地安全设置,完成以下内容:
(1)账户策略:包括密码策略(最小密码长度、密码最长存留期、密码最短存留期、强制密码历史等)和账户锁定策略(锁定阈值、锁定时间、锁定计数等)
(2)账户和口令的安全设置:检查和删除不必要的账户(User用户、Duplicate User 用户、测试用户、共享用户等)、禁用guest账户、禁止枚举帐号、创建两个管理员帐号、创建陷阱用户(用户名为Administrator、权限设置为最低)、不让系统显示上次登录的用户名。
(3)设置审核策略:审核策略更改、审核账户登录事件、审核账户管理、审核登录事件、审核特权使用等
(4)设置IP安全策略
(5)其他设置:公钥策略、软件限制策略等
2、Windows系统注册表的配置
(1)找到用户安全设置的键值、SAM设置的键值
(2)修改注册表:禁止建立空连接、禁止管理共享、关闭139端口、防范SYN攻击、减少syn-ack包的响应时间、预防DoS攻击、防止ICMP重定向报文攻击、不支持IGMP协议、禁止死网关监控技术、修改MAC地址等操作。
3、文件及文件夹权限设置
(1)用户组及用户的权限:有哪些组?其权限是什么?有哪些用户?分属哪些组?设置其权限。
(2)新建一个文件夹并设置其访问控制权限。
4、审核日志分析
(1)查找审核日志,显示其详细信息:应用程序日志、安全性日志、系统日志。
(2)分析各种日志所描述的内容,分析警告、信息、错误等的意义。
5、使用Microsoft 基准安全分析器MBSA 2.0对系统进行安全评估
Microsoft 基准安全分析器(MBSA) 可以检查操作系统,还可以扫描计算机上的不安全配置。检查Windows 服务包和修补程序时,它将Windows 组件(如Internet 信息服务(IIS) 和COM+)也包括在内。MBSA 使用一个XML 文件作为现有更新的清单。该XML 文件包含在存档Mssecure.cab 中,由MBSA 在运行扫描时下载,也可以下载到本地计算机上,或通过网络服务器使用。
2.4 实验结果
建立空连接“Local_Machine\System\CurrentControlSet\Control\ LSA-RestrictAnonymous”的值改成“1”即可。
禁止管理共享:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ LanmanServer\Parameters项
对于服务器,添加键值“AutoShareServer”,类型为“REG_DWORD”,值为“0”。
对于客户机,添加键值“AutoShareWks”,类型为“REG_DWORD”,值为“0”。
关闭139端口:在“网络和拨号连接”中“本地连接”中选取“Internet协议(TCP/IP)”属性,进入“高级TCP/IP 设置”“WINS 设置”里面有一项“禁用TCP/IP的NETBIOS”,打勾就关闭了139端口。
防范SYN攻击:相关的值项HKLM\SYSTEM\CurrentControlSet\Service \Tcpip\Parameters 下。
(1)DWORD:SynAttackProtect:定义了是否允许SYN淹没攻击保护,值1表示允许起用Windows的SYN淹没攻击保护。
(2) DWORD:TcpMaxConnectResponseRetransmissions:定义了对于连接请求回应包的重发次数。值为1,则SYN淹没攻击不会有效果,但是这样会造成连接请求失败几率的增高。SYN淹没攻击保护只有在该值>=2时才会被启用,默认值为3。
减少syn-ac包的响应时间:HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ TcpMaxConnectResponseRetransmissions定义了重发SYN-ACK包的次数。增大NETBT的连接块增加幅度和最大数器,NETBT使用139端口。HKLM\SYSTEM\CurrentControlSet\ Services\NetBt\Parameters\BacklogIncrement默认值为3,最大20,最小1。HKLM\SYSTEM\ CurrentControlSet\Services\NetBt\Parameters\MaxConnBackLog默认值为1000,最大可取40000
预防DoS攻击:在注册表HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Pa rameters 中更改以下值可以防御一定强度的DoS攻击
SynAttackProtect REG_DWORD 2
EnablePMTUDiscovery REG_DWORD 0
NoNameReleaseOnDemand REG_DWORD 1
EnableDeadGWDetect REG_DWORD 0
KeepAliveTime REG_DWORD 300,000
PerformRouterDiscovery REG_DWORD 0
EnableICMPRedirects REG_DWORD 0
防止ICMP重定向报文的攻击:HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ Parameters\EnableICMPRedirects REG_DWORD 0x0(默认值为0x1)该参数控制Windows 是否会改变其路由表以响应网络设备(如路由器)发送给它的ICMP重定向消息,有时会被利用来干坏事。Windows中默认值为1,表示响应ICMP重定向报文。
禁止响应ICMP路由通告报文HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ Parameters\Interfaces\PerformRouterDiscovery REG_DWORD 0x0(默认值为0x2)。“ICMP路由公告”功能可造成他人计算机的网络连接异常,数据被窃听,计算机被用于流量攻击等严重后果。此问题曾导致校园网某些局域网大面积,长时间的网络异常。建议关闭响应ICMP 路由通告报文。Windows中默认值为2,表示当DHCP发送路由器发现选项时启用。
不支持IGMP协议HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ IGMPLevel REG_DWORD 0x0(默认值为0x2) Win9x下有个bug,就是用可以用IGMP使别人蓝屏,修改注册表可以修正这个bug。Windows虽然没这个bug了,但IGMP并不是必要的,因此照样可以去掉。改成0后用route print将看不到224.0.0.0项了。
禁止死网关监测技术HKLM\SYSTEM\CurrentControlSet\Services:\Tcpip\ ParametersEnableDeadGWDetectREG_DWORD 0x0(默认值为ox1)。如果你设置了多个网关,那么你的机器在处理多个连接有困难时,就会自动改用备份网关,有时候这并不是一项好主意,建议禁止死网关监测。
修改MAC地址:HKLM\SYSTEM\CurrentControlSet\Control\Class\找到右窗口的说明为“网卡“的目录,比如说是{4D36E972-E325-11CE-BFC1-08002BE10318}展开之,在其下0000,0001,0002...的分支中找到”DriverDesc“的键值为你网卡的说明,比如说”DriverDesc “的值为”Intel(R) 82559 Fast Ethernet LAN on Motherboard“然后在右窗口新建一字符串值,名字为”Networkaddress“,内容为你想要的MAC值,比如说是”004040404040“然后重起计算机,ipconfig /all查看。
Version:1.0 StartHTML:0000000100 EndHTML:0000036876 StartFragment:0000000100 EndFragment:0000036328
Security assessment:
Incomplete Scan (Could not
complete one or more requested
checks.)
Computer name:WORKGROUP\A-PC
IP address:10.96.61.140
Security report
name:
WORKGROUP - A-PC (2015-10-23 9-33) Scan date:2015/10/23 9:33
Catalog
synchronization
Security updates scan not performed
date:
Security Updates
Score Issue
Result
Security
Updates
Cannot load security CAB file.
Windows Scan Results
Administrative Vulnerabilities
Score
Issue Result
File System Not all hard drives are using the NTFS file system. Drive Letter File System D:
HFS C: NTFS
Password
Expiration All user accounts (4) have non-expiring passwords.
User
Administrator Guest
HomeGroupUser$
a
Automatic
Updates The Automatic Updates feature is disabled on this computer.
Incomplete Updates A previous software update installation was not completed.
You must restart your computer to finish the installation.
If the incomplete installation was a security update, then
the computer may be at risk until the computer is restarted.
Windows
Firewall Windows Firewall is enabled and has exceptions configured. Windows Firewall is enabled on all network connections.
Connection Name Firewall Exceptions
All Connections On Ports,
Programs,
Services
Bluetooth 网络连接On Ports*,
Programs*,
Services*
无线网络连接On Ports*,
Programs*,
Services*
无线网络连接 2On Ports*,
Programs*,
Services*
Local
Account
Password
Test
Some user accounts (2 of 4) have blank or simple passwords,
or could not be analyzed.
User
Weak
Password
Locked
Out
Disabled
Administra
tor
Weak-Disabled
Guest Weak-Disabled
HomeGroupU
ser$
--Disabled
a---
Guest
Account
The Guest account is disabled on this computer. Autologon Autologon is not configured on this computer.
Restrict
Anonymous
Computer is properly restricting anonymous access.
Administrat
ors
No more than 2 Administrators were found on this computer.
User
Administrator
a
Additional System Information
Score Issue
Result
Windows
Version
Computer is running Microsoft Windows 7. Auditing Neither Logon Success nor Logon Failure auditing are
enabled. Enable auditing and turn on auditing for
specific events such as logon and logoff. Be sure to
monitor your event log to watch for unauthorized
access.
Shares No shares are present on your computer.
Services
No potentially unnecessary services were found. Internet Information Services (IIS) Scan Results
Score Issue
Result
IIS Status IIS is not running on this computer.
SQL Server Scan Results: Instance (default)
Administrative Vulnerabilities
Score Issue
Result
SQL
Server/MSDE Security Mode
SQL Server and/or MSDE authentication mode is set to SQL Server and/or MSDE and Windows (Mixed Mode).
CmdExec role CmdExec is restricted to sysadmin only. Registry Permissions The Everyone group does not have more than Read access
to the SQL Server and/or MSDE registry keys.
Folder
(default) Internal error. -
Service
Accounts SQL Server, SQL Server Agent, MSDE and/or MSDE Agent service accounts are not members of the local
Administrators group and do not run as LocalSystem.
Sysadmin role members
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。 Guest Account [DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或拒绝访问。
Sysadmins [DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Password Policy
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。 SSIS Roles [DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysdtslog
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
SQL Server Scan Results: Instance (default) (32-bit)
Administrative Vulnerabilities
Score Issue
Result SQL
Server/MSDE Security Mode
SQL Server and/or MSDE authentication mode is set to
SQL Server and/or MSDE and Windows (Mixed Mode).
CmdExec role CmdExec is restricted to sysadmin only. Registry Permissions The Everyone group does not have more than Read access
to the SQL Server and/or MSDE registry keys.
Folder
(default)
(32-bit)
Internal
error.
-
Service
Accounts
SQL Server, SQL Server Agent, MSDE and/or MSDE Agent
service accounts are not members of the local
Administrators group and do not run as LocalSystem.
Sysadmin role
members
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Guest Account
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysadmins
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Password
Policy
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
SSIS Roles
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysdtslog
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
SQL Server Scan Results: Instance MSRS12.MSSQLSERVER (32-bit)
Administrative Vulnerabilities
Score Issue Result
SQL
Server/MSDE
Security Mode
SQL Server and/or MSDE authentication mode is set to
SQL Server and/or MSDE and Windows (Mixed Mode).
CmdExec role CmdExec is restricted to sysadmin only.
Registry
Permissions
The Everyone group does not have more than Read access
to the SQL Server and/or MSDE registry keys.
Folder
Permissions
Instance Folder User
MSRS12.MSSQLSERVER
(32-bit)
Internal
error.
-
Service
Accounts
SQL Server, SQL Server Agent, MSDE and/or MSDE Agent
service accounts are not members of the local
Administrators group and do not run as LocalSystem.
Sysadmin role
members
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Guest Account
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysadmins
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Password
Policy
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
SSIS Roles
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysdtslog
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
SQL Server Scan Results: Instance MSSQL12.MSSQLSERVER (32-bit)
Administrative Vulnerabilities
Score Issue Result
CmdExec role
Error reading registry. If you are scanning a remote
computer the Remote Registry service on that computer
should be enabled. (13)
SQL
Server/MSDE
Security Mode
SQL Server and/or MSDE authentication mode is set to
Windows Only.
Registry
Permissions
The Everyone group does not have
more than Read access
to the SQL Server and/or MSDE registry keys.
Folder
Permissions
Permissions on the SQL Server and/or MSDE installation
folders are set properly.
Service
Accounts
SQL Server, SQL Server Agent, MSDE and/or MSDE Agent
service accounts are not members of the local
Administrators group and do not run as LocalSystem.
Sysadmin role
members
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Guest Account
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysadmins
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Password
Policy
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
SSIS Roles
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Sysdtslog
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server
不存在或拒绝访问。
Desktop Application Scan Results
Administrative Vulnerabilities
Score Issue Result
IE Zones
Internet Explorer zones have secure settings for all
users.
Macro
Security
No supported Microsoft Office products are installed.
3.实验2 :Linux系统安全设置实验
3.1 实验目的
1、了解Linux操作系统的安全性
2、熟悉Linux操作系统的安全设置
3、建立Linux操作系统的基本安全框架
3.2实验要求
1、根据实验中的安全设置要求,详细观察并记录设置前后系统的变化,给出分析报告。
2、使用RPM对系统的软件进行管理,验证系统内软件的完整性,并分析结果。
3、比较Windows系统的安全设置和Linux系统安全设置的异同。
3.3实验内容
1、账户和口令安全
(1)查看和添加账户
在终端下输入命令:useradd ***,建立一个新账户;
cat /etc/shadaw, 查看系统中的账户列表;
(2)添加和更改密码:passwd命令
(3)查看Linux系统中是否有用于检测密码安全的黑客技术语字典及密码检测模块:locate pam_cracklib.so dict|grep crack
2、账户安全设置
(1)强制用户首次登陆时修改口令,强制每90天更改一次口令,并提前10天提示:change命令
(2)账户的禁用与恢复:passwd命令,锁定除root之外的不必要的超级用户
(3)建立用户组,设置用户:groupadd命令、groupmod命令、gpasswd命令
(4)设置密码规则:/etc/login.defs文件编辑修改,设置用户的密码最长使用天数、最小密码长度等
(5)为账户和组相关系统文件加上不可更改属性,防止非授权用户获取权限:chattr 命令、
(6)删除用户和用户组:userdel命令、groupdel命令
(7)限制su命令提权:/etc/pam.d/su文件,在头部添加命令:
auth required /lib/security/pam_wheel.so group=wheel
这样,只有wheel组的用户可以su到root用户
(8)将用户加入到某个组:usermod命令
(9)确认shadow中的空口令帐号:awk命令
3、文件系统管理安全
(1)查看某个文件的权限:ls -l
(2)设置文件属主及属组等的权限:chmod命令
(3)切换用户,检查用户对文件的权限:su命令
(4)修改文件的属主和属组:chown命令
(5)文件的打包备份和压缩、和解压:tar命令、gzip命令、gunzip命令(6)设置应用于目录的SGID权限位:
3.4 实验结果