📝 Intrusion detection system in operating system (24 MCQs)
Monitoring Events for Signs of Unauthorised Activity
An intrusion detection system, or IDS, monitors host or network activity to identify events that may indicate attacks, policy violations, or compromised systems. A host-based IDS examines events such as file changes, logs, and process behaviour, while a network-based IDS analyses traffic. Detection results help administrators investigate suspicious activity and respond to incidents.
Why Prevention Controls Cannot Stop Every Attack
Firewalls, permissions, and authentication reduce exposure but cannot guarantee that every malicious action will be blocked. Attackers may exploit allowed services, stolen credentials, or previously unknown weaknesses. Detection provides an additional defensive layer by identifying suspicious patterns after or during an attempted intrusion.
Signature and Anomaly Based Detection
Signature-based IDS compares observed activity with known attack patterns. Anomaly-based IDS identifies deviations from an established baseline of normal behaviour. Sensors collect events and send them to analysis components, which generate alerts when rules or thresholds are triggered. Administrators review alerts and determine whether further response is required.
Example of Detecting Repeated Login Failures
A host-based IDS observes 150 failed login attempts against one account within two minutes. Its detection rule identifies the unusually high failure rate and generates an alert. An administrator investigates the source, checks related logs, and applies appropriate account or network protections if the activity is unauthorised.
Detection Accuracy and Monitoring Overhead
IDS tools improve visibility and support incident investigation, but they do not automatically prevent every attack. Signature systems may miss new techniques, while anomaly systems can generate false alarms when legitimate workloads change. Effective deployment requires updated rules, suitable baselines, log protection, alert tuning, and trained personnel.
Misconceptions About Intrusion Detection
'An IDS automatically blocks every detected attack' describes an intrusion prevention system more closely than a passive IDS. 'Signature detection identifies every new threat' ignores previously unknown patterns. 'Every alert confirms a successful compromise' is false because alerts may represent suspicious but legitimate activity.
Exam Focus: IDS Types and Detection Methods
Compare host-based and network-based IDS, then distinguish signature-based from anomaly-based detection. Trace how sensors, analysis rules, and alerts support investigation. Questions may ask why false positives occur or how an IDS complements firewalls and access controls without necessarily blocking detected traffic.
Key Terms of Intrusion Detection
- IDS - System that detects suspicious activity.
- HIDS - Monitors activity on an individual host.
- NIDS - Analyses network traffic for threats.
- Signature - Pattern associated with known activity.
- False positive - Legitimate activity incorrectly flagged.
📝 All Intrusion detection system in operating system MCQs
Q1. What is the primary purpose of the UNIX utility rsh in the context of worm propagation?
📖 Explanation: The rsh utility is designed to let a user run a command on another machine without interactive password entry when the .rhosts file lists trusted host‑login pairs. This capability is exactly what a worm can exploit to launch code on remote systems automatically. Option B states this function, making it correct. Option A describes encryption, which rsh does not provide; Option C refers to monitoring, a different security task; Option D mentions a graphical interface, which rsh lacks. Understanding rsh’s purpose helps recognize why it is attractive to malware.
Q2. Which exact buffer size did the Morris worm use to overflow the finger daemon?
📖 Explanation: The Morris worm crafted a 536‑byte string to overflow the finger daemon’s input buffer. This specific length is remembered because it exceeds the allocated buffer and overwrites the return address on the stack. Option C gives the exact number, so it is correct. Options A, B, and D propose different sizes (256, 1024, 128) which do not match the documented exploit. Knowing the exact overflow size is essential for reproducing the attack in a controlled lab.
Q3. Why do .rhosts files increase the risk of unauthorized remote access?
📖 Explanation: Files like .rhosts list host‑login pairs that rsh trusts, allowing password‑less logins. When such files are present, any user or process on a trusted host can execute commands on the local machine, creating a shortcut for worms to spread. Option D correctly describes this risk, while Option A suggests encryption, which is unrelated; Option B mentions logging, which does not increase risk; Option C claims it disables firewalls, which is inaccurate. Recognizing this trust relationship explains why attackers target .rhosts configurations.
Q4. An administrator discovers unknown rsh connections from several internal machines. Which response should be prioritized to stop the worm’s spread?
📖 Explanation: Stopping the worm’s primary propagation channel is most urgent; disabling rsh removes the mechanism the malware uses to launch commands on remote systems. Option A directly cuts off this pathway. Changing passwords (Option B) does not affect password‑less rsh logins. Patching finger and sendmail (Option C) addresses other vectors but does not prevent further rsh‑based infection. Updating DNS (Option D) has no impact on the active connections. Prioritizing service shutdown aligns with containment best practices.
Q5. How does a buffer overflow in the finger daemon lead to execution of /bin/sh?
📖 Explanation: When the finger daemon receives input longer than its buffer, the excess bytes overwrite the saved return address on the stack. The overwritten address can point to shellcode embedded in the overflow string, which typically launches /bin/sh. Option C states this mechanism, making it correct. Option A suggests the daemon simply crashes, which is not the goal of the exploit; Option B claims it sends an email, which is unrelated; Option D says it logs the IP, which does not explain code execution. Understanding this chain connects the overflow to remote shell creation.
Q6. A network monitor shows repeated finger queries containing unusually long strings. Which mitigation step is most effective?
📖 Explanation: Updating the finger daemon to a patched version that validates input length directly removes the vulnerability that allows the overflow, preventing the worm from executing its payload. Option B therefore offers the most effective mitigation. Installing an IDS signature (Option A) can detect the attack but does not stop it. Blocking port 79 (Option C) would hinder legitimate finger usage but may not stop the worm if it uses other ports. Disabling rsh (Option D) does not address the finger-specific overflow. Patching the vulnerable service is the definitive fix.
Q7. What daemon process runs in the background to answer finger requests?
📖 Explanation: The finger service is provided by a dedicated background process often called the finger daemon. This daemon listens for incoming finger queries and returns user information. Option C correctly identifies this process. Option A (sendmail daemon) handles email, Option B (cron daemon) schedules tasks, and Option D (syslog daemon) manages logging. Distinguishing between these daemons is important when assessing which service may be vulnerable to specific attacks.
Q8. Why is exploiting the sendmail daemon considered more dangerous than exploiting a user‑level program?
📖 Explanation: The sendmail daemon typically runs with elevated privileges (often root) to bind low‑numbered ports and manage mail queues, so compromising it can grant an attacker full system control. Option D correctly highlights the elevated privilege aspect, making the exploit more severe. Option A misstates that the daemon only processes email, which underestimates its impact. Option B suggests limited impact, which is false because privilege escalation is possible. Option C claims rarity, which does not affect danger level. Recognizing privilege levels guides risk assessment.
Q9. If a worm uses rsh to propagate, which network segmentation strategy would most reduce its spread?
📖 Explanation: Segmenting the network so that internal traffic is unrestricted while external traffic is blocked does not limit rsh‑based spread because the worm operates internally. The most effective strategy is to create VLANs that separate user workstations from critical servers, limiting the hosts that can reach each other via rsh. Option B provides that isolation, reducing the number of potential targets. Options A and D offer no internal restrictions, and Option C focuses on external traffic, which does not address internal worm propagation.
Q10. What is the relationship between overwriting a stack frame and control‑flow hijacking in buffer‑overflow attacks?
📖 Explanation: In a buffer‑overflow, excess data writes beyond the intended buffer and can corrupt the saved return address stored in the stack frame. By overwriting this address, the attacker redirects the program’s execution flow to malicious code placed in the overflow payload, achieving control‑flow hijacking. Option B accurately describes this process. Options A, C, and D describe unrelated effects that do not lead to execution redirection. Understanding this mechanism clarifies why precise payload construction is crucial for successful exploitation.
Q11. A security analyst wants to detect worm activity that uses rsh. Which IDS signature would be most indicative?
📖 Explanation: Repeated outbound connections to TCP port 514 (the default rsh port) without proper authentication strongly suggest automated remote‑command attempts characteristic of a worm using rsh. Option A captures this pattern. Option B references SSH, which uses a different port and protocol. Option C involves DNS activity, unrelated to rsh. Option D describes ping sweeps, which are not specific to rsh exploitation. Targeting the correct port and behavior improves detection accuracy.
Q12. Which UNIX command returns a user’s real name and login information?
📖 Explanation: The finger command queries a remote or local user database and returns the real name, login name, and additional profile details. Option D correctly identifies this utility. Options A (ls) lists directory contents, Option B (grep) searches text, and Option C (chmod) changes file permissions. Knowing the purpose of finger is essential when assessing its vulnerability to buffer‑overflow attacks.
Q13. Why does a worm prefer remote shells over local privilege escalation when spreading across networks?
📖 Explanation: Remote shells give the worm the ability to execute commands on a target machine directly, eliminating the need to find and exploit a local vulnerability on each new host. This speeds up propagation and works even on systems where local privilege escalation is difficult. Option B correctly captures this advantage. Option A confuses remote shells with firewall bypass, which is not their primary function. Option C incorrectly claims encryption, and Option D misstates resource impact. Understanding propagation tactics informs defensive measures.
Q14. During incident response, you find a compromised host with a modified .rhosts file. What forensic evidence should you collect first?
📖 Explanation: The first step is to identify which accounts may have been used to authenticate via the altered .rhosts entries, making a list of all user accounts crucial. Option C provides this focus. Network captures (Option A) are valuable but may be less immediately available. The original .rhosts (Option B) helps compare changes but requires access to backups. timestamps (Option D) give timing but not the identity of the attacker. Prioritizing account information aligns with attribution efforts.
Q15. How does the use of .rhosts files bypass password authentication mechanisms in rsh?
📖 Explanation: When .rhosts contains host‑login pairs, rsh trusts those entries and permits password‑less logins from the listed hosts. This bypasses the normal password challenge, enabling automated remote command execution. Option A correctly explains the bypass mechanism. Options B, C, and D describe unrelated authentication methods that do not reflect how .rhosts operates. Recognizing this trust shortcut helps explain why the file is a target for malware.
Q16. Which of the following firewall rule sets would block the worm’s primary propagation method while allowing normal admin traffic?
📖 Explanation: The worm primarily uses outbound TCP connections on port 514 (rsh). Blocking outbound traffic on this port stops propagation, while permitting inbound TCP on port 22 (SSH) enables administrators to manage systems securely. Option D implements this balance. Option A blocks the worm’s port but also blocks admin SSH outbound, limiting management. Option B does not address the rsh port. Option C blocks inbound telnet (port 23) but leaves outbound rsh open. Tailoring firewall rules to the specific attack vector preserves legitimate admin access.
Q17. What are the implications of a worm that can execute arbitrary code on a remote host for the CIA triad?
📖 Explanation: When a worm gains the ability to run arbitrary code on a remote system, it can cause the host to crash or consume resources, directly affecting availability. While the worm may also exfiltrate data (confidentiality) or modify files (integrity), the immediate and guaranteed impact is on system uptime. Option C captures this primary effect. Option A downplays confidentiality, Option B overstates all three without nuance, and Option D ignores availability. Understanding the primary impact guides response priorities.
Q18. What is the typical port number used by rsh for remote command execution?
📖 Explanation: The rsh service traditionally listens on TCP port 514 for remote command execution. Option B correctly identifies this port. Option A (22) is used by SSH, Option C (80) is HTTP, and Option D (443) is HTTPS. Knowing the standard port helps network defenders monitor for suspicious rsh traffic.
Q19. A security analyst observes a sudden increase in outbound TCP connections to port 514 from internal hosts. Which hypothesis best explains this pattern?
📖 Explanation: A rapid rise in outbound connections to TCP port 514, the default rsh port, strongly suggests automated remote‑command attempts typical of a worm leveraging rsh for propagation. Option A matches this behavior. Options B and D reference SSH and software updates, which use different ports (22 and 80/443). Option C describes legitimate remote management but would normally use SSH, not rsh. Correlating port usage with known services aids accurate hypothesis formation.
Q20. How does the Morris worm’s use of multiple infection vectors affect the design of an effective intrusion detection system?
📖 Explanation: Because the worm exploits rsh, finger, and sendmail, an IDS must inspect traffic and logs across multiple protocols, detect abnormal payload sizes, and recognize unusual command patterns. Option C correctly describes the need for a layered detection strategy. Option A incorrectly suggests focusing on one protocol, which would miss other vectors. Option B oversimplifies signature use. Option D falsely claims IDS is unnecessary. Designing comprehensive detection aligns with the worm’s diversified tactics.
Q21. Which UNIX service provides an electronic telephone directory?
📖 Explanation: The finger service offers an electronic telephone directory, returning user details such as real name, login, and contact information. Option C correctly identifies this service. Options A (sendmail), B (cron), and D (syslog) serve different functions unrelated to directory queries.
Q22. If a host is infected with a worm that exploits sendmail, which log file should be inspected first to identify the exploit attempt?
📖 Explanation: Sendmail records its activity, including connection attempts and processing errors, in the mail log typically located at /var/log/maillog. Examining this file first can reveal malformed commands or buffer‑overflow attempts associated with the worm. Option B points to the correct log. Option A (auth.log) tracks authentication events, Option C (kern.log) captures kernel messages, and Option D (dmesg) shows boot‑time messages; none specifically focus on mail service activity.
Q23. Why is it important for IDS signatures to consider both payload size and protocol semantics when detecting buffer‑overflow attacks?
📖 Explanation: Buffer‑overflow exploits often rely on sending data that exceeds a service’s expected buffer size, making payload length a critical indicator. However, some protocols legitimately handle large messages, so understanding protocol semantics helps avoid false positives. Option A correctly emphasizes the need to evaluate both size and context. Options B, C, and D each ignore one essential factor, reducing detection accuracy. Combining these criteria yields a more reliable IDS rule set.
Q24. In a simulated network, you deploy a honeypot that mimics a vulnerable finger service. What behavior would indicate a successful worm infection attempt?
📖 Explanation: A worm exploiting the finger service typically sends an oversized string (over 500 bytes) to trigger a buffer overflow. The honeypot would record repeated long‑duration connections with large payloads, as described in Option C, indicating an infection attempt. Option D (no traffic) suggests the worm is not targeting the service. Options A and B represent normal usage patterns and do not reflect exploit behavior. Monitoring for abnormal request size and duration helps identify active worm propagation.