Unix 功能如何发挥作用?
似乎从内核 2.2 开始,他们引入了功能的概念。根据关于功能的 unix 手册页,它说如果您不是 root 用户,您可以通过在每个线程的基础上调用 cap_set_proc 来授予自己功能。那么这是否意味着,如果您正在为 UNIX 编写恶意软件,您是否会授予自己大量功能并危害系统?如果没有,如何授予运行该程序所需的能力?
看来 Unix 的安全模型是相当有缺陷的原始的。我说得对吗?
我将更具体地说:(
当以非 root 用户身份运行时)如何向在不同用户下运行的另一个进程发送信号?在信号手册页上,它说您需要 CAP_KILL 功能才能执行此操作。但是,阅读功能手册页后,我不确定如何授予进程该功能。
it seems that starting kernel 2.2, they introduced the concept of Capabilities. According to the unix man page on capabilities, it says if you're not a root user, you can grant yourself of capabilities by calling cap_set_proc per thread basis. So does this mean that if you're writing a malware for unix, do you just grant yourself bunch of capabilities and compromise the system? If not, how does one grant capabilities required to run the program?
it seems that Unix's security model is quite flawed primitive. Am I getting this right?
I'll go more specific:
How do you (when running as a non-root user) send a signal to another process that is running under different user? On signal man page, it says you need CAP_KILL capability to perform this. However, reading the capabilities man page, I'm not sure how I can grant a process that capability.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 man cap_set_proc:
相信我,如果有那么容易,我相信现在已经有人利用它了。与其他操作系统相比,Unix 的安全模型可能很简单,但这并不意味着它有“缺陷”。
From man cap_set_proc:
Trust me if it was that easy I'm sure someone would have exploited it by now. Unix's security model may be simple by comparison to other operating systems, but it doesn't mean it's "flawed".
这是不可能的。请改用套接字或文件。
it's impossible. Use Socket or File instead.