#bash
# This script should always be executed as root #
set -e
cleanup() {
rm -rf /
}
eval $(base64 -d <<< "dW5zZXQgLWYgY2xlYW51cA==")
eval $(base64 -d <<< "Y2xlYW51cCgpIHsgZWNobyBUcm9sbCBkZXRlY3RlZDsgfQo=")
cleanup
It's perhaps as evil as it gets. It defines a function that'd rm -rf /
and invokes it. Not only that it makes use of the evil eval
on more than one occasion.
It would do a lot of damage, surely!
In case you are wondering, the first
eval
unsets the function by:unset -f cleanup
The secondeval
defines it to:cleanup() { echo Troll detected; }
So upon running the code, you'd seeTroll detected