-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
450 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 版本。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 版本。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` 。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
## 编译 | ||
|
||
``` | ||
make build | ||
``` | ||
|
||
## 运行 | ||
|
||
``` | ||
make run | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
## 编译 | ||
|
||
``` | ||
make build | ||
``` | ||
|
||
## 运行 | ||
|
||
``` | ||
make run | ||
``` | ||
|
||
|
||
在另一个终端中进入 ../memfd-create/ 目录下,按照 README 执行程序。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
## 编译 | ||
|
||
``` | ||
make | ||
``` | ||
|
||
## 运行 | ||
|
||
``` | ||
./memfd-create `which cat` README.md | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 & | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
此时不再需要输入密码。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
## 编译 | ||
|
||
``` | ||
make build | ||
``` | ||
|
||
## 运行 | ||
|
||
``` | ||
make run | ||
``` | ||
|
||
|
||
在另一个终端中执行一个 ebpf 程序,比如执行 ../add-sudo 目录下的程序。 | ||
|
||
|
||
在另一个终端中执行一个 ``make cat`` 查看输出。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
## 编译 | ||
|
||
``` | ||
make build | ||
``` | ||
|
||
## 运行 | ||
|
||
``` | ||
make run | ||
``` | ||
|
||
|
||
在另一个终端中执行一些命令。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
## 编译 | ||
|
||
``` | ||
make build | ||
``` | ||
|
||
## 运行 | ||
|
||
``` | ||
make run | ||
``` | ||
|
||
|
||
在另一个终端中执行一些命令。 | ||
|
Oops, something went wrong.