哈工大 计算机系统安全 第三章作业答案

1、 运行二进制文件和脚本文件时,如何设置权限?
二进制文件,需要执行权限。
脚本文件,需要读和执行权限

2、 目录的执行位有何用途?
目录的执行位,能够遍历文件的索引节点,找到相应的文件
有目录的执行位,才能操作相应的文件或目录

3、 读/home/abc/aaa.txt文件所需权限?删除/home/abc/aaa.txt需要什么权限?
读/home/abc/aaa.txt文件

删除/home/abc:
目录  /   /home  /abc  具有读和执行权限

目录 abc 具有写权限

4、 用fork创建进程,和用exec执行文件的进程,其euid,suid,ruid分别有何差别?
Fork创建的进程,子进程和父进程的euid,suid,ruid相同
exec执行设置setuid位的程序,euid为root,ruid是登录用户id,suid为0或登录用户id

5、 函数setuid含义在不同操作系统版本以及不同情况下结果不同,请问如何避免歧义?
Setuid函数中不同操作系统,不同版本下含义不同。
使用seteuid,setreuid,setresuid函数,含义清晰。

也可以使用封装函数drop_priv_temp,drop_priv_perm,restore_priv等。或者自己封装函数。
不使用setuid函数,这个函数是有歧义的,使用后euid与设想的不同,造成程序以高权限运行。

6、 文件、目录的权限设置
读文件,需要文件的读权限,层层目录的读和执行权限。
运行可执行文件,需要文件的执行权限,层层目录的读和执行权限。
脚本文件,运行时需要读和执行权限。

硬连接,删除时,需要找到文件的inode指针,对inode指针里的链接数进行修改,当硬连接数大于1的时候不能删除该文件。硬连接数为1的时候删除该文件。

  1. write the file /d1/d2/f3
    x on / and /d1 and /d2, w on f3
  2. delete the file /d1/d2/f3
    x and w on /d1/d2, x on / and /d1
  3. execute the file /d1/d2/f3, which is a binary file
    x on f3 and / and /d1 and /d1/d2,
  4. execute the file /d1/d2/f3, which is a shell script
    r and x on f3, x on / and /d1 and /d2
  5. list the file names under the directory /d1/d2s
    x on / and /d1 , r on /d2s
  6. delete the directory /d1/d2, where the directory is empty
    x on / and /d1, w on /d1
  7. delete the directory /d1/d2, where /d1/d2 contains one file /d1/d2/f3
    x on / and /d1, w on /d1, w and x on /d2
  8. delete the directory /d1/d2, where /d1/d2 contains a subdirectory /d1/d2/d3, which contains one file /d1/d2/d3/f4
    x on / , w and x on /d1, w and x on /d1/d2, w and x on /d1/d2/d3
  9. create the directory /d1/d2/d3, when /d1/d2 exists, and /d1/d2/d3 does not
    x on / and /d1, x and w and r on /d1/d2
  10. rename a file from /d1/d2/f3 to /d1/d2/f4
    改文件名,需要文件夹的w权限
    x on / and /d1, w and x on /d2
  11. create a hard link /d1/d2/f3, which points to /d4/f5
    /d2文件夹有写权限, f5文件有写权限
    x on / and /d1 , x and w on /d2,
    r and x on /d4, w on f5
  12. remove /d1/d2/f3, which is a hard link pointing to /d4/f5
    回答:/d2有wx权限,f5有w权限
    x on / and /d1 , w and x on /d1/d2 , 对目录d2要有写和执行权限
    r and x on /d4,w on f5对文件有写权限才能修改连接数
  13. create a symbolic link /d1/d2/f3, which points to the directory /d4
    Symbolic link 符号链接
    回答:目录d2有wx权限,f3有rx权限
    x on / and /d1 and /d2, w on /d2, r x on f3
    14 read the file /d1/d2/f3/f5, where /d1/d2/f3 is a symbolic link pointing to the directory /d4, and /d4 contains a file /d4/f5。读文件/d1/d2/f3/f5,/d1/d2/f3是符号链接执向目录/d4,/d4目录下包含文件d5
    回答:符号链接文件f3有rx权限,/d4有x权限,f5有r权限
    x on / and /d1 and /d2
    rx on f3 , rx on /d4 , r on f5
    15 delete the file /d1/d2/f3/f5, in the same setting as above
    回答:
    x on / and /d1 and /d1/d2 and /d4 , w on f3 and /d4
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
一、题目 4 二、摘要 4 三、关键字 4 四、引言 4 五、正文 4 5.1Windows操作系统安全定义 4 5.1.1身份认证(authentication) 5 5.1.2访问控制(authorisation) 6 5.1.3数据保密性(privacy) 7 5.1.4数据完整性(date integrity) 9 5.1.5不可否认性(non-repudiation) 9 5.2Windows金字塔安全架构 9 5.3Windows系统的安全组件 9 5.3.1访问控制的判断(Discretion access control) 10 5.3.2对象重用(Object reuse) 10 5.3.3强制登陆(Mandatory log on) 10 5.3.4审核(Auditing) 10 5.3.5对象的访问控制(Control of access to object) 11 5.4Windows安全子系统的组件 11 5.4.1安全标识符(Security Identifiers) 12 5.4.2访问令牌(Access tokens) 12 5.4.3安全描述符(Security descriptors) 13 5.4.4访问控制列表(Access control lists) 13 5.4.5访问控制项(Access control entries) 13 5.5Windows安全子系统 13 5.6Windows安全子系统流程过程 13 5.6.1 Winlogon and Gina 14 5.6.2本地安全认证(Local Security Authority) 14 5.6.3安全支持提供者的接口(Security Support Provide Interface) 15 5.6.4认证包(Authentication Package) 15 5.6.5安全支持提供者(Security Support Provider) 16 5.6.6网络登陆(Netlogon) 16 5.6.7安全账号管理者(Security Account Manager) 16 5.7Linux安全机制概述 16 5.7.1PAM机制 16 5.7.2入侵检测系统 17 5.7.3加密文件系统 17 5.7.4安全审计 17 5.7.5强制访问控制 18 5.7.6防火墙 18 5.8WindowsXP下的一些常用安全设置 19 5.8.1WindowsXP系统安全补丁升级 19 5.8.2WindowsXP管理防火墙的例外程序 20 5.8.3WindowsXP端口安全设置 20 5.8.4WindowsXP下Internet安全设置 22 六、结论 22 七、参考文献 23
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值