Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种使用 seccomp 或 seccomp-bpf 执行 Hooking 的方法。
我想设置一个规则,以便在执行系统调用(例如读取)时,我可以更改从系统调用返回的进程或答案。我必须使用 seccomp。
肿瘤坏死因子
我认为您想要的是修改struct seccomp_data,但是,这是一个只读结构。
struct seccomp_data
要绕过此限制,您可以将 BPF 与 结合使用ptrace,使用 BPF 过滤系统调用并使用ptrace.
ptrace