WeCodeAcademy

Common Attacks at a Glance

Knowing the main families of attack helps you recognise what a defence is for.

AttackWhat it doesMain defence
PhishingFake messages trick people into giving up passwords or clickingTraining, email filtering, multi-factor sign-in
Malware / ransomwareHarmful software that steals, spies or locks filesUpdates, antivirus, offline backups
Brute force / credential stuffingGuessing passwords or reusing leaked onesStrong unique passwords, lockouts, multi-factor
Injection (such as SQL injection)Untrusted input is run as commandsValidate input, use parameterised queries
Cross-site scripting (XSS)Attacker's script runs in another user's browserEscape output
Denial of serviceOverwhelm a service so real users cannot reach itRate limiting, capacity, traffic filtering
Man in the middleSecretly reading or changing trafficEncryption (HTTPS)
Social engineeringManipulating people rather than machinesVerification habits

Notice that many attacks target people and mistakes, not clever code. Most of this course builds the matching defences in small, runnable Python.

Examplepython
Open in editor »
Quick check

Which defence best stops SQL injection?

Your turn: write the code

Use the dictionary to print the defence for 'ransomware'.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.