alias sudo='sudo ./badscript; sudo'
Most Linux/Mac installations are single user anyway, so you can steal the user's private information without even gaining root. alias sudo='sudo ./badscript; sudo'
Most Linux/Mac installations are single user anyway, so you can steal the user's private information without even gaining root.Otherwise you're right, despite much cargo cult, in practice pwning an user that can interactively run as root, is the same as pwning root.
If you do development for servers, though, (1) multiuser systems do exist where no or most users do not have sudo access, and (2) privilege separation accounts (such as www for httpd) generally do not run interactive shells. If you can escalate from an untrusted user on a multiuser system or from a non-interactive shell account to root, that's a problem. Dropping this alias won't help you on either of these kinds of system, which are important real world scenarios (but maybe not a scenario you need to care about personally).
It does require though that the user both is allowed to run an interactive shell with sudo, and actually does so, since you have to wait for him to run sudo in bash.
I should probably add a check for catching someone within the sudo timeout and give them a hard time if so.
alias sudo='sudo ./badscript'
where badscript runs `exec $@`.