Courseiva
hardMultiple ChoiceObjective-mapped

SSCP Practice Question: During a penetration test, an attacker was able…

During a penetration test, an attacker was able to bypass input validation and execute commands on a web server. The server runs a PHP application. Which of the following is the MOST likely root cause?

⚠ Common exam trap

Candidates often confuse command injection with SQL injection or XSS, but the key differentiator is the ability to execute OS-level commands on the server, which only occurs through shell execution functions like exec() or system().

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

The application passes user input to a shell command via exec() or system() functions.

The scenario describes command execution on the web server, which is a direct consequence of OS command injection. In PHP, passing unsanitized user input to functions like exec() or system() allows an attacker to execute arbitrary shell commands, bypassing input validation. This is the most likely root cause as it directly enables command execution, unlike other vulnerabilities that lead to different impacts.

Answer analysis

Option-by-option breakdown

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

  • The application uses unsanitized input in SQL queries.

    Why it's wrong here

    SQL injection leads to database access, not command execution.

  • The application reflects user input in HTTP responses without escaping.

    Why it's wrong here

    XSS vulnerability, but does not directly execute commands on server.

  • The application passes user input to a shell command via exec() or system() functions.

    Why this is correct

    Command injection allows arbitrary command execution on the server.

  • The application uses hidden form fields to store session tokens.

    Why it's wrong here

    CSRF vulnerability, not command execution.

About these practice questions

One of 920 original SSCP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SSCP practice question is part of Courseiva's free ISC2 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 SSCP exam.