Course · $400 Free reference Certifications

Common cyber attacks & how to stop them

The attacks Security+ tests most — what each does and the primary defense — in one scannable table.

Advertisement · 728×90

Attacks and their primary defense

AttackWhat it doesPrimary defense
PhishingTricks users into revealing credentials/clicking malwareUser training, email filtering, MFA
RansomwareEncrypts data and demands paymentOffline backups, patching, EDR
Malware (virus/worm/trojan)Malicious code that infects/spreads/hidesEDR/anti-malware, least privilege
MITMIntercepts traffic between two partiesTLS, VPN, certificate validation
DDoSFloods a service to take it offlineCDN/scrubbing, rate limiting
SQL injectionInjects SQL via input to read/alter the DBParameterized queries, input validation
XSSInjects script that runs in a victim's browserOutput encoding, CSP
CSRFForces a logged-in user's browser to actAnti-CSRF tokens, SameSite cookies
Brute force / credential stuffingGuesses or replays passwords at scaleMFA, lockout, rate limiting
Social engineeringManipulates people to bypass controlsTraining, verification procedures

Why defense in depth matters

The principle

No single control stops everything — especially zero-days. Layer people (training), process (patching, least privilege) and technology (MFA, EDR, WAF, backups) so one failure isn't fatal.

Exam traps

  • Confusing XSS and CSRF. XSS runs attacker script in the browser; CSRF abuses an existing authenticated session.
  • Worm vs virus. A worm self-propagates; a virus needs a host/user action.
  • Backups as anti-ransomware. Only if they're offline/immutable and tested.

Test yourself

4 quick questions — tap an answer to check it instantly. Nothing is sent anywhere.

1. Parameterized queries primarily defend against…

Answer: B. Parameterized queries stop SQL injection by separating code from data.

2. Which malware self-propagates without user action?

Answer: B. A worm self-propagates; a virus needs a host or user action.

3. The main defense against phishing is…

Answer: B. Phishing is a human attack — training, MFA and email filtering are key.

4. CSRF is best mitigated with…

Answer: B. Anti-CSRF tokens and SameSite cookies stop forged cross-site requests.

Sources

  1. CompTIA Network+ / Security+ exam objectives.
  2. Relevant RFCs and vendor documentation.

Reference summary only. Not security advice for a specific system.