Question 218 of 509
Attacks and ExploitshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to run a Docker container with the host filesystem mounted and access it as root. This technique works because membership in the 'docker' group grants the user permission to execute Docker commands without sudo, and by default, containers run as the root user. Using the `-v /:/mnt` flag mounts the entire host filesystem into the container, giving the tester full read/write access to critical host files from inside the container, such as `/mnt/etc/shadow` or `/mnt/root/.ssh/authorized_keys`. On the CompTIA PenTest+ PT0-002 exam, this scenario tests your understanding of Linux privilege escalation vectors tied to group memberships, specifically the dangerous default of Docker’s root-equivalent access. A common trap is assuming you need to break out of the container first; instead, the mount bypasses that entirely. Memory tip: think “Docker group = root group” and remember the flag `-v /:/mnt` as “volume the whole host into the container.”

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. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. 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 gains a low-privileged shell on a Linux server and discovers that the user is a member of the 'docker' group. The tester wants to escalate privileges to root. Which technique is most effective?

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

Run a Docker container with the host filesystem mounted and access it as root

Option C is correct because members of the 'docker' group can run Docker containers with the `-v /:/mnt` flag to mount the host filesystem into the container. Inside the container, the user effectively has root privileges (since the container runs as root by default) and can access the host's `/mnt` directory, allowing them to modify files like `/mnt/etc/shadow` or add an SSH key to `/mnt/root/.ssh/authorized_keys` to gain root access on the host.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Use cron job misconfigurations to execute a reverse shell

    Why it's wrong here

    Cron misconfigurations are another privilege escalation vector, but this requires writable cron scripts or directories. The question specifically indicates docker group membership, which is a more direct and reliable privilege escalation method.

  • Exploit kernel vulnerabilities using a local exploit suggester

    Why it's wrong here

    Kernel exploits can be used, but they rely on unpatched vulnerabilities and may impact system stability. The docker group escalation is a simpler, more reliable method.

  • Run a Docker container with the host filesystem mounted and access it as root

    Why this is correct

    By running a Docker container with the host filesystem mounted (e.g., `docker run -v /:/mnt -it alpine chroot /mnt`), the user can access all host files as root because Docker effectively runs as root. This bypasses normal privilege restrictions.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Abuse SETUID binaries to execute commands as root

    Why it's wrong here

    Exploiting SETUID binaries is a privilege escalation technique, but it requires a vulnerable binary. Docker group membership provides a more direct path.

Common exam traps

Common exam trap: answer the scenario, not the keyword

CompTIA often tests the misconception that kernel exploits are always the fastest path to root, but the trap here is that membership in the 'docker' group is a trivial and reliable escalation vector that bypasses the need for kernel exploitation or other complex techniques.

Detailed technical explanation

How to think about this question

Under the hood, Docker's default behavior runs containers with root privileges inside the container, and the `--privileged` flag or volume mounts like `-v /:/host` bypass user namespace remapping. In real-world assessments, this technique is often used in CTFs and penetration tests because it requires no additional exploits—just a single `docker run -v /:/mnt -it alpine` command, followed by `chroot /mnt` to become root on the host. A subtle behavior is that even without the `--privileged` flag, a volume mount of the host root gives full write access to the host filesystem, which is sufficient for privilege escalation.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

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

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A developer is choosing between AES-256 (symmetric) and RSA-2048 (asymmetric) for encrypting a large file that will be sent to a partner. Symmetric encryption is fast but requires key exchange; asymmetric is slower but solves the key distribution problem. A hybrid approach — encrypt the file with AES, encrypt the AES key with RSA — is standard. Questions like this test whether you understand when each approach applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

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 — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Run a Docker container with the host filesystem mounted and access it as root — Option C is correct because members of the 'docker' group can run Docker containers with the `-v /:/mnt` flag to mount the host filesystem into the container. Inside the container, the user effectively has root privileges (since the container runs as root by default) and can access the host's `/mnt` directory, allowing them to modify files like `/mnt/etc/shadow` or add an SSH key to `/mnt/root/.ssh/authorized_keys` to gain root access on the host.

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

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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 30, 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.