linux - Getting the address of a function in C? -
i'm getting segfault when running code root in userspace. don't understand why. believe have rootkit , want check if addresses same ones in /boot/system.map-3.2.0-4-amd64
unsigned long hex; unsigned long **sys_call_table; for(hex = 0xffffffff810f8989; hex < 0xffffffff8160e370; hex += sizeof(void *)) { sys_call_table = (unsigned long **)hex; if(sys_call_table[3] == (unsigned long *)0xffffffff810f8989) { puts("sys_close's address has not been replaced rootkit"); } }
cat /boot/system.map-3.2.0-4-amd64 | grep "string want"
ffffffff81401200 r sys_call_table ffffffff810f9f9e t sys_read // sys_call_table[0] ffffffff810fa009 t sys_write // sys_call_table[1] ffffffff810f950d t sys_open // sys_call_table[2] ffffffff810f8989 t sys_close // sys_call_table[3] ffffffff8160e370 d loops_per_jiffy
running root
not enough - problem run in user space
- run in kernel space
, kernel module, example. although having root
privileges enough invoking system calls cannot access table - in user space
can access allocated memory you.
Comments
Post a Comment