🎓 BookMCQ
← Back to 15. Security

📝 Auditing accounting and logging in operating system security (8 MCQs)

Recording and Reviewing Security Relevant System Activity

Auditing, accounting, and logging provide records that help operating systems track activity, monitor resource use, and investigate security events. Logging records events such as authentication attempts and service errors. Auditing evaluates actions against security requirements, while accounting measures resource consumption or usage. Together, these functions support accountability, troubleshooting, compliance, and incident investigation.

Why System Activity Must Be Traceable

Without reliable records, administrators may struggle to determine who accessed a resource, when a configuration changed, or how an incident developed. Multi-user systems especially require accountability for privileged operations and sensitive data access. Logs also help identify repeated failures, suspicious behaviour, and resource misuse.

Event Collection, Audit Rules and Usage Records

The operating system and applications generate events containing details such as timestamps, account identifiers, process information, and operation results. Logging services collect and store selected records. Audit rules determine which security-relevant actions require tracking, while accounting facilities measure resource use such as CPU time, memory, or storage consumption.

Example of Tracking a Failed Administrative Login

An administrator's account receives 25 failed login attempts before a successful session begins. Authentication logs record the attempts, timestamps, and available source information. An audit review identifies the unusual sequence, allowing security staff to determine whether the activity represents a configuration problem or a possible account attack.

Forensic Value, Storage and Record Integrity

Reliable logs support investigation, accountability, and operational planning. Excessive logging consumes storage, while inadequate records leave gaps. Attackers may attempt to alter or delete logs, so sensitive records should have restricted access, protected storage, reliable timestamps, retention policies, and central collection where appropriate.

Misconceptions About Auditing and Accounting

'Logging and auditing are exactly the same' is misleading because auditing evaluates selected activities against policy. 'Accounting only records financial payments' ignores its measurement of computing resource usage. 'A log file is trustworthy merely because it exists' overlooks tampering, missing events, clock errors, and inadequate access protection.

Exam Focus: Event Records and Accountability

Differentiate logging, auditing, and resource accounting by their purposes. Identify useful fields in an audit record, including identity, timestamp, action, target, and result. Questions may examine failed login patterns, privileged activity, log retention, central collection, and why protecting the records is essential for investigations.

Key Terms of Security Auditing

  • Logging - Recording system and application events.
  • Auditing - Reviewing actions against security rules.
  • Accounting - Measuring resource use by accounts.
  • Audit trail - Sequence of recorded security events.
  • Retention - Period for which records are preserved.
2
Easy
4
Medium
2
Hard

📝 All Auditing accounting and logging in operating system security MCQs

Q1. What is the default TCP port number used by the rsh service?

A.514 ✅
B.22
C.512
D.23
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The rsh service traditionally listens on TCP port 514. Option A lists this correct number, while the other ports belong to different services: 22 is used by SSH, 512 is the port for the rlogin service, and 23 is the telnet port. Knowing the default port is essential for configuring firewalls and detecting unauthorized rsh traffic, which helps protect systems from the type of remote‑execution attacks employed by worms.

Q2. Why does a buffer overflow in the finger daemon enable the worm to execute /bin/sh?

A.It modifies file permissions
B.It overwrites the return address on the stack ✅
C.It changes environment variables
D.It triggers a denial of service
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The finger daemon copies the incoming string into a fixed‑size buffer without checking length. When a 536‑byte string is supplied, it exceeds the buffer and overwrites the saved return address on the stack. Option B describes this overwrite, causing execution to jump to code placed on the stack that launches /bin/sh. Options A, C, and D describe unrelated effects; they do not explain how control flow is hijacked, which is the core of the exploit.

Q3. A system administrator discovers unexpected rsh connections and wants to reduce worm infection risk. Which combination of actions is most effective?

A.Disable rsh only
B.Patch the finger daemon only
C.Migrate to SSH only
D.Disable rsh, patch finger, and migrate to SSH ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Disabling rsh removes the insecure password‑less remote execution mechanism, patching finger fixes the overflow vulnerability, and migrating to SSH provides encrypted, authenticated sessions. Selecting all three (option D) addresses each attack vector used by the worm. Option A only removes rsh but leaves finger and sendmail exploitable; option B fixes finger but ignores rsh; option C adds security but does not close existing vulnerabilities. Comprehensive defense is required to prevent similar infections.

Q4. How does the .rhosts file facilitate password‑less remote execution?

A.It lists trusted host‑login pairs ✅
B.It encrypts traffic between hosts
C.It uses Kerberos tickets for authentication
D.It requires a public‑key certificate
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: .rhosts contains host‑login pairs that the rsh daemon trusts, allowing users to log in without a password from those hosts. Option A correctly states this function. Options B, C, and D describe security features (encryption, Kerberos, public‑key) that rsh does not provide; they would actually increase security rather than enable password‑less access. Understanding .rhosts is vital because its misuse can let worms spread automatically across trusted machines.

Q5. When a worm sends a 536‑byte string to the finger daemon, which memory region is most likely overwritten?

A.Heap
B.Stack ✅
C.Code segment
D.CPU registers
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The 536‑byte string is larger than the buffer allocated in the finger daemon, so the excess data overwrites adjacent memory. Because the buffer resides on the call stack, the overflow corrupts the stack frame, specifically the saved return address. Option B identifies the stack as the overwritten region. The heap stores dynamically allocated memory, the code segment holds executable instructions, and registers are CPU registers; none are directly overwritten by this input overflow.

Q6. Which logging mechanism best captures remote command execution performed via rsh?

A.Syslog
B.Auditd ✅
C.Snort
D.None of the above
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Auditd is the Linux auditing subsystem that records detailed information about system calls, including executions of remote commands via rsh. Option B correctly names auditd as the mechanism that can capture who invoked rsh and from where. Syslog can log generic messages but often lacks the granularity needed for command‑execution tracking. Snort is a network intrusion detection system, not a host‑based logger, and option D provides no solution. Proper auditing helps detect worm‑like activity.

Q7. What primary security weakness does the Morris worm exploit in the sendmail daemon?

A.Default credentials
B.Buffer overflow ✅
C.Misconfigured ACLs
D.Lack of encryption
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The Morris worm’s sendmail infection leveraged a buffer overflow vulnerability in the sendmail daemon, allowing it to execute arbitrary code. Option B correctly identifies a buffer overflow as the primary weakness. Default credentials were not involved; sendmail does not use default passwords. Misconfigured ACLs and lack of encryption are separate concerns but do not explain how the worm gained code execution. Recognizing this flaw guides secure configuration and patching.

Q8. A host has both .rhosts and .shosts files. Which scenario presents the greatest risk of unauthorized remote shell access?

A.Presence of .rhosts only
B.Presence of .shosts only
C.Presence of both files ✅
D.No such files exist
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Both .rhosts and .shosts define trusted host‑user relationships for rsh; having both files increases the number of accounts that can be accessed without authentication, thereby raising the risk of unauthorized remote shells. Option C captures this combined risk. Option A or B alone represent a single source of trust, which is less risky than the combined effect. Option D indicates no risk, which is false when either file exists. Administrators should remove or restrict these files to limit worm propagation.

🔗 Related Topics (MCQs)