Malware & Attack Techniques MCQs for NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

Malware and attack techniques covers the ways attackers get into systems and what they do once inside: viruses, worms, Trojans and ransomware on the malware side, and phishing and denial of service (DoS) on the attack side. It is the seventh topic in the Cyber Security area, which carries 5% of the NSCT according to HEC's Areas of Competencies. Candidates averaged 47.2% accuracy in that area in 2026, per the HEC NSCT report and APP.

This page follows Stallings and Brown, Computer Security: Principles and Practice. It classifies malware (malicious software) in two ways: by how it propagates and by what its payload does. Most exam questions are really asking you to place a scenario in that grid. All descriptions here are conceptual; no working attack code is included.

Malware Spreads by Needs a host file? Typical payload
Virus Infected programs or documents being run or shared Yes Anything
Worm Exploiting network services by itself No Anything, often a backdoor or botnet agent
Trojan horse The user installing a "useful" program No (it is the program) Backdoor, spyware
Rootkit Installed after compromise No Hides the attacker, keeps root access
Logic bomb Planted by an insider Lives inside a program Runs when a condition becomes true

Viruses

A virus inserts its code into a host program, boot sector or document and runs when that host runs. Stallings lists four phases: dormant, propagation, triggering and execution. Its parts are the infection mechanism, the trigger and the payload.

Variants to know: - Macro virus: lives in documents and runs in the application's macro language, so it is largely independent of the operating system. - Polymorphic virus: re-encrypts itself with a new key and a mutated decryptor for each copy, so no fixed signature matches. - Metamorphic virus: rewrites its whole body each time, not just the decryptor.

Example: a spreadsheet with a macro that copies itself into every file the user opens next is a macro virus.

Exam angle: if the scenario says "attached to a file" or "the user opened a document", think virus.

Worms

A worm is a standalone program that finds and infects other machines over a network with no host file and no user action. Spread follows an S-shaped curve: a slow start, then fast growth, then a slow finish as uninfected vulnerable hosts run out.

Example: if infections double every 5 minutes from one host, after 30 minutes there are 2^6 = 64 infected hosts.

Exam angle: "spread to unpatched machines without anyone clicking" means worm, even if the payload is something else.

Ransomware

Ransomware encrypts the victim's files, or locks the system, and demands payment for the key. Many modern groups also steal data first and threaten to publish it, which is called double extortion. WannaCry (2017) combined a ransomware payload with worm-style spread through an SMB vulnerability.

The main defence is backups that the malware cannot reach: offline or immutable copies following the 3-2-1 rule (three copies, on two types of media, one off-site). If the last good backup ran at 01:00 and the attack hits at 13:00, you lose 12 hours of changes.

Exam angle: a backup share that is always mapped and writable is not a real backup against ransomware.

Phishing

Phishing is social engineering by message: a fake email or page from a trusted brand tricks the user into giving credentials or running malware.

Variant Channel or target
Spear phishing One named person or a small group, with personal details
Whaling Senior executives
Vishing Voice calls
Smishing SMS text messages
Pharming Poisoned DNS or hosts file; the user types the correct URL and still lands on the fake site

Example: 1,000 emails, a 5% click rate, and half of those clickers entering passwords gives 1,000 × 0.05 × 0.5 = 25 compromised accounts.

Exam angle: "typed the correct address" points to pharming, not phishing.

DoS

A denial-of-service attack attacks availability. A DDoS attack uses many sources, usually a botnet. Stallings groups the main forms as:

Source-address filtering at network edges (RFC 2827, BCP 38) stops spoofed packets leaving a network.

Exam angle: if the link is saturated, filtering has to happen upstream at the ISP or a scrubbing service.

Common traps

Worked examples

1. Understanding. A USB stick contains a program called "WiFi Password Viewer". When run, it shows nothing useful but installs remote-access software. What is it? Answer: a Trojan horse. It pretends to be useful and relies on the user to run it. It does not copy itself to other machines, so it is not a worm or virus.

2. Application. A DNS resolver returns 4,000 bytes for an 80-byte spoofed query. An attacker can send 100 Mbps of queries. How much traffic reaches the victim? Answer: 5 Gbps. The amplification factor is 4,000 / 80 = 50, and 100 Mbps × 50 = 5,000 Mbps = 5 Gbps.

3. Analysis. An outbreak spreads to every unpatched server on a campus overnight, with no emails sent and nobody opening files. Affected servers then join a C2 channel and later flood an external site. Which two terms describe what happened? Answer: a worm that built a botnet used for DDoS. Spreading through a network vulnerability without user action is worm behaviour. Taking commands from a C2 server makes the hosts bots, and flooding a target together is a DDoS attack.

Practise

The quiz below has 100 questions on this topic, filterable by tier and difficulty.

Practise: 100 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. What is the key difference between a computer virus and a worm?

    1. A virus spreads across networks on its own, while a worm needs a host file
    2. A worm spreads across networks on its own, while a virus needs to attach to a host program or file
    3. A worm always encrypts files, while a virus never does
    4. A virus only affects Windows, while a worm only affects Linux
    Show answer

    Answer: B. A worm spreads across networks on its own, while a virus needs to attach to a host program or file

    Stallings separates malware by how it spreads. A virus inserts itself into existing code or documents and spreads when that host is run or shared. A worm is a standalone program that actively seeks out and infects other machines over a network without needing a host file.

  2. Which term describes malware that looks like a useful program but secretly performs a hidden, harmful function?

    1. Trojan horse
    2. Worm
    3. Logic bomb
    4. Adware
    Show answer

    Answer: A. Trojan horse

    A Trojan horse appears useful, such as a free utility or game, but carries a hidden malicious function. It spreads through social engineering (the user installs it), not by self-replication.

  3. What does ransomware typically do once it runs on a victim's machine?

    1. Displays unwanted adverts in the browser
    2. Encrypts the victim's files and demands payment for the decryption key
    3. Slows the network by sending ping floods
    4. Records keystrokes and silently uploads them
    Show answer

    Answer: B. Encrypts the victim's files and demands payment for the decryption key

    Ransomware encrypts files (or locks the system) and demands payment, usually in cryptocurrency, for the key. Many modern variants also steal data first and threaten to leak it, which is called double extortion.

  4. A phishing email is crafted for one named employee, using her job title and a recent project she worked on. What is this called?

    1. Pharming
    2. Vishing
    3. Spear phishing
    4. Smishing
    Show answer

    Answer: C. Spear phishing

    Spear phishing is phishing aimed at a specific person or group, using personal details to look convincing. Generic phishing sends the same lure to many people.

  5. A denial-of-service (DoS) attack mainly violates which property of the CIA triad?

    1. Confidentiality
    2. Availability
    3. Integrity
    4. Non-repudiation
    Show answer

    Answer: B. Availability

    A DoS attack stops legitimate users from reaching a service or resource, which is a loss of availability. It does not normally read or change data.

  6. What is the main purpose of a rootkit?

    1. To encrypt files for ransom
    2. To hide the attacker's presence and keep privileged access to a system
    3. To spread through email attachments
    4. To show pop-up adverts
    Show answer

    Answer: B. To hide the attacker's presence and keep privileged access to a system

    A rootkit is a set of programs that hides malicious activity (files, processes, network connections) and maintains administrator (root) level access. Kernel-mode rootkits change operating system functions so normal tools cannot see them.

  7. Malware that records every key a user presses and sends the log to an attacker is called a:

    1. Keylogger
    2. Logic bomb
    3. Worm
    4. Dropper
    Show answer

    Answer: A. Keylogger

    A keylogger captures keystrokes to steal passwords and other sensitive input. Stallings groups it with spyware under payloads that steal information.

  8. What is a botnet?

    1. A network of compromised computers controlled remotely by an attacker through a command-and-control channel
    2. A firewall that blocks automated traffic
    3. A legitimate server cluster used for load balancing
    4. A type of antivirus that scans networks
    Show answer

    Answer: A. A network of compromised computers controlled remotely by an attacker through a command-and-control channel

    Each infected machine in a botnet is a bot (or zombie). The attacker, the bot herder, sends commands through a command-and-control (C2) server, for example to launch a DDoS attack or send spam.

  9. A text message says your parcel is held and asks you to pay a small fee through a link. This is an example of:

    1. Vishing
    2. Whaling
    3. Smishing
    4. Pharming
    Show answer

    Answer: C. Smishing

    Smishing is phishing over SMS (text messages). Vishing uses voice calls, whaling targets senior executives, and pharming redirects users through DNS or hosts-file tampering.

  10. Code planted in a program that runs its harmful action only when a specific condition is met, such as a date or an event, is a:

    1. Logic bomb
    2. Worm
    3. Rootkit
    4. Botnet
    Show answer

    Answer: A. Logic bomb

    A logic bomb stays inactive until its trigger condition becomes true, then executes its payload. A time bomb is a logic bomb whose trigger is a date or time.

FAQs

What is the difference between a virus, a worm and a Trojan?

A virus attaches to a host program or document and spreads when that host is run or shared. A worm is a standalone program that spreads over the network by itself. A Trojan pretends to be useful software and relies on the user to install it. They differ in how they spread; any of them can carry any payload.

Is ransomware a virus?

Not necessarily. Ransomware describes the payload: encrypting files and demanding payment. It can arrive by phishing attachment, by a Trojan installer or by worm-style spread, as WannaCry did. In exam answers, classify the propagation and the payload separately, then pick the option that matches both.

Is NSCT cyber security hard?

In 2026 candidates averaged 47.2% in the Cyber Security area, close to the middle of the ten areas, per the HEC report. Attack questions mostly test classification: matching a scenario to the right malware or attack name. Learn the propagation-versus-payload grid and the phishing variants, and many questions become quick.

Next step

Continue with Authentication & Access Control MCQs. For related defences, see Network Security and Web Application Security. Browse all topics on the Cyber Security hub, then take an NSCT mock test.