Re:Rm -rf remains
by jacobgreenleaf on Saturday June 14, 2014 @10:22PM
(#7894180)
Alternatively, I think it might be possible if you can cause arbitrary interrupts to the operating system and control some registers and perhaps the stack as well. Depending on the shell, you might be able to do this; you certainly don't need the standard command-line tools for chmod and cat, because those are just small programs that pass through to actual system calls:
http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls....
- being able to create a file containing arbitrary data
- being able to make a file executable
- being able to execute a file
Would the same be possible if your shell was not bash but one with fewer features, like e.g. POSIX sh? That doesn't even require echo to be a builtin (it only has the 3rd function above), so it might be a dead end, but maybe there's some other way...