by Eelongate · 4y ago · 0 comments
This seems like sound logic to me. If you have write permission to their bashrc, it's trivial to change their path to include a keylogging wrapper for sudo. The next time they use sudo, you have their password. If an attacker has gotten that far, a password on sudo seems like closing the barn doors after the horses already ran off.
1. Audit writes to paths like bashrc (I've written this alert and many others like it)
2. Audit writes from processes under uid X to files in uid Y's home
3. Limit the need to sudo in the first place
4. Add a TOTP auth to sudo
5. Limit the ability for arbitrary processes to write to arbitrary files (containerize your shells, services, etc).
The thing is that all of the above assume the attacker isn't already root. If the attacker is root, this all becomes a lot harder.
You're describing an attack where you configure my terminal to use a wrapper script? What exactly does that entail?