CPENT Cloud And Hybrid Infrastructure Security Practice Question
During a container security assessment, a penetration tester identifies a Kubernetes pod running with 'CAP_SYS_ADMIN' capabilities and the host's PID namespace shared ('hostPID: true'). Which technique allows the tester to escape the container and execute code on the host?
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
✓
Use 'nsenter --target 1 --mount --uts --ipc --net --pid' to enter the host's namespaces and spawn a root shell on the host node.
With CAP_SYS_ADMIN and hostPID enabled, the tester can inspect processes running on the host, locate processes like systemd or docker daemon, and use tools like nsenter or inject payloads into host namespaces.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Mount the Docker socket inside the container using the mount syscall enabled by CAP_SYS_ADMIN.
Why it's wrong here
Incorrect. CAP_SYS_ADMIN alone does not automatically mount the Docker socket unless explicitly configured.
- ✗
Execute the 'docker run' command inside the container to spin up a sibling container.
Why it's wrong here
Incorrect. The Docker CLI inside a container cannot talk to the host daemon unless the socket is explicitly mounted.
- ✓
Use 'nsenter --target 1 --mount --uts --ipc --net --pid' to enter the host's namespaces and spawn a root shell on the host node.
Why this is correct
Correct. Combining hostPID and capabilities like CAP_SYS_ADMIN allows the use of nsenter targeting PID 1 on the host to break out of the container boundary.
- ✗
Write directly to the host's /proc/sysrq-trigger file without any additional mounts.
Why it's wrong here
Incorrect. /proc is typically container-namespaced unless explicitly mounted from the host.
About these practice questions
Courseiva writes every CPENT question from scratch — 274 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official EC-Council exam blueprint
This CPENT practice question is part of Courseiva's free EC-Council 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 CPENT exam.