mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-03 10:14:44 +08:00
add English doc (#55)
* add english documents * docs: add root english README
This commit is contained in:
21
src/26-sudo/README_en.md
Normal file
21
src/26-sudo/README_en.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Using eBPF to add sudo user
|
||||
|
||||
Compilation:
|
||||
|
||||
```bash
|
||||
make
|
||||
```
|
||||
|
||||
Usage:
|
||||
|
||||
```sh
|
||||
sudo ./sudoadd --username lowpriv-user
|
||||
```
|
||||
|
||||
This program allows a user with lower privileges to become root using `sudo`.
|
||||
|
||||
It works by intercepting `sudo` reading the `/etc/sudoers` file and overwriting the first line with `<username> ALL=(ALL:ALL) NOPASSWD:ALL #`. This tricks `sudo` into thinking that the user is allowed to become root. Other programs like `cat` or `sudoedit` are not affected, so the file remains unchanged and the user does not have these permissions. The `#` at the end of the line ensures that the rest of the line is treated as a comment, so it does not break the logic of the file.
|
||||
|
||||
## References
|
||||
|
||||
- [https://github.com/pathtofile/bad-bpf](https://github.com/pathtofile/bad-bpf)
|
||||
Reference in New Issue
Block a user