在用户空间中以 root 身份运行此代码时出现段错误。我不明白为什么。我相信我有一个 rootkit,我想检查地址是否与 /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 by the rootkit");
}
}
cat /boot/System.map-3.2.0-4-amd64 | grep "你想要的字符串"
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