Course contentsShow
← Security
Lesson 1138 of 3,05223. Web Security - Modern Web AttacksFree lesson

Clickjacking Testing and Detection

Practical techniques for identifying clickjacking vulnerabilities including manual testing and automated scanner usage.

Clickjacking Testing and Detection

What you'll learn: How to systematically test for and identify clickjacking vulnerabilities using both manual techniques and automated tools.

Now that you understand clickjacking defenses like X-Frame-Options and frame-ancestors, you need practical methods to find vulnerabilities in the wild.

Manual Testing Approach

The simplest test is attempting to embed a target page in an iframe. Create a basic HTML test page:

<!DOCTYPE html>
<html>
<head>
  <title>Clickjacking Test</title>
</head>
<body>
  <h1>Testing target.com for clickjacking</h1>
  <iframe src="https://target.com/sensitive-page" 
          width="800" height="600">
  </iframe>
</body>
</html>

Host this locally or on a test domain. If the target page loads successfully in the iframe, it's potentially vulnerable. Check your browser's developer console for errors—a properly protected page will refuse to load or show frame-blocking errors.

Header Inspection

Manually examine HTTP responses for protective headers:

  • Look for X-Frame-Options: DENY or SAMEORIGIN
  • Check for Content-Security-Policy with frame-ancestors directive
  • Verify these headers exist on all sensitive pages, not just the homepage

Missing or misconfigured headers indicate vulnerability.

Automated Scanner Usage

Security scanners like Burp Suite, OWASP ZAP, and specialized tools can crawl your application checking every endpoint for proper frame protection. They verify header presence, test frame-busting scripts, and flag pages without defenses.

Practical Testing Tips

Think like an attacker: Target sensitive actions—login forms, payment pages, account settings, and delete buttons are prime candidates. Generic content pages matter less.

Test edge cases: Check mobile views, API endpoints returning HTML, error pages, and redirects—developers often forget these.

Key Takeaway: Clickjacking testing combines simple iframe embedding tests, HTTP header verification, and automated scanning, focusing on pages with sensitive user actions where missing X-Frame-Options or frame-ancestors headers indicate exploitable vulnerabilities.