🎓 BookMCQ
← Back to 15. Security

📝 Virus protection in operating system (16 MCQs)

Defensive Controls Against File Infecting Malware

Virus protection combines operating system features and security software to prevent, detect, isolate, and remove malicious code that infects files or executable content. Protection may include real-time scanning, signature databases, behavioural analysis, restricted execution, and system recovery. These controls aim to stop infection, limit replication, and reduce damage to user data and system files.

Why File Execution and Sharing Need Protection

Viruses often spread when infected files are executed or transferred between systems. Removable media, email attachments, downloads, and shared folders provide common distribution paths. Unrestricted execution and excessive write permissions allow malicious code to infect additional files, making prevention and early detection important.

Scanning, Behaviour Monitoring and Quarantine

Antivirus software scans files using known signatures, heuristic rules, or behavioural indicators. Real-time protection may inspect files when they are downloaded, opened, or executed. Suspected items can be quarantined to prevent execution while allowing investigation. Updated definitions and carefully configured exclusions improve detection without unnecessarily blocking legitimate software.

Example of an Infected Download

A user downloads an executable that matches a known malware signature. Real-time protection detects the match before the program runs and places the file in quarantine. The user is prevented from launching it, while the security tool records the detection and provides information for review or removal.

Defence in Depth and Detection Limitations

Virus protection is stronger when combined with software updates, least privilege, application control, backups, and user awareness. Signature detection may miss new variants, while behavioural methods can produce false alarms. No antivirus product guarantees complete protection, so organisations need recovery plans and monitoring for broader security incidents.

Misconceptions About Virus Protection

'An installed antivirus prevents every malware infection' ignores new threats and non-virus attacks. 'Quarantine always means a file is permanently deleted' is incorrect because it is isolated for review. 'A recent scan proves a system will remain clean' overlooks later downloads, updates, and newly discovered threats.

Exam Focus: Prevention, Detection and Quarantine

Distinguish signature scanning, heuristic detection, behavioural monitoring, and quarantine. Trace how real-time protection handles a suspicious download before execution. Questions may ask why updates, least privilege, backups, and restricted execution complement antivirus software and why detection does not guarantee complete prevention.

Key Terms of Virus Protection

  • Antivirus - Software detecting and handling malware.
  • Signature - Known pattern identifying malicious code.
  • Heuristic detection - Identifies suspicious code characteristics.
  • Quarantine - Isolates suspected malicious files.
  • Real-time protection - Checks files during access or execution.
3
Easy
7
Medium
6
Hard

📝 All Virus protection in operating system MCQs

Q1. A system administrator discovers that the .rhosts file on a Unix server contains entries allowing password‑less logins from several hosts. Which security risk does this create?

A.Unauthorized remote execution via rsh without password ✅
B.Encryption of all network traffic
C.Automatic virus scanning
D.Mandatory two‑factor authentication
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The .rhosts file tells rsh which remote hosts may log in without a password. When such entries exist, an attacker who can reach those hosts can start a remote shell instantly, bypassing authentication. This directly enables unauthorized remote execution, the primary risk. Options B, C, and D describe unrelated security features; they do not result from .rhosts entries. Understanding this risk helps admins tighten remote access controls.

Q2. The Morris worm sent a 536‑byte string to the finger service. What is the immediate effect of that oversized input on the finger daemon?

A.It triggers a graceful error message
B.It causes the daemon to restart
C.It overflows the input buffer and overwrites the return address ✅
D.It encrypts the communication channel
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The finger daemon allocates a fixed‑size buffer for incoming data. Supplying a 536‑byte string exceeds that buffer, causing a stack overflow that overwrites the saved return address. The overwritten address can point to attacker‑controlled code, allowing execution of malicious instructions. Options A and B describe benign outcomes that would not arise from an overflow, while D is unrelated to input size. Recognizing overflow behavior is essential for preventing such attacks.

Q3. Why did the Morris worm incorporate three different infection methods rather than relying on a single exploit?

A.To reduce code size ✅
B.To increase the chance of spreading across diverse systems
C.To comply with network protocols
D.To avoid detection by antivirus signatures
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Using multiple infection vectors—rsh, finger, and sendmail—means the worm can compromise systems that may be immune to one method but vulnerable to another. This redundancy raises the overall infection probability across varied configurations. Option A is incorrect because adding methods usually enlarges code. Option C is irrelevant, and D misstates the purpose; while multiple methods can help evade signatures, the primary goal is broader propagation.

Q4. What primary function does the Unix \finger\ utility provide to users?

A.List running processes
B.Display user login information and contact details ✅
C.Transfer files between hosts
D.Manage printer queues
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Finger queries a remote host for information about a specific user, returning login name, real name, office location, phone number, and sometimes a personal message. This makes it an electronic telephone directory. Options A, C, and D describe different utilities (ps, scp, lpq) that do not relate to finger’s purpose. Knowing finger’s role clarifies why exploiting it can yield sensitive user data and a foothold on a system.

Q5. Which daemon is responsible for handling incoming email messages in the traditional Unix sendmail architecture?

A.crond
B.syslogd
C.sendmail daemon ✅
D.nfsd
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The sendmail architecture relies on a background process—commonly called the sendmail daemon—to listen on port 25 and process incoming SMTP traffic. This daemon receives, queues, and forwards email. Options A (crond) schedules tasks, B (syslogd) records logs, and D (nfsd) provides network file system services; none handle email. Recognizing the correct daemon is key when assessing vulnerabilities that could be exploited by worms targeting mail services.

Q6. How does a buffer‑overflow vulnerability in the finger service allow an attacker to obtain a remote shell?

A.It modifies DNS records
B.It overwrites the function pointer to execute injected shellcode ✅
C.It disables the firewall
D.It creates a new user account automatically
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: When finger receives input longer than its buffer, the excess data overwrites adjacent stack data, including the saved return address. By crafting the overflow to point to attacker‑supplied shellcode (often a small program that invokes /bin/sh), the service jumps to that code upon returning, granting the attacker a remote command shell. Options A, C, and D describe unrelated effects that do not stem from a stack overflow. This mechanism illustrates why input validation is critical.

Q7. An organization disables rsh on all hosts but leaves the finger service unpatched. What remains a viable infection vector for the Morris worm?

A.SSH brute‑force ✅
B.Finger buffer overflow
C.DNS spoofing
D.USB drive infection
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Even with rsh disabled, the worm can still exploit the unpatched finger daemon. The worm’s buffer‑overflow payload targets finger’s input handling, allowing remote code execution regardless of rsh availability. SSH brute‑force (A) is a different attack vector, DNS spoofing (C) does not involve finger, and USB drive infection (D) is a physical vector unrelated to network services. Understanding residual vulnerabilities helps prioritize patching efforts.

Q8. To mitigate the risk of .rhosts‑based attacks, which of the following actions should a system administrator take?

A.Set .rhosts permissions to 600 and remove unnecessary entries
B.Increase the password length policy ✅
C.Install a web firewall
D.Enable SELinux in permissive mode
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The .rhosts file should be protected by limiting access to the owner (mode 600) and eliminating entries that grant password‑less access. This directly prevents rsh from allowing unauthorized remote logins. Changing password policies (B) does not affect .rhosts, a web firewall (C) protects HTTP traffic, and SELinux in permissive mode (D) merely logs violations without enforcing restrictions. Proper file permissions are a fundamental step in securing rsh‑based remote execution.

Q9. Compared to rsh, which characteristic of SSH most directly improves security against worms like the Morris worm?

A.Uses UDP instead of TCP
B.Provides encrypted authentication and data ✅
C.Requires less bandwidth
D.Executes commands only locally
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: SSH encrypts both the authentication process and all transmitted data, preventing eavesdropping and credential theft. It also supports strong key‑based authentication, eliminating the clear‑text password vulnerability exploited by rsh. Options A and D describe protocol differences that do not enhance security, and C is irrelevant; bandwidth does not affect worm propagation. Encryption and robust authentication are the primary defenses against remote‑execution worms.

Q10. Log analysis shows repeated finger requests containing strings longer than 500 bytes from unknown IPs. What is the most likely interpretation of this activity?

A.Regular user queries ✅
B.Attempted buffer‑overflow exploitation
C.System backup process
D.Network time synchronization
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Finger normally expects short usernames; strings exceeding 500 bytes indicate an attempt to overflow its input buffer, a classic technique used by the Morris worm. Regular queries (A) would be short, backups (C) do not use finger, and time synchronization (D) involves NTP, not finger. Detecting unusually large inputs helps identify exploitation attempts and prompts immediate mitigation.

Q11. How did the use of three distinct infection mechanisms in the Morris worm complicate detection and mitigation efforts?

A.It reduced the worm’s overall size ✅
B.It required multiple signatures and patches
C.It limited the worm to a single operating system
D.It made the worm immune to all firewalls
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Each infection method—rsh, finger, and sendmail—required its own detection signature and patch. Security teams had to monitor three separate vectors, increasing workload and the chance that one method would remain unpatched. The worm’s code grew, not shrank (A), and it ran on many Unix variants (C). While firewalls could block some traffic, they could not block all three protocols, so the worm was not immune (D). Multi‑vector design thus hinders comprehensive defense.

Q12. Which combination of measures would most effectively stop the Morris worm from spreading on a Unix network?

A.Patch finger, disable rsh, enforce strict .rhosts permissions
B.Install antivirus only ✅
C.Change default passwords
D.Enable telnet and increase logging
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Patching finger eliminates the buffer‑overflow flaw, disabling rsh removes the password‑less remote execution path, and tightening .rhosts permissions prevents unauthorized rsh logins. Together these actions address all three worm vectors. Relying solely on antivirus (B) would miss zero‑day exploits, password changes (C) do not affect rsh or finger, and enabling telnet (D) actually introduces another insecure service. A comprehensive approach is essential for robust protection.

Q13. Why do daemon processes like finger and sendmail make attractive targets for worms such as the Morris worm?

A.They run with elevated privileges and listen continuously for network requests
B.They store encryption keys ✅
C.They are rarely updated
D.They only accept local connections
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Daemons typically start as root, granting them high privileges, and they remain active, listening on network ports for incoming requests. This constant exposure provides a convenient entry point for attackers who can craft malicious inputs. Storing keys (B) is not a general daemon trait, being rarely updated (C) may be true but is not the primary reason, and many daemons accept remote connections, not just local (D).

Q14. An organization wraps sendmail with input‑validation code that truncates any argument longer than 256 bytes. How would this affect the Morris worm’s sendmail exploit?

A.The worm would still succeed unchanged
B.The exploit would fail because the overflow payload is blocked
C.The worm would switch to using rsh exclusively ✅
D.The system would reboot automatically
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The Morris worm relies on sending a payload longer than the vulnerable buffer to overwrite the return address. Truncating arguments at 256 bytes prevents the required 536‑byte overflow, effectively neutralizing that attack vector. The worm would not automatically switch to rsh (C) because it would still attempt the same exploit, and there is no automatic reboot (D). Maintaining input validation is a proven defensive measure against such overflows.

Q15. What exact length of the crafted string did the Morris worm use to overflow the finger buffer?

A.128 bytes
B.256 bytes
C.512 bytes
D.536 bytes ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: The Morris worm sent a 536‑byte string to the finger service, deliberately exceeding the allocated buffer size to cause a stack overflow and execute arbitrary code. The other lengths listed (128, 256, 512) are common buffer sizes but do not match the specific payload used in this historic worm. Knowing the precise payload size helps security professionals design accurate detection signatures.

Q16. If modern Unix-like systems continue to have unpatched daemon vulnerabilities, what trend is most likely for future worms?

A.They will target only web browsers ✅
B.They will adopt multi‑vector approaches similar to the Morris worm
C.They will stop using network attacks
D.They will rely solely on social engineering
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Unpatched daemon flaws provide reliable footholds, so attackers will likely craft worms that exploit several services simultaneously, increasing infection rates and evading single‑point defenses. Focusing only on browsers (A) ignores many vulnerable services, while abandoning network attacks (C) would forfeit a powerful propagation method. Sole reliance on social engineering (D) is a tactic but does not replace the efficiency of multi‑vector network worms. Thus, multi‑vector designs are the expected evolution.

🔗 Related Topics (MCQs)