4 ms·
I use /usr/bin/sudo <>
by wrycoder 9y ago
I use
/usr/bin/sudo <>
- chrisfosterelli 9y agoSo they check .bash_history and then they realize they just need to also `alias /usr/bin/sudo`.
- wrycoder 9y agoHm. How about ‘sudo’ <> ? i.e. quote the command?
- chrisfosterelli 9y agoBased on the sibling comment to yours, I don't think bash supports this. zsh allows you to make a \'sudo\' alias though, so it depends on your shell.
- wrycoder 9y agoAt least in bash, quoting the command disables any alias. Maybe also in zsh?
- chrisfosterelli 9y agozsh seems to have much more flexible alias rules than bash: > alias \'sudo\'='ls -a' > 'sudo' . ..
- wallacoloo 9y agoIf they have access to your .bashrc they can also alter your PATH and create a script named sudo somewhere they have write access to that carries the malicious payload. So you're not gaining much by adding the quotes.
- kbp 9y ago> So they check .bash_history and then they realize they just need to also `alias /usr/bin/sudo`. $ alias /usr/bin/sudo=whatever bash: alias: `/usr/bin/sudo': invalid alias name
- chrisfosterelli 9y agoOh, fair point. Not all shells support this apparently. zsh does: -> alias /usr/bin/sudo='ls -a' -> /usr/bin/sudo . ..