Bird
Raised Fist0
Cybersecurityknowledge~10 mins

Malware types (virus, worm, trojan, ransomware) in Cybersecurity - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the malware type that replicates itself by attaching to files.

Cybersecurity
malware_type = "[1]"  # This malware attaches to files and spreads when files are shared
Drag options to blanks, or click blank then click option'
Aransomware
Bworm
Ctrojan
Dvirus
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing virus with worm, which spreads without attaching to files.
2fill in blank
medium

Complete the code to identify the malware type that spreads independently over networks.

Cybersecurity
malware_type = "[1]"  # This malware spreads by itself through network connections
Drag options to blanks, or click blank then click option'
Aransomware
Bvirus
Cworm
Dtrojan
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing worm with virus, which requires a host file.
3fill in blank
hard

Fix the error in the code to correctly identify the malware type that disguises itself as legitimate software.

Cybersecurity
malware_type = "[1]"  # This malware pretends to be useful software but is harmful
Drag options to blanks, or click blank then click option'
Aworm
Btrojan
Cransomware
Dvirus
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing trojan with virus or worm which replicate differently.
4fill in blank
hard

Fill both blanks to describe the malware type that encrypts files and demands payment.

Cybersecurity
malware_type = "[1]"  # This malware [2] files and asks for money to unlock them
Drag options to blanks, or click blank then click option'
Aransomware
Btrojan
Cencrypts
Ddeletes
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'deletes' instead of 'encrypts' for what ransomware does.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping malware types to their main behavior.

Cybersecurity
malware_behaviors = {
  "virus": "[1]",
  "worm": "[2]",
  "trojan": "[3]"
}
Drag options to blanks, or click blank then click option'
Aattaches to files
Bspreads independently
Cdisguises as legit software
Dencrypts files
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing behaviors between virus and worm.

Practice

(1/5)
1. Which type of malware replicates itself to spread to other computers without needing to attach to a program?
easy
A. Worm
B. Virus
C. Trojan
D. Ransomware

Solution

  1. Step 1: Understand malware replication methods

    Viruses need to attach to files, but worms can spread independently over networks.
  2. Step 2: Identify malware that self-replicates without a host

    Worms are known for spreading themselves without needing to attach to other programs.
  3. Final Answer:

    Worm -> Option A
  4. Quick Check:

    Self-replicating malware without host = Worm [OK]
Hint: Worms spread alone, viruses need hosts [OK]
Common Mistakes:
  • Confusing virus with worm
  • Thinking trojans self-replicate
  • Mixing ransomware with spreading behavior
2. Which of the following correctly describes a Trojan horse in malware terms?
easy
A. Malware that replicates itself over networks
B. Malware that encrypts files and demands payment
C. Malware that spreads by attaching to files
D. Malware disguised as legitimate software

Solution

  1. Step 1: Define Trojan horse malware

    Trojans appear as normal software but hide harmful actions inside.
  2. Step 2: Match description to options

    Malware disguised as legitimate software matches the definition of a Trojan as disguised malware.
  3. Final Answer:

    Malware disguised as legitimate software -> Option D
  4. Quick Check:

    Trojan = disguised malware [OK]
Hint: Trojans hide inside normal-looking apps [OK]
Common Mistakes:
  • Confusing ransomware with Trojan
  • Thinking Trojan self-replicates
  • Mixing virus and Trojan definitions
3. Consider this scenario: A malware encrypts all files on a computer and demands money to unlock them. What type of malware is this?
medium
A. Ransomware
B. Worm
C. Trojan
D. Virus

Solution

  1. Step 1: Identify malware behavior described

    The malware encrypts files and demands payment to restore access.
  2. Step 2: Match behavior to malware type

    Ransomware is known for encrypting files and demanding ransom.
  3. Final Answer:

    Ransomware -> Option A
  4. Quick Check:

    Encrypts files + demands money = Ransomware [OK]
Hint: Ransomware locks files and asks for payment [OK]
Common Mistakes:
  • Confusing ransomware with virus
  • Thinking Trojan encrypts files
  • Mixing worm behavior with ransomware
4. A user reports their computer is slow and programs crash often. They find a malware that attaches itself to files and spreads when files are shared. Which malware type is most likely causing this?
medium
A. Trojan
B. Virus
C. Worm
D. Ransomware

Solution

  1. Step 1: Analyze malware behavior

    The malware attaches to files and spreads when files are shared, causing crashes and slowdowns.
  2. Step 2: Identify malware type matching this behavior

    Viruses attach to files and spread through sharing, unlike worms which spread independently.
  3. Final Answer:

    Virus -> Option B
  4. Quick Check:

    Attaches to files + spreads by sharing = Virus [OK]
Hint: Virus attaches to files, spreads via sharing [OK]
Common Mistakes:
  • Confusing worm with virus
  • Thinking Trojan spreads by itself
  • Mixing ransomware symptoms with virus
5. A company wants to protect its network from malware that can spread automatically without user action and also from malware disguised as useful software. Which two malware types should they focus on preventing?
hard
A. Virus and Ransomware
B. Trojan and Virus
C. Worm and Trojan
D. Ransomware and Worm

Solution

  1. Step 1: Identify malware that spreads automatically

    Worms spread automatically over networks without user action.
  2. Step 2: Identify malware disguised as useful software

    Trojans appear as legitimate software but carry harmful payloads.
  3. Final Answer:

    Worm and Trojan -> Option C
  4. Quick Check:

    Auto-spread = Worm, disguised = Trojan [OK]
Hint: Worm spreads alone; Trojan hides in apps [OK]
Common Mistakes:
  • Choosing ransomware instead of worm
  • Mixing virus with Trojan
  • Ignoring automatic spread behavior