Common Network Attacks
Man-in-the-Middle (MITM)
An attacker intercepts communication between two parties who believe they’re directly connected. The attacker can eavesdrop or modify data.
Defense: TLS/HTTPS. Certificates prevent MITM — the attacker can’t forge the server’s certificate without the victim’s browser warning them.
DDoS (Distributed Denial of Service)
Overwhelming a target with traffic from many compromised devices (botnet). Goal: make the service unavailable.
Defenses:
- Rate limiting
- CDN (absorbs traffic at edge)
- Anycast routing (distributes traffic)
- Web Application Firewall (WAF)
SQL Injection
Attacker injects malicious SQL into input fields. Classic: ' OR '1'='1' -- bypasses authentication.
Defense: Parameterized queries (prepared statements). Never concatenate user input into SQL strings.
Cross-Site Scripting (XSS)
Attacker injects malicious JavaScript into a website. When other users visit, the script executes — can steal cookies, redirect to phishing sites.
Defense: Input sanitization, Content Security Policy headers, output encoding.
Phishing
Fake emails/sites trick users into revealing credentials. Defense: user education, DMARC email authentication, multi-factor authentication.
Authentication Factors
| Factor | Type | Example | Strength |
|---|---|---|---|
| Knowledge | Something you know | Password, PIN | Weak (can be stolen, guessed) |
| Possession | Something you have | Phone (OTP), hardware key | Moderate |
| Inherence | Something you are | Fingerprint, face, iris | Strong |
MFA (Multi-Factor Authentication) combines two or more factors. Even if an attacker steals your password, they still need your phone or fingerprint.
OAuth 2.0 / OpenID Connect
Delegated authorization protocols. Allow apps to access resources on your behalf without sharing your password. Used by “Login with Google/Facebook.”
Q: How does HTTPS prevent a Man-in-the-Middle attack?
A: (1) Encryption — even if the attacker intercepts packets, they can’t read them. (2) Certificates — the server must present a certificate signed by a trusted CA. If an attacker tries to intercept, their fake certificate triggers a browser warning.
Q: What is the goal of a DDoS attack?
A: Disruption of service, not data theft. By flooding a server with more traffic than it can handle, legitimate users are blocked from accessing the service. Attackers often extort money to stop the attack.
Q: Why is MFA more secure than just a password?
A: Passwords alone are vulnerable to phishing, data breaches, and guessing. MFA adds a second factor (possession or inherence) — the attacker needs both your password AND your phone/token/biometric to log in.
Q: What is the difference between authentication and authorization?
A: Authentication (AuthN) verifies identity — “who are you?” Authorization (AuthZ) determines permissions — “what can you do?” You must authenticate before you can be authorized.
Premium Content
Unlock Cyber Attacks & Authentication and all premium lessons with a subscription.
From ₹199.99/year — See plans