A simple "logic bomb" written in Python that displays a festive greeting on Christmas Day.
In winter 1987, a German student created one of the earliest examples of a computer worm - a computer program designed to spread itself across systems. The program, known as "CHRISTMAS EXEC" displayed a ASCII art picture of a Christmas Tree alongside a cheerful message, and then emailed itself to all the user's contacts. Since then, many other programs have used Christmas greetings as a cover for malicious activity.
This example program uses Christmas Day (25 December) as the trigger for a logic bomb. A logic bomb is when code is added to a program to check if a certain condition is met. If the condition is true it runs another section of code which can have a destructive or damaging effect.
Thankfully, this example is completely safe - it checks to see if it's Christmas Day, and if so displays a festive greeting. Nothing is deleted, and it doesn't try copy itself to other computers.
Try running the code: Live Demo
Things to try...
- Try running the code using the live link
- Currently the bomb is triggered on Christmas Day, try changing the code so it is triggered on today's date
- Try changing the message that is displayed when the bomb is triggered
- Add in other target dates and display relevant messages on those dates (for example New Year's Day, Halloween, St Valentine's Day)
- Christmas Tree EXEC - Wikipedia
- The logic bomb: What it is and how to prevent it
- Computer worms - Wikipedia
Craig Steele [email protected]
join Craig's Digital Skills Newsletter