使用ptrace在用户空间编写程序管理器

发布于 2024-09-18 01:20:40 字数 175 浏览 5 评论 0原文

我将寻找建议/资源来编写一个程序,该程序可以拦截程序的系统调用以监督其文件系统、网络等访问。

这样做的目的是编写一个在线判断器,以便不受信任的代码可以安全地在服务器上运行。

这是在 Linux 上,我更喜欢编写 C++ 或脚本语言(ruby、python 等),并且一个库会很棒!

谢谢。

I'll looking for advice/resources to write a program that can intercept system calls from a programm to supervise it's filesystem, network, etc access.

The aim of this is to write an online judge, so that untrusted code can be run safely on a server.

This is on linux, and I would prefer to write C++ or a scripting langauge (ruby, python, etc), and a library would be great!

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

安静 2024-09-25 01:20:40

这看起来是一个很好的起点。
http://www.linuxjournal.com/article/6100

This looks like a good place to start.
http://www.linuxjournal.com/article/6100

千秋岁 2024-09-25 01:20:40

您无法安全地使用 ptrace() 来沙箱恶意应用程序。

应用程序始终可以使用具有故意竞争条件的多个线程来更改通过指针(例如文件名)传递的系统调用参数,在您检查它们之后但在内核查看它们之前。

You can't safely use ptrace() to sandbox a hostile application.

The application can always use multiple threads with deliberate race conditions to alter syscall arguments passed via pointers (eg. a filename) after you've inspected them but before the kernel looks at them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文