I need some information regarding the possible attack vector on *nix platforms of running su
/sudo
.
Can an malicious process wait for the user to run su
or sudo
and then exploit that root access somehow? Or is this already protected somehow?
For example, if /dev/tty2 has impersonated root
with su
:
# inject text
echo Adding malicious text to a root tty, like Enter Password: > /dev/tty2
# read keystrokes
cat /dev/tty2
# not sure how to write keystrokes or if it is possible
Maybe this is absolutely documented, or protected, if so, please link me the docs.
PS: Please don't shut me down as if I am requesting help to do an exploit. I am not. The question is about the risks of using su
/sudo
versus logging as root
in the context of a discussion about whether should Windows have a sudo
command or not. I need to get my facts straight.