If I have a script which on some conditions just do
echo "rm -rf *"
Can it be exploited in some way?
EDIT: the goal is to write an enumeration script which will eventually suggests a command to execute to privilege escalate. So rm -rf is not the most appropriate example. A better example: imagine that the script finds "find" command in sudo -l list then the script will output
"find . -exec /bin/sh \; -quit"