🔥 40% Off Crucial Exams Memberships — Deal ends today!

1 hour, 53 minutes remaining!

Certified Ethical Hacker (CEH) Practice Question

During a penetration test, you find a SUID-root executable /usr/local/bin/backup on a CentOS host. Static analysis shows the binary calls tar -czf /var/backups/www.tgz www through system() without specifying an absolute path. You have write permission in /tmp. What is the most reliable way to leverage this flaw to obtain a root shell?

  • Monitor backup with strace to harvest file activity and brute-force /etc/shadow once root passwords are captured.

  • Create a custom executable named tar that launches /bin/bash, store it in /tmp, prepend /tmp to PATH, then run /usr/local/bin/backup so it executes your payload as root.

  • Set LD_PRELOAD to a malicious shared library and run /usr/local/bin/backup so the library is injected with root privileges.

  • Use ptrace to attach to backup at runtime and inject shellcode into its memory space to gain a root shell.

Certified Ethical Hacker (CEH)
System Hacking Phases and Attack Techniques
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot