[feat] exp
This commit is contained in:
34
01/README.md
34
01/README.md
@@ -1,8 +1,6 @@
|
||||
|
||||
# 论文精读1
|
||||
|
||||
---
|
||||
|
||||
**Behavior Nets: Context-Aware Behavior Modeling for Code Injection-Based Windows Malware**
|
||||
|
||||
## 问题分析
|
||||
@@ -407,8 +405,34 @@ static ssize_t process_vm_rw_core(pid_t pid, struct iov_iter *iter,
|
||||
|
||||
故而,我们已经可以得出 **process_vm_readv/writev** 同样受Yama的影响的结论了。
|
||||
|
||||
### /dev/mem
|
||||
|
||||
### 例外的情况
|
||||
|
||||
## 实验验证
|
||||
需要额外指出的是,Yama并不会阻止root进程对非root进程进行ptrace,因此下面的实验将以**攻击者已经root机器**为前提,他们下一步的目的是把自己的某个任务(可能是后门、挖矿程序)隐藏在某个正常的程序之中。
|
||||
|
||||
## 实验验证
|
||||
|
||||
### 一个靶程序
|
||||
|
||||
为了后续的实验方便,有必要编写一个有基本IO功能,但没有复杂行为的“靶程序”。
|
||||
|
||||
```cpp
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
pid_t pid = getpid();
|
||||
std::cout << "Pid: " << pid << std::endl;
|
||||
|
||||
while(true)
|
||||
{
|
||||
sleep(0);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
如代码所示,该程序运行后只是简单的展示自己的pid,然后不断地让出CPU控制权。
|
||||
这里没有用IO操作(如getline)去阻塞的原因是那会让OS不调度这个进程,进程会持续在后台休眠,而现实中的进程通常总是在做一些事。
|
||||
如果用getline去阻塞进程,那么这个靶程序可能会一直阻塞在syscall里面——而不去执行我们主动注入的代码。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user