Skip to content

PenTest+ PT0-003 practice question 10: Attacks

A tester finds that a search box returns user input unescaped inside the page, and a crafted value runs script in other users' browsers when they view the results. Which vulnerability is this?

The options

  • A. SQL injection
  • B. Insecure direct object reference
  • C. Server-side request forgery
  • D. Reflected or stored cross-site scripting

Answer and why

The correct answer is D: Reflected or stored cross-site scripting

A. SQL injection changes database queries on the server, not scripts in a browser.

B. IDOR exposes records by changing an identifier and does not run script.

C. SSRF makes the server issue requests, which is not what happens in the victim's browser.

D. Unescaped input that runs script in a victim's browser is cross-site scripting.

What Attacks tests

Attacks and exploits is the heaviest domain at 35%. It covers network, web, authentication, wireless and social engineering attacks. Match the weakness the stem exposes to the technique that abuses it, not to the most famous tool.

Attacks and exploits is 35% of the PT0-003 exam. The exam has 90 questions in 165 minutes, so this question is a slice of the real mix, not a prediction of your result.

Try these next

Each one is a free question from the same practice test, with the answer and the reason for every option on its own page.

Keep going

This is question 10 of 15 in the free PenTest+ PT0-003 practice test. If you missed it, say why in one sentence before you read on: the reason is what transfers to a differently worded question.