You are performing enumeration on a Linux host. Which TWO of the following methods are effective for discovering potentially exploitable Cron jobs that run with elevated privileges?
Trap 1: Run 'ls -la /root/' to list all hidden files and check for…
The /root directory is generally restricted to the root user, so a low-privileged user would not have permission to list its contents. This approach is ineffective and likely to trigger security alerts if monitoring is in place, as it directly violates standard Linux permission boundaries for non-root users.
Trap 2: Search for files with the SUID bit set within the /etc/cron.daily/…
The SUID bit is typically set on binaries, not scripts within cron directories. While finding SUID binaries is useful, searching for them specifically in cron directories is logically incorrect. The focus should be on the write permissions of the scripts themselves rather than SUID attributes on those files.
Trap 3: Use 'netstat' to find which ports are open and infer what Cron jobs…
Netstat identifies listening services and network connections but provides no direct information about scheduled Cron jobs or their execution permissions. While network enumeration is essential, it does not correlate with the security posture of task schedulers like Cron, making it an ineffective tool for this specific escalation task.
- A
Check the permissions of scripts referenced in /etc/crontab to see if they are world-writable.
If a script executed by the root Cron job is world-writable, any user can inject malicious commands into the script. When the scheduler triggers the job, it executes the injected code with root privileges. Checking these permissions is a fundamental enumeration step in identifying privilege escalation opportunities.
- B
Run 'ls -la /root/' to list all hidden files and check for sensitive configuration scripts.
Why it fails: The /root directory is generally restricted to the root user, so a low-privileged user would not have permission to list its contents. This approach is ineffective and likely to trigger security alerts if monitoring is in place, as it directly violates standard Linux permission boundaries for non-root users.
- C
Search for files with the SUID bit set within the /etc/cron.daily/ directory.
Why it fails: The SUID bit is typically set on binaries, not scripts within cron directories. While finding SUID binaries is useful, searching for them specifically in cron directories is logically incorrect. The focus should be on the write permissions of the scripts themselves rather than SUID attributes on those files.
- D
Examine the output of 'ls -ld /etc/cron.*' to find world-writable directories where new jobs could be placed.
If a directory like /etc/cron.d/ is world-writable, an attacker can create a new file within it to schedule a malicious command. The system will then execute this file as root. This is a powerful method for privilege escalation that relies on weak directory permissions rather than specific script vulnerabilities.
- E
Use 'netstat' to find which ports are open and infer what Cron jobs are running.
Why it fails: Netstat identifies listening services and network connections but provides no direct information about scheduled Cron jobs or their execution permissions. While network enumeration is essential, it does not correlate with the security posture of task schedulers like Cron, making it an ineffective tool for this specific escalation task.