A troll has captured you and is forcing you to write malware (defined as a program that damages the computer that runs it). The troll can read and understand code, but is not so good at spotting bugs.
Your goal is to write a program that:
- Looks like malware; i.e., a beginning programmer reading the code will be convinced that the code causes damage to the computer running it.
- Actually does no damage at all.
NOTE: The troll reads only the code - not the comments. So the code itself should be clear and convincing enough.
EXAMPLE (bash):
rm - rf /home
This example looks like rm -rf /home
which removes all home folders from the system, but actually, because of the space before the rf, this will not work and cause only a harmless error message.
This is an acceptable solution but it is not very good, because the bug is quite easy to detect.
On the other hand, a program that is complex and unreadable will also not be a very good solution, because it will not look like malware.
A good solution should be readable enough to convince the reader that it's malware, but contain a bug that is difficult to detect and renders it harmless.
This is a popularity contest, so the code with the most upvotes wins.
rm - rf /
into my shell... \$\endgroup\$rm -rf /
. Unless the system is very old , it will require--no-preserve-root
:) \$\endgroup\$rm - rf /
isn't a valid example! It can cause damage if you have a file calledrf
in the current directory \$\endgroup\$