how could I intercept linux sys calls?

前端 未结 9 2088
夕颜
夕颜 2020-11-28 07:31

Besides the LD_PRELOAD trick , and Linux Kernel Modules that replace a certain syscall with one provided by you , is there any possibility to intercept a syscall ( open for

相关标签:
9条回答
  • 2020-11-28 08:26

    If you just want to do it for debugging purposes look into strace, which is built in top of the ptrace(2) system call which allows you to hook up code when a system call is done. See the PTRACE_SYSCALL part of the man page.

    0 讨论(0)
  • 2020-11-28 08:31

    if you really need a solution you might be interested in the DR rootkit that accomplishes just this, http://www.immunityinc.com/downloads/linux_rootkit_source.tbz2 the article about it is here http://www.theregister.co.uk/2008/09/04/linux_rootkit_released/

    0 讨论(0)
  • 2020-11-28 08:32

    Sounds like you need auditd.

    Auditd allows global tracking of all syscalls or accesses to files, with logging. You can set keys for specific events that you are interested in.

    0 讨论(0)
提交回复
热议问题