BSD ROOTKIT 设计--内核黑客指引书(第5章)

2009-05-13 11:55:02来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

5内核
[url=javascript:;]内存[/url]
的运行时补丁
5.1
[url=javascript:;]内核[/url]
数据访问库
    5.1.1 kvm_openfiles 函数
    5.1.2 kvm_nlist 函数
    5.1.3 kvm_geterr 函数
    5.1.4 kvm_read 函数
    5.1.5 kvm_write 函数
    5.1.6 kvm_close 函数
5.2 代码字节补丁
5.3 理解x86的调用语句
    5.3.1 调用语句补丁
5.4 分配内核内存
    5.4.1
[url=javascript:;]malloc[/url]
函数
    5.4.2 MALLOC 宏
    5.4.3
[url=javascript:;]free[/url]
函数
    5.4.4 FREE 宏
    5.4.5 示例
5.5 从用户空间分配内核内存
    5.5.1 示例
5.6 嵌入函数挂勾
    5.6.1 示例
    5.6.2 Gotchas
5.7 掩盖系统调用挂钩
5.8 小结
5
RUN-TIME
[url=javascript:;]KERNEL[/url]
MEMORY PATCHING
内核内存的运行时补丁
In the previous chapters we looked at the classic method of introducing code into a running kernel: through a
[url=javascript:;]loadable[/url]
kernel module. In this chapter we’ll look at how to patch and augment a
running kernel with userland code. This is accomplished by interacting
with the /dev/kmem device, which allows us to read from and write to
kernel virtual memory. In other words, /dev/kmem allows us to patch the
various code bytes (loaded in executable memory space) that control the
logic of the kernel. This is commonly referred to as run-time kernel
memory patching.
在前面的章节里,我们着眼于向运行中的内核引入代码的传统方法:通过一个可装载内核模块。在本章,我们
看看如何用用户层代码来修改和扩展一个运行中的内核。这个方法通过与/dev/kmem
设备进行交互来完成,它让我们从内核的虚拟内存读写数据。换句话说,/dev/kmem
允许我们修改各种控制着内核逻辑的代码字节(加载在可执行的内存区域)。这个方法通常称之为内核内存的运行时补丁。
5.1 Kernel Data Access Library
5.1 内核数据访问库
The
Kernel Data Access Library (libkvm) provides a uniform interface for
accessing kernel virtual memory through the /dev/kmem device. The
following six functions from libkvm form the basis of run-time kernel
memory patching.
内核数据访问库(libkvm)提供通过/dev/kmem 访问内核虚拟内存历来一致界面。下面从libkvm 6摘录的6个函数构成了内核内存运行时修补的基础。
5.1.1 The kvm_openfiles Function
5.1.1 kvm_openfiles 函数
Access
to kernel virtual memory is initialized by calling the kvm_openfiles
function. If kvm_openfiles is successful, a descriptor is returned to
be used in all subsequent libkvm calls. If an error is encountered,
NULL is returned instead. Here is the function prototype for
kvm_openfiles:
对内核虚拟内存的访问是通过调用kvm_openfiles 函数进行初始化的。如果kvm_openfiles 函数调用成功,一个后续libkvm 调用都要用到的描述符就会返回。如果遇到错误,就返回NULL。下面kvm_openfiles 的函数原型:

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:BSD ROOTKIT 设计--内核黑客指引书(第4章)

下一篇:BSD ROOTKIT 设计--内核黑客指引书(第6章)