nerdexam
CompTIA

PT0-001 · Question #186

Which of the following attacks is commonly combined with cross-site scripting for session hijacking?

The correct answer is A. CSRF. XSS is commonly paired with CSRF because XSS can steal session cookies and bypass same-origin policy, allowing an attacker to hijack an authenticated user's session.

Attacks and exploits

Question

Which of the following attacks is commonly combined with cross-site scripting for session hijacking?

Options

  • ACSRF
  • BClickjacking
  • CSQLI
  • DRFI

How the community answered

(38 responses)
  • A
    92% (35)
  • C
    5% (2)
  • D
    3% (1)

Why each option

XSS is commonly paired with CSRF because XSS can steal session cookies and bypass same-origin policy, allowing an attacker to hijack an authenticated user's session.

ACSRFCorrect

CSRF is commonly combined with XSS because an XSS payload executes in the victim's browser context, giving it access to document.cookie and the ability to exfiltrate session tokens. This bypasses the same-origin policy that would normally prevent cross-origin reads. Together, XSS provides the execution vector and CSRF leverages the hijacked session to perform unauthorized actions on behalf of the victim.

BClickjacking

Clickjacking tricks users into clicking hidden UI elements but does not involve script execution or session token theft, so it does not combine with XSS for session hijacking.

CSQLI

SQL injection targets backend database queries at the server layer and operates independently of client-side script execution, making it unrelated to XSS-based session hijacking.

DRFI

Remote File Inclusion is a server-side attack that forces the server to include a remote malicious file and has no relationship to client-side cookie theft via injected scripts.

Concept tested: XSS combined with CSRF for session hijacking

Source: https://owasp.org/www-community/attacks/csrf

Topics

#XSS#CSRF#session hijacking#web attacks

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice