Question 267 of 509
Attacks and ExploitsmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is that the payload closes the original filter and appends a tautology that returns all objects. This LDAP injection using tautology works because the submitted string 'admin)(&)' first closes the legitimate filter after 'admin' by inserting a closing parenthesis, then appends the filter '(&)' which is a logical AND that always evaluates to true, effectively making the entire query match every entry in the directory. On the CompTIA PenTest+ PT0-002 exam, this question tests your understanding of how LDAP query syntax can be manipulated through injection, often appearing in web application testing scenarios where user input is unsafely concatenated into search filters. A common trap is confusing this with SQL injection, but remember that LDAP filters use parentheses and ampersands rather than quotes and equals signs. Memory tip: think of the tautology as a “truth bomb” that blows the filter wide open—closing the door and then opening every window.

PT0-002 Attacks and Exploits Practice Question

This PT0-002 practice question tests your understanding of attacks and exploits. Compare every option against the stated constraints before choosing — the best answer satisfies all requirements, not just the most obvious one. 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.

During a web application test, a penetration tester suspects an LDAP injection vulnerability. The application uses user input to dynamically construct an LDAP query. The tester submits the following payload in the username field: 'admin)(&)'. The application returns a list of all users instead of the expected single user. Which of the following best describes the reason this payload was effective?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "best"

    Why it matters: Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

Question 1mediummultiple 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

The payload closes the original filter and appends a tautology that returns all objects.

Option D is correct because the payload 'admin)(&)' closes the original LDAP filter after 'admin' and appends '(&)' which is a tautology (always true). This causes the LDAP query to match all directory objects, returning the full user list instead of a single user. The attack exploits the way LDAP filters are parsed: injecting a closing parenthesis and a new filter that evaluates to true for every entry.

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.

  • The payload causes an LDAP error that triggers a fallback to list all users.

    Why it's wrong here

    LDAP injection typically manipulates the filter logic rather than causing errors. A fallback listing all users would be unusual and not a typical LDAP behavior.

  • The payload modifies the base DN to search the entire directory.

    Why it's wrong here

    The base DN is set separately in the LDAP query; the injected payload only affects the filter, not the base DN.

  • The payload introduces a logical OR that negates the original condition.

    Why it's wrong here

    The injected '(&)' is a conjunction, not a disjunction. It does not negate the condition; it adds an always-true sub-filter.

  • The payload closes the original filter and appends a tautology that returns all objects.

    Why this is correct

    The correct interpretation: by closing the original filter with ')' and injecting '(&)', the tester creates a condition that is always true, causing the query to return all directory objects.

    Clue confirmation

    The clue word "best" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates confuse the LDAP injection payload with SQL injection patterns, mistakenly thinking the '&' operator creates an OR condition, when in LDAP prefix notation '&' is an AND operator and the tautology works by appending an always-true filter, not by negating the original condition.

Detailed technical explanation

How to think about this question

LDAP filters use prefix notation with operators like '&' (AND), '|' (OR), and '!' (NOT). The payload 'admin)(&)' exploits the lack of input sanitization by closing the original filter with ')' and injecting a new filter '(&)' which is a valid AND operator with no conditions, effectively matching all entries. In real-world tests, this is a classic LDAP injection technique similar to SQL injection's 'OR 1=1', but specific to LDAP's filter syntax as defined in RFC 4515.

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

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: The payload closes the original filter and appends a tautology that returns all objects. — Option D is correct because the payload 'admin)(&)' closes the original LDAP filter after 'admin' and appends '(&)' which is a tautology (always true). This causes the LDAP query to match all directory objects, returning the full user list instead of a single user. The attack exploits the way LDAP filters are parsed: injecting a closing parenthesis and a new filter that evaluates to true for every entry.

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.

Are there clue words in this question I should notice?

Yes — watch for: "best". Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

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