3

On Linux I'm trying to determine which system calls were hooked (syscall hooking) and which ones were not. I need answers to the following questions:

  1. How can I read the address of a hooked system call from userspace (with root access)?

  2. How can I obtain the address of the original system call?

Thank you.

4

1 に答える 1

0

システム コール テーブルは sys_call_table[] に格納されます。以下は、Linux kenrel、entry.S でシステム コールを入力するためのアセンブリ コードです。

sysenter_do_call:
425         cmpl $(NR_syscalls), %eax
426         jae syscall_badsys
427         call *sys_call_table(,%eax,4)
428         movl %eax,PT_EAX(%esp)
429         LOCKDEP_SYS_EXIT
430         DISABLE_INTERRUPTS(CLBR_ANY)
431         TRACE_IRQS_OFF
432         movl TI_flags(%ebp), %ecx
433         testl $_TIF_ALLWORK_MASK, %ecx
434         jne sysexit_audit

sys_call_table はカーネル空間にあるため、ユーザーランド プログラムはこのシンボルにアクセスできません。カーネル モジュールを作成する必要があります。その中で、sys_call_table[] ベクトル配列に格納されているアドレスを出力できます。

于 2012-10-22T17:02:52.340 に答える