csdn不能直接复制粘贴图片真的很麻烦啊啊啊啊。。。所以下面的没有图片。。
具体的操作流程可以看http://www.cnblogs.com/20125127bxx/p/4472261.html这个博客。
Set-UID Program Vulnerability
个人收获:通过本次实验,对set-uid的理解更加深入了,set-uid提供给了普通用户一个临时使用root功能的途径。对有些功能,例如更改密码来说,这样的功能是很方便并且有必要的。但是如果滥用这个功能,就会使系统失去保护。
在实验中需要注意的是,在2.4中更改了PATH之后,需要把PATH路径改回默认的路径:export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
以下是本次实验的过程。
2.1 Figure out why "passwd", "chsh", "su", and"sudo" commands need to be Set-UID programs. What will happen if theyare not? If you are not familiar with these programs, you should first learnwhat they can do by reading their manuals. Please copy these commands to yourown directory; the copies will not be Set-UID programs. Run the copiedprograms, and observe what happens。
分析:可以看到,copy到tmp的passwd没有get-uid的权限。同理,复制的chsh,sh,sudo文件也没有get-uid的权限。
2.2 Run Set-UID shell programs in Linux, and describe and explain yourobservations.
(a) Login as root, copy /bin/zsh to/tmp, and make it a set-root-uid program with permission