3 ms·
I'm sure there are plenty of tricks. I could be wrong, but I think the \ is a shell builtin thing, so I don't think creating a \sudo or the like would work. You
by seiferteric 9y ago
I'm sure there are plenty of tricks. I could be wrong, but I think the \ is a shell builtin thing, so I don't think creating a \sudo or the like would work. You could set the PATH and put a fake sudo in a secret directory in there that precedes the /usr/bin/sudo though, so that would be a problem.
- shabble 9y agountested, but I think you could possibly bypass it with a malicious .inputrc binding for <enter>, although making it conditional such that it only removed a leading \ could be tricky. In Bash there might also be a way to do something cunning with a 'trap DEBUG' hook to modify the command between submission and it actually being run. Or you could just exec into a terminal multiplexer like screen[1] to intercept & rewrite/suppress both commands and output. Edit: It's much easier than that. The function: echo () { command echo "hax" $@; } will still be called by '\echo test' (The 'command' prefix stops it becoming a forkbomb :) [1] or maybe just hijack stdin/out FDs from the shell?