且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Linux上运行可执行文件最安全的方法是什么?

更新时间:2023-10-17 14:59:34

Geordi 使用chroot和syscalls截取的组合来编译然后沙盒中的任意代码。

I am trying to run a program compiled from C code from an unknown source. I want to make sure that the program does not harm my system in anyway. Like for instance, the program might have soemthing like system("rm -rf /") in the source, which is un-detectable, unless the code is thoroughly examined.

I thought of the following 2 ways

  1. Run it inside a VM like VMWare
  2. Build a windows exe on linux and run on wine

Both are not very elegant solutions and I cannot automate them. and also, in case of 1, it can harm the VM.

Any help would be appreciated.

I want to run the program in what we can call a "sandbox".

Geordi uses a combination of chroot and interception of syscalls to compile and then sandbox arbitrary code.