312-50 exam dumps

312-50 practice question 140 of 473

Certified Ethical Hacker (CEH). Associate level, EC-Council. Free question with the correct answer and a full explanation.

312-50 Question 140

Single answer▪ Escalating Privileges

During an authorized internal assessment, you obtain a low-privileged shell on a Linux web server running Ubuntu. The engagement rules allow local privilege-escalation checks, but prohibit kernel exploits that could crash the host. You notice that the account can run one command with sudo without a password: sudo /usr/bin/find. Which action is the most appropriate way to escalate privileges while staying within scope and minimizing operational risk?

  1. A

    Run sudo find . -exec /bin/sh \; -quit to spawn a shell through the allowed sudo command

  2. B

    Upload and execute a public Dirty COW exploit because it is a well-known Linux privilege-escalation method

  3. C

    Use sudo find / -name shadow -exec cat {} \; to read /etc/shadow and crack the root password offline

  4. D

    Modify /etc/sudoers directly from the low-privileged shell to grant the current user full sudo access

Show answer and explanation

Correct answer: A

Explanation

This question tests practical privilege escalation using a sudo misconfiguration on Linux. In real assessments, enumerating sudo -l is a standard step after obtaining a shell. If a user is allowed to run a binary like find as root without a password, the tester should evaluate whether that binary permits shell execution or file write operations. GNU find supports -exec, which can be abused to launch a shell when executed via sudo. This is a common privilege-escalation technique and is documented in widely used operator references such as GTFOBins for find under sudo contexts. From a best-practice and rules-of-engagement perspective, using an already-authorized sudo path is preferable to unstable kernel exploits. It is also more efficient and defensible than attempting offline password cracking when direct root command execution is available. The key CEH concept is recognizing insecure sudoers entries as a practical and low-risk privilege-escalation vector.

  • A. Correct.

    Correct. If find is permitted via sudo, it can execute other programs using its -exec action. Running /bin/sh through the authorized sudo-enabled binary is a classic and reliable privilege-escalation path when permitted by sudoers configuration. This approach is lower risk than kernel exploitation and directly leverages the misconfiguration already identified.

  • B. Incorrect.

    Incorrect. Dirty COW (CVE-2016-5195) is a kernel privilege-escalation exploit, and the scenario explicitly prohibits kernel exploits due to stability concerns. Even if potentially effective, it would violate the rules of engagement and introduce unnecessary operational risk.

  • C. Incorrect.

    Incorrect. Reading /etc/shadow may help with credential attacks, but it is indirect, slower, and unnecessary when a direct sudo misconfiguration already allows command execution as root. In addition, cracking may take time and may not succeed if the root password is strong or locked.

  • D. Incorrect.

    Incorrect. A low-privileged shell cannot normally modify /etc/sudoers without elevated rights. Attempting to edit it directly from the unprivileged context misunderstands the access controls involved. The proper path is to use the existing sudo privilege on find to obtain elevated execution first.

Timed practice exam

Take a 312-50 practice test under exam conditions

125 questions in 240 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam