4 Star 35 Fork 20

云微/bpf-developer-tutorial

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.md 703 Bytes
一键复制 编辑 原始数据 按行查看 历史
云微 提交于 2年前 . fix code for 24-27

使用 eBPF 添加 sudo 用户

编译:

make

使用方式:

sudo ./sudoadd --username lowpriv-user

这个程序允许一个通常权限较低的用户使用 sudo 成为 root。

它通过拦截 sudo 读取 /etc/sudoers 文件,并将第一行覆盖为 <username> ALL=(ALL:ALL) NOPASSWD:ALL # 的方式工作。这欺骗了 sudo,使其认为用户被允许成为 root。其他程序如 catsudoedit 不受影响,所以对于这些程序来说,文件未改变,用户并没有这些权限。行尾的 # 确保行的其余部分被当作注释处理,因此不会破坏文件的逻辑。

参考资料

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yunwei37/bpf-developer-tutorial.git
git@gitee.com:yunwei37/bpf-developer-tutorial.git
yunwei37
bpf-developer-tutorial
bpf-developer-tutorial
main

搜索帮助