Once Upon a Breach: Cybersecurity Attacks Explained in Stories

Buffer Overflow
Think of your kitchen sink with a small bucket underneath to catch drips. That bucket is like a computer's temporary storage space. Now, imagine you're distracted while filling the bucket. You might not notice when it's full and keep the tap running. What happens next? Water overflows, spilling onto your floor and possibly ruining your cabinets.
In the world of computers, we call that bucket a "buffer." It's where data is stored briefly. A buffer overflow is exactly what it sounds like - too much information crammed into too little space. When that happens, excess data spills into other parts of the computer's memory where it shouldn't be.
Just like water damage in your kitchen, this overflow can cause all sorts of problems for your computer. It's a common issue programmers need to watch out for, kind of like keeping an eye on a filling sink.

Time-of-Check to Time-of-Use
You run a small bakery with a strict "fresh bread only" policy. You inspect the shelves every morning, ensuring yesterday's loaves are gone. Once you're satisfied, you unlock the doors and start your day.
Imagine some prankster sneaking in right after your check but before you open. They swap your fresh, crusty loaves with day-old bread. You've already done your rounds, so you miss the switch. Next thing you know, you're unknowingly selling stale bread to your regulars.
It's a lot like what computer folks call a "Time of Check to Time of Use" attack (or TOCTTOU if you want to sound fancy). Your morning shelf check is the "Time of Check." The moment you hand over bread to a customer? That's the "Time of Use." The gap between these two points is where trouble can creep in.

Race Condition
Imagine two painters working on the same wall. One is painting it blue, and the other is painting it red. They don’t talk to each other and start painting at the same time. In the end, the wall is a messy mix of red and blue because they didn’t coordinate who would paint first.
In computers, a race condition is similar. Two actions happen at the same time, both trying to change the same thing. Without proper coordination, the final result can be unpredictable or messy, just like the poorly painted wall!

SQL Injection
At a restaurant, customers use a search box on a tablet to find dishes by typing in keywords. One day, a sneaky person decides to trick the system. Instead of typing a normal dish name, they type something like: '; ORDER EVERYTHING;--.
The system runs this phrase as part of the search, but it doesn’t realise that the phrase is a command to place an order for every dish on the menu. As a result, the restaurant gets an unexpected order for all its food items.
This trick is similar to SQL injection, where clever input can cause a system to perform an unintended action, like placing an enormous order.

Cross-Site Scripting
In a school, there’s a bulletin board where students post messages and announcements. One day, one student decides to stir up trouble. Instead of a regular message, the student posts a note that says, “Check the teacher’s desk for a special surprise!”
The note is designed to lead students into a trap. When the students follow the instructions and go to the teacher’s desk, they find a hidden, fake document that asks them to enter personal information, pretending to be an important school form. The clever student collects this information to use it for their gain.
This trick is like Cross-Site Scripting (XSS), where a hidden message can mislead people into revealing private information or causing confusion, all while appearing harmless.

The Evil Twin
In a large office building, there are two meeting rooms with very similar names: "Conference Room A" and "Conference Room B." One day, someone puts up a sign for a new room named "Conference Room A+" right next to the real one.
An employee, who has a meeting scheduled in "Conference Room A," sees the new sign for "Conference Room A+" and, assuming it’s an update or a newly-renovated space, heads over there for their meeting.
Inside "Conference Room A+," the room looks almost identical to the real "Conference Room A," but it’s actually a decoy set up by someone trying to gather information. While the employee is busy discussing sensitive topics, the person behind the decoy room listens in and takes notes.
This trick is similar to an Evil Twin Attack: the decoy meeting room pretends to be the real one, just as a fake Wi-Fi network pretends to be a legitimate connection, tricking people into revealing valuable information.

Directory traversal
In a small office, there's a filing cabinet where employees can access different folders by opening the drawers and checking the labels. Each drawer has a label indicating its contents, like "Financial Reports" or "Project Files."
One day, an employee accidentally discovers that by specially sliding the drawer handles, they can reach hidden folders at the back of the cabinet that were never intended to be seen. These hidden folders contain confidential files that were supposed to be kept private.
This is like a Directory Traversal attack in computers, where someone uses a clever trick to access files or directories that are normally hidden or restricted, gaining access to information they shouldn’t have.

Denial of Service
Imagine a small café with just a few tables. One day, a group of friends decides to play a prank. They all come into the café at once, crowding every table and ordering so many drinks that there’s no room left for other customers. The café gets overwhelmed and can’t serve anyone else because it’s too crowded.
In the computer world, a Denial of Service (DoS) attack is like that prank. An attacker floods a website or service with so much traffic or requests that it becomes overwhelmed and can’t handle normal users, making it unavailable to everyone.

DNS Spoofing
Imagine a neighbourhood where mail is delivered based on the postcodes written on letters. One day, an intruder sneaks in and changes the postcode labels on some letters. Instead of being delivered to the correct houses, the mail ends up at the wrong addresses because the postcodes are now incorrect.
In the digital world, DNS Spoofing is like that intruder. It involves changing the "postcodes" or addresses that computers use to find websites, causing you to end up on a different, possibly harmful website instead of the one you intended to visit.