进程劫持

进程劫持:

http://blog.chinaunix.net/space.php?uid=18757596&do=blog&id=1744672

unsigned long *getscTable(){
unsigned char idtr[6],*shell,*sort;
struct _idt *idt;
unsigned long system_call,sct;
unsigned short offset_low,offset_high;
char *p;
int i;
/* get the interrupt descriptor table */
__asm__("sidt %0" : "=m" (idtr)); //中断描述符表起始地址

/* get the address of system_call */
idt=(struct _idt*)(*(unsigned long*)&idtr[2]+8*0x80); //得到int 0x80中断描述符所在位置
offset_low = idt->offset_low;
offset_high = idt->offset_high;
system_call=(offset_high<<16)|offset_low;

shell=(char *)system_call;
sort="\xff\x14\x85";

/* get the address of sys_call_table */

for(i=0;i<(100-2);i++)
if(shell[i]==sort[0]&&shell[i+1]==sort[1]&&shell[i+2]==sort[2])
break;

p=&shell[i];
p+=3;
sct=*(unsigned long*)p;

return (unsigned long*)(sct);
}

getscTable()是在内存中查找sys_call_table地址的函数。
每一个系统调用都是通过int 0x80中断进入核心,中断描述符表把中断服务程序和中断向量对应起来。对于系统调用来说,操作系统会调用system_call中断服务程序。 system_call函数在系统调用表中根据系统调用号找到并调用相应的系统调用服务例程。idtr寄存器指向中断描述符表的起始地址,用 __asm__ ("sidt %0" : "=m" (idtr));指令得到中断描述符表起始地址,从这条指令中得到的指针可以获得int 0x80中断服描述符所在位置,然后计算出system_call函数的地址。反编译一下system_call函数可以看到在system_call函 数内,是用call sys_call_table指令来调用系统调用函数的。

因此,只要找到system_call里的call sys_call_table(,eax,4)指令的机器指令就可以获得系统调用表的入口地址了。

对于截获文件系统相关的系统调用,Adore-ng rootkit提供了一种新的方法。简单的说,就是通过修改vfs文件系统的函数跳转表来截获系统调用,这种方法不用借助于系统调用表。

http://www.linuxidc.com/Linux/2011-05/36605.htm 多种方法获取sys_call_table(Linux系统调用表)的地址

http://hi.baidu.com/ylinuxs/blog/item/e22c9127d1e43227d5074222.html  Linux 2.6版内核中通过模块获取sys_call_table地址的方法

http://www.lupaworld.com/home.php?mod=space&uid=401174&do=blog&id=229116 sys_call_table地址的获取

http://blog.chinaunix.net/space.php?uid=18757596&do=blog&id=1744673 Linux操作系统下的高级隐藏技术详解 

http://blog.chinaunix.net/space.php?uid=18757596&do=blog&id=1744674  Linux下增加系统调用的方法

http://blog.csdn.net/billpig/article/details/6038330

http://bbs.chinaunix.net/thread-1957801-1-1.html[原创]关于劫持系统调用隐藏进程的一些心得

http://blog.chinaunix.net/space.php?uid=20357359&do=blog&id=1963638  rootkit on Linux x86

http://bbs.chinaunix.net/thread-1946913-1-1.html  Linux下实现劫持系统调用的总结

http://www.ibm.com/developerworks/cn/linux/l-kprobes.html kprobe的使用

http://bbs.chinaunix.net/thread-2101106-1-1.html Linux截获do_execve()

http://bbs.chinaunix.net/thread-1945280-1-1.html  LD_PRELOAD劫持系统调用

http://wenku.baidu.com/view/af0d6880e53a580216fcfe17.html LKM技术

Backdoor and Linux LKM Rootkit(中文)

后门技术和Linux LKM Rootkit

黑客大曝光:恶意软件和Rootkit安全 

/dev/kmem 修改 http://hi.baidu.com/wstone_h/blog/item/d78851fd8514ea1a09244db7.html

VFS 层修改函数跳转表来截获系统调用  http://blog.chinaunix.net/space.php?uid=20196318&do=blog&id=28808

Linux环境下的一些高级隐藏技术

看phrack相关的期刊

原文地址:https://www.cnblogs.com/moonflow/p/2299800.html