ar rootkit简单分析

1.

adore实现文件隐藏

getdents64()系统调用

修改VFS来达到隐藏目的

getdents64——>sys_getdents64——>vfs_readdir——>file->f_op->readdir
open——>sys_open——>filp_open——>dentry_open——>f->f_op=fops_get(inode->i_fop)

最后是把inode中的file_operations函数集赋值给file中的file_operations函数集

open当前目录文件,返回一个文件句柄,改句柄对应到内核中就是一个file对象,而该file对象的file_operations函数集从当前目录的inode的file_operations函数集取得,
就是ext2_file_operations.

adore中通过客户端lchown设置文件UID和GID为一个特定值,然后在驱动中判断UID和GID是否为特定值,如果是则返回0,表示没有读到该目录项,达到隐藏目的


2.

adore实现进程隐藏
通过/proc虚拟文件系统来获得运行进程相关的所有信息。
如果能拦截对proc虚拟文件系统的读取访问,做一些过滤工作就能够隐藏某些进程。

ULK以及一些介绍LKM中如何实现几个函数来在/proc目录下虚拟出文件夹

open——>sys_open——>filp_open——>open_namei——>path_lookup——>path_walk——>link_path_walk——>real_lookup——>dir->i_op->lookup

对需要隐藏进程作标记

ps -aux | ls /proc ——>adore_proc_readdir——>adore_proc_filldir()——>should_be_hidden()——>in_invisible()

<<基于Linux 2.6的进程隐藏机制的实现>>


3.

adore隐藏端口
netstat——>/proc/net/tcp——>pde->get_info
通过读取/proc/net/tcp中的内容,就是通过cat /proc/net/tcp看到的

4.

adore module隐藏
lsmod通过搜索链表来找到模块的,所以通过__this_module.next=__this_module.next->next把模块从内核的整个模块链表中断开。

5.

adore 获取root权限
open()打开一个特定的特定的文件——>strncmp(d->d_iname,"fullprivs",9)==0——>把uid与gid都设置成root

分析检查rootkit黑客软件的工具chkrootkit-0.48

6.

adore链接:

http://bbs.chinaunix.net/thread-1955252-1-1.html   adore rootkit详细剖析

http://blog.csdn.net/dog250/article/details/5303685 两个linux内核rootkit--导语
http://blog.csdn.net/dog250/article/details/5303687 两个linux内核rootkit--之一:enyelkm
http://blog.csdn.net/dog250/article/details/5303688 两个linux内核rootkit--之二:adore-ng
http://wenku.baidu.com/view/e19c4fd7195f312b3169a587.html 基于Linux2.6的进程隐藏机制的实现

http://www.chinaitpower.com/A/2003-01-23/47865.html

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