Before you can defend a system you need to understand how it gets attacked. The vast majority of real-world breaches do not begin with exotic zero-day exploits; they begin with a convincing email, a poisoned download or a phone call. This lesson surveys the most common attack categories and, crucially, the defenses that stop them.
Phishing is the practice of sending fraudulent messages that appear to come from a trusted source, usually to steal credentials or deliver malware. Variants include:
A typical phishing email creates urgency ('your account will be suspended'), includes a link to a lookalike domain, and asks you to log in. The fake site harvests the password.
paypa1-security.com is not PayPal.Malware is any software written to cause harm. The main families are:
Defenses are layered: keep operating systems and dependencies patched, download software only from official sources, run reputable endpoint protection, and keep offline backups so ransomware loses its leverage.
Social engineering attacks the human, not the machine. An attacker may impersonate IT support asking for a password reset, tailgate through a secure door, or leave infected USB drives in a car park. Technology cannot fully fix this; process can. Strong organizations use verification callbacks, never share credentials over the phone, and build a culture where questioning an unusual request is praised rather than punished.
Some common attacks succeed because of small development mistakes:
Here is a simple defensive pattern, rate limiting a login route so automated guessing becomes impractical:
// Rate limiting a login endpoint (Express)
const rateLimit = require('express-rate-limit');
const loginLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 5, // 5 attempts per window per IP
message: { error: 'Too many attempts. Try again later.' },
standardHeaders: true,
});
app.post('/login', loginLimiter, handleLogin);Five attempts per quarter hour is generous for a human and hopeless for a bot trying millions of passwords.
Warning signs include unexpected password-reset emails, MFA prompts you did not trigger, unusual outbound traffic from a server, and logins from unfamiliar locations. Logging and alerting on these signals turns a silent breach into a contained incident, a topic we return to in the final lesson of this course.
Next lesson: Passwords, Hashing and Multi-Factor Authentication, where we learn how to store and verify credentials safely.