Skip to content

Instantly share code, notes, and snippets.

@michaelhood
Created October 15, 2012 12:21
Show Gist options
  • Save michaelhood/3892179 to your computer and use it in GitHub Desktop.
Save michaelhood/3892179 to your computer and use it in GitHub Desktop.
dtruss "drop" privileges
mh@mbp:~% sudo dtruss -f sudo -u\#$UID whoami 2>/dev/null
mh
mh@mbp:~% sudo dtruss -f -t fakesyscall sudo -u\#$UID touch /
PID/THRD SYSCALL(args) = return
28082/0xad253: fork() = 0 0
touch: setting times of ‘/’: Permission denied
mh@mbp:~% # note that i only used these methods to hide output
mh@mbp:~% # to keep the demo short. dtruss is functional.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment