Program and System Threats in Operating Systems: Worked Attack Trace and Exam Traps

Learn to separate program and system threats by trigger, propagation, target and effect, then test the method on one fully worked fictional attack trace.

KnowledgeGate Team

Exam prep & CS education

Updated 18 Nov 20266 min read
Program and System Threats in Operating Systems: Worked Attack Trace and Exam Traps

Trojan horse, virus, worm, backdoor, logic bomb, buffer overflow, port scan and denial of service are often memorised as one flat malware list, but that fails when one program shows several behaviours or a question changes the target from a program to one host or an operating-system service. Classify each stage by execution trigger, replication method, target resource and effect. In LabNet, file growth is 5%, automatic propagation leaves 12 new compromised hosts, and 13 sources exceed toy service capacity by 4%; real compromise and outage behaviour depends on implementation and controls. The wider CS Fundamentals hub connects this topic to related operating-system subjects.

1. Draw the boundary between a program threat and a system threat

A threat can cause harm, a vulnerability is a weakness, and an exploit uses that weakness. Malicious code causes unauthorised behaviour; its impact harms confidentiality, integrity or availability.

A program threat works through malicious code or an abused execution path. A system threat targets services, shared resources, availability or connected hosts. Classify the dominant behaviour at each stage, not the whole incident at once.

Clue in the stem

First classification question

Likely family

looks useful but performs a hidden action

what did execution conceal?

Trojan horse

activates when a condition becomes true

what is the trigger?

logic bomb

copies itself without another user action

how does it propagate?

worm

many sources exhaust one service

what shared resource is denied?

distributed denial of service

Use Operating Systems for GATE for wider process, memory and protection context.

2. Recognise the main program threats by trigger and behaviour

A Trojan horse looks legitimate but hides an unauthorised action. A backdoor bypasses normal authentication or validation. A logic bomb waits for a date, account state or event count. A virus spreads through an attached host mechanism. A buffer overflow is a memory-boundary error; abusing it is an exploitation technique, not a malware family.

A documented, authenticated maintenance interface is not automatically a backdoor. A changed size or hash shows an integrity mismatch, not malicious intent, without a trusted baseline and context.

Threat

Needs a host program?

Needs a condition?

Replicates by itself?

Decisive clue

Trojan horse

no

no

no

useful appearance conceals action

Backdoor

no

no

no

normal control is bypassed

Logic bomb

may be embedded

yes

no

condition activates it

Virus

usually attaches to a host mechanism

not necessarily

not autonomously

attachment spreads code

Buffer overflow

vulnerable code

no

no

input crosses a boundary

Worm

no host-file attachment required

no

yes, after a foothold

automatic propagation

3. Recognise system threats by the resource or population they attack

A worm propagates automatically after a foothold and needs no host-file attachment, although initial delivery may involve a user. Port scanning probes for reachable services. It is reconnaissance, not proof of compromise. Denial of service disrupts or exhausts a service; distributed denial of service uses multiple sources. Neither a scan nor a traffic spike alone proves an attack.

The groups overlap. One program can arrive as a Trojan, attach like a virus, propagate like a worm and recruit hosts for DDoS. Classify the behaviour named by the evidence.

Classification map of the ResultViewer incident, splitting five program threats from three system threats.

4. Worked example: classify the ResultViewer incident and calculate its impact

Fictional LabNet has 100 workstations and a results service able to sustain 5,000 requests per second. At 10:00, W0 runs a substituted ResultViewer.exe. The trusted file is 240 KB with shortened fictional SHA-256 prefix A17C; the 252 KB substitute has prefix B840. It opens the PDF but captures a credential, so this is Trojan behaviour. Change is 252 - 240 = 12 KB, or 12 / 240 x 100 = 5%. That mismatch alone does not prove malice.

At 10:01, maint plus RV-2048 bypasses authentication, so it is a backdoor. Deletion waits for day = 30 and failed logins >= 5, making it a logic bomb. A toy parser puts 28 bytes into a 16-byte buffer, so 28 - 16 = 12 bytes overflow. The bug is a buffer overflow; its abuse is an exploit.

At 10:02, the sample appends its 12 KB body to three utilities, showing virus-like attachment. At 10:03, it scans 2,000 distinct addresses in one minute and copies itself automatically, showing worm behaviour. Vulnerable addresses are 2,000 x 0.015 = 30; controls block 18, leaving 30 - 18 = 12 new compromises. Including W0 gives 1 + 12 = 13 hosts, or 13 / 100 x 100 = 13% of LabNet.

At 10:04, all 13 hosts send 400 requests per second. Load is 13 x 400 = 5,200 requests/s. Overload is 5,200 - 5,000 = 200 requests/s, or 200 / 5,000 x 100 = 4%. Multiple sources make this DDoS. Crossing toy capacity does not predict a real outage.

Timeline of the ResultViewer incident from 10:00 to 10:04, with a side panel showing the arithmetic for each stage.

5. Put controls at the stage they can actually change

Trusted sources, signature checks, allowlisting and hash baselines expose substitution. Reviewed authentication paths address backdoors. Least privilege, change control, integrity monitoring and recovery reduce logic-bomb or virus impact. Bounds checks, safer interfaces, memory-safe implementation where practical, patching and defence-in-depth mitigate corruption. Segmentation, service patching, egress controls and monitoring constrain propagation. Rate limiting, capacity protection and response address exhaustion.

A hash proves change, not intent. A firewall does not repair a buffer bug, a backup does not prevent credential capture, and rate limiting does not clean hosts.

If controls block 26 of 30 attempts, 30 - 26 = 4 new hosts, 1 + 4 = 5 total, and 5 x 400 = 2,000 requests/s. Spare capacity is 5,000 - 2,000 = 3,000 requests/s, but five hosts still need recovery. Quarantine before W0 executes gives zero compromises.

6. Correct the traps that scenario questions are built around

  • Trojan means self-replicating -> deception decides it.

  • Virus equals worm -> attachment differs from autonomous propagation.

  • Backdoor equals logic bomb -> bypass differs from condition.

  • Buffer overflow is a virus -> it is a weakness and exploitation route.

  • Port scan proves compromise -> it proves only probing.

  • Every DoS is distributed -> DDoS requires multiple sources.

  • One sample gets one label -> each behaviour can justify a label.

Commit first: hidden capture while the PDF opens is Trojan behaviour; day 30 AND failed logins >= 5 is a logic-bomb trigger; 12 KB appended to three executables is virus behaviour; automatic copying after scanning is worm behaviour.

Denominators matter: 12 / 30 = 40% among vulnerable hosts, 12 / 2,000 = 0.6% over scanned addresses, and 13 / 100 = 13% of LabNet.

7. How exams test program and system threats

Stable question shapes include matching definitions, classifying stages, separating delivery from propagation, identifying threat, vulnerability, exploit and impact, choosing controls, ordering a trace and calculating host counts or service load. Do not assume fixed weightage.

Use this 30-second method: underline the action verb -> identify the trigger -> check for a host file -> check for automatic propagation -> name the target resource -> use the stated denominator. Here, “copies itself automatically” decides worm behaviour although Trojan-style deception delivered the first file.

If only 12 new hosts send traffic, 12 x 400 = 4,800 requests/s, 200 below capacity. With W0, 13 x 400 = 5,200, 200 above. The stem must name its sources. Use Operating System MCQs for broader practice, and confirm any exam-specific detail against the conducting body's current official notice.

8. Short version and the next study step

Remember: Trojan = deception; backdoor = bypass; logic bomb = condition; buffer overflow = boundary violation; virus = host attachment; worm = autonomous propagation; port scan = reconnaissance; DoS = service exhaustion; DDoS = multiple sources. One incident can show several behaviours.

Redraw 2,000 scanned -> 30 vulnerable -> 18 blocked -> 12 new -> 13 total -> 5,200 requests/s -> 200 over capacity. Then recompute 26 blocked -> 4 new -> 5 total -> 2,000 requests/s -> 3,000 spare capacity without looking back.

For connected CS study, try the ZERO TO HERO complete course. For interview-oriented OS revision, consider Computer Science Fundamentals for Placements.