HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Cyber Security: Threats and Defences
  1. 1Attacks on systems: brute force, interception, DDoS and hacking
  2. 2Malware and attacks that trick people
  3. 3Keeping data safe: solutions to security threats
  1. Computer Science
  2. /Cyber Security: Threats and Defences
  3. /Malware and attacks that trick people

Course 5.3·Lesson 2 of 3

Malware and attacks that trick people

Some threats are programs that do harm once they are on a device. Others are not programs at all: they trick a person into giving something away. This lesson covers the six kinds of malware and three ways of tricking people.

about 25 min1 simulation1 practice question
Lesson 2 of 3Show all lessonsHide
Cyber Security: Threats and Defences
  1. 1Attacks on systems: brute force, interception, DDoS and hacking
  2. 2Malware and attacks that trick people
  3. 3Keeping data safe: solutions to security threats

Try the code and the simulations beside the lesson.

Malware

Malware is short for malicious software: software written to do harm. Each kind works in its own way, and an exam often describes one and asks you to name it. Learn the clue that sets each one apart.

  • Virus. A program that copies itself into other files or programs. It needs a host file, and it runs only when a user runs that file, for example by opening an attachment. It then spreads when the infected files are shared. A virus can delete or damage data, or make a computer crash. Clue: needs a host file and a user action.
  • Worm. A program that copies itself and spreads across a network on its own. It does not need a host file or a user to run it. Worms use up network bandwidth and slow networks down. Clue: spreads by itself across networks.
  • Trojan horse. Malware disguised as useful, real software, such as a free game. The user installs it, believing it is safe. Once it is in, it does harm: often it lets other malware in, or gives the attacker access to the computer. A Trojan horse does not copy itself. Clue: pretends to be something it is not.
  • Spyware. Software that secretly records what a user does, such as the keys pressed, and sends the data to a third party. The aim is to steal passwords and bank details. Clue: watches and reports.
  • Adware. Software that shows unwanted adverts, such as pop-ups, and may send the browser to advertising websites. It is often more annoying than dangerous, but it can slow a computer down. Clue: adverts.
  • Ransomware. Software that encrypts the user's files so they cannot be opened, and then demands payment for the key to decrypt them. Clue: pay to get your files back.
Six cards in two rows, one for each kind of malware, each with its clue. Virus: needs a host file and a user to run it. Worm: spreads across a network by itself. Trojan horse: disguised as real software. Spyware: records what you do and reports it. Adware: shows unwanted adverts. Ransomware: encrypts files and demands payment.

How fast a worm can spread

A virus waits for a user. A worm does not. If each infected computer infects rrr more every hour, the number infected after ttt hours is (1+r)t(1 + r)^{t}(1+r)t. With r=2r = 2r=2, one computer becomes 333, then 999, then 272727. After 666 hours it is 729729729.

Attacks that trick people

These three threats attack the user, not the computer.

  • Phishing. The attacker sends an email or a message that looks as if it comes from a trusted organisation, such as a bank or a school. It asks the user to click a link and enter personal details on a fake website. The aim: to steal login details, bank details or other personal data.
  • Pharming. Malicious code is installed on the user's computer, or on a domain name server. It redirects the user to a fake website, even when the user types the correct URL. The fake site looks like the real one. The aim: the same, to collect personal details. The difference from phishing: in pharming the user does nothing wrong, and no message or link is needed.
  • Social engineering. The attacker manipulates people into giving away confidential information or breaking security rules. For example, a caller pretends to be from the IT department and asks for a password. Another attacker leaves a memory stick labelled "Exam results" where staff will find it and plug it in. These tricks play on trust, fear, curiosity or a feeling of hurry. The aim: to get information or access that the attacker could not get directly.

Practise with new numbers

Try it in Python

The program models a worm on a network of 500050005000 computers. Each hour, every infected computer infects two more, until the whole network is infected. Compare the numbers with the simulation.

Read it first. Then run it. In which hour is the whole network infected?

1. Change per_hour = 2 to per_hour = 1. How many hours does it take now?

2. Make the network ten times bigger. How many extra hours does the worm need?

Common mistakes

  • Mixing up a virus and a worm. A virus needs a host file and a user to run it. A worm spreads by itself.
  • Saying a Trojan horse copies itself. It does not. It gets in because the user installs it.
  • Mixing up phishing and pharming. Phishing uses a message and a link. Pharming redirects the user even when the URL is typed correctly.
  • Leaving out the aim. Say what the attacker wants: data, money or access.

Remember these

  • Virus: needs a host and a user. Worm: spreads by itself. Trojan horse: disguised as real software. Spyware: records and reports. Adware: adverts. Ransomware: encrypts files and demands payment.
  • Phishing: a fake message with a link to a fake website. Pharming: malicious code redirects to a fake website.
  • Social engineering: manipulating people into giving away information or access.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Which kind of malware spreads across a network without any user action?
  1. A free game installs itself and lets an attacker control the computer. What is it?
  1. A worm reaches one computer. Each hour, every infected computer infects 333 more. How many are infected after 333 hours?
  1. How does pharming differ from phishing?
  1. What is the aim of ransomware?

Enroll free in Cyber Security: Threats and Defences

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (4)

Name the kind of malware in each case. Every file on a laptop is locked, and a message demands…Easy · High School (9–10) · by StemPy Lab
A worm reaches one computer on a network of 2000 computers…Medium · High School (9–10) · by StemPy Lab
Two things happen to two customers of the same bank…Medium · High School (9–10) · by StemPy Lab
Next: lesson 3Keeping data safe: solutions to security threats
← Cyber Security: Threats and Defences
← Attacks on systems: brute force, interception, DDoS and hackingKeeping data safe: solutions to security threats →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

At a small company, a caller rings the reception desk…Hard · High School (9–10) · by StemPy Lab