系统化前端渗透测试与漏洞评估
简介
针对 Web 应用的前端安全评估技能,系统化检测 XSS、CORS、敏感信息泄露、第三方库漏洞等客户端攻击面,输出结构化渗透测试报告。
原始描述
Perform a thorough client-side / browser-facing security assessment of a target web application. Use this skill whenever the user asks to pentest, audit, or...
通过你的 Agent 添加
安装目录:web-security-client-side-scanner-1773654191/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
client-side-pentest 是一项专为浏览器端安全测试设计的系统化技能,覆盖现代 Web 应用前端攻击面的完整评估流程。其核心执行路径分为四个阶段:
Phase 1 - 侦察与资产枚举:通过爬虫工具(katana、hakrawler)、历史 URL 收集(waybackurls、gau)及浏览器 DevTools,全面枚举 JavaScript bundle、source map、service worker、存储机制(localStorage/sessionStorage/cookies)及安全响应头(CSP、CORS、X-Frame-Options 等)。
Phase 2 - 静态分析:下载并解析所有前端资源,利用 retire.js、semgrep、ripgrep 等工具检索硬编码密钥、令牌、内部 API 端点、调试标志;解析 source map 还原原始源码;交叉比对已知 CVE 数据库识别存在漏洞的第三方库版本。
Phase 3 - 低风险运行时验证:在隔离浏览器环境中,对 CORS 配置、postMessage 来源验证、开放重定向、反射型 XSS 候选点进行手工探测,使用非破坏性 payload(如唯一字符串反射)而非实际利用代码。
Phase 4 - 风险确认(按需):仅对高置信度但未确认的发现构建最小化 PoC,单次手工验证,禁止自动化重复测试。
显著优点
- 攻击面覆盖全面:清单涵盖 50+ 类客户端漏洞,包括前沿威胁如 prototype pollution、mXSS、XS-Leaks、Web cache poisoning
- 方法论严谨:严格区分被动分析→主动验证→PoC 确认的渐进式方法,内置置信度分级(Confirmed/Likely/Informational/False Positive)
- 合规友好:强制授权约束、非破坏性原则、速率限制要求,内置 DoS/暴力破解/凭证攻击的主动拦截
- 输出标准化:预定义 Markdown 报告结构,含执行摘要、资产清单、库漏洞追踪、逐发现详情(CWE 映射、复现步骤、修复建议)
- 工具链集成:原生支持现代安全工具生态(nuclei、httpx、semgrep、retire.js),同时保留手工审计路径
潜在局限
- 范围受限:明确限定于客户端/前端攻击面,不覆盖服务端逻辑漏洞(如 SQL 注入、服务端 RCE)、基础设施层(服务器配置、网络架构)或移动原生应用
- 依赖外部工具:实际执行效果受限于工具安装状态、目标站点的反爬机制、动态渲染复杂度(SPA/重度 JS 应用需额外配置 headless 浏览器)
- 无自动化利用:设计上禁止自动化 exploit,高复杂度漏洞(如 DOM Clobbering 利用链、XS-Leaks 边信道)可能需要深度手工分析
- 报告占位性质:当前提供的文档为方法论框架,实际扫描需用户授权并配置目标环境
适合人群
- 安全工程师执行 Web 应用渗透测试或 SDL 审计
- 开发团队进行前端代码安全自查(DevSecOps 场景)
- 合规审计需证明客户端安全控制有效性
- Bug bounty 猎人系统化梳理前端攻击面
常规风险
- 工具误报:静态扫描可能标记无害的硬编码字符串(如示例 API key),需人工复核
- 第三方脚本风险:评估 CDN 加载的外部脚本时,需警惕供应链攻击(如恶意 analytics 脚本在测试期间被注入)
- 数据隐私:解析 source map 或存储数据时可能接触 PII/敏感业务数据,需确保符合目标组织的隐私政策
- 法律边界:即使技能内置非破坏性约束,未经授权的扫描仍可能违反 CFAA、GDPR 或目标司法管辖区的网络安全法规
- 范围受限:明确限定于客户端/前端攻击面,不覆盖服务端逻辑漏洞(如 SQL 注入、服务端 RCE)、基础设施层(服务器配置、网络架构)或移动原生应用
- 依赖外部工具:实际执行效果受限于工具安装状态、目标站点的反爬机制、动态渲染复杂度(SPA/重度 JS 应用需额外配置 headless 浏览器)
- 无自动化利用:设计上禁止自动化 exploit,高复杂度漏洞(如 DOM Clobbering 利用链、XS-Leaks 边信道)可能需要深度手工分析
- 报告占位性质:当前提供的文档为方法论框架,实际扫描需用户授权并配置目标环境
适合人群
- 安全工程师执行 Web 应用渗透测试或 SDL 审计
- 开发团队进行前端代码安全自查(DevSecOps 场景)
- 合规审计需证明客户端安全控制有效性
- Bug bounty 猎人系统化梳理前端攻击面
常规风险
- 工具误报:静态扫描可能标记无害的硬编码字符串(如示例 API key),需人工复核
- 第三方脚本风险:评估 CDN 加载的外部脚本时,需警惕供应链攻击(如恶意 analytics 脚本在测试期间被注入)
- 数据隐私:解析 source map 或存储数据时可能接触 PII/敏感业务数据,需确保符合目标组织的隐私政策
- 法律边界:即使技能内置非破坏性约束,未经授权的扫描仍可能违反 CFAA、GDPR 或目标司法管辖区的网络安全法规
- 工具误报:静态扫描可能标记无害的硬编码字符串(如示例 API key),需人工复核
- 第三方脚本风险:评估 CDN 加载的外部脚本时,需警惕供应链攻击(如恶意 analytics 脚本在测试期间被注入)
- 数据隐私:解析 source map 或存储数据时可能接触 PII/敏感业务数据,需确保符合目标组织的隐私政策
- 法律边界:即使技能内置非破坏性约束,未经授权的扫描仍可能违反 CFAA、GDPR 或目标司法管辖区的网络安全法规
技能正文
name: client-side-pentest
description: >
Perform a thorough client-side / browser-facing security assessment of a target web application.
Use this skill whenever the user asks to pentest, audit, or review the security of a website or
web app from the browser/frontend perspective, mentions client-side vulnerabilities (XSS, CORS,
open redirect, clickjacking, prototype pollution, JWT leakage, source maps, etc.), wants to find
sensitive data exposed in JavaScript bundles or client code, or asks for a security report on
front-end attack surface. Trigger even if the user just says "test the security of this site",
"find vulnerabilities in this web app", or "run a pentest on the frontend".
Client-Side / Front-End Security Assessment
A skill for conducting thorough, non-destructive client-side security reviews of web applications, producing a structured Markdown report covering all major browser-facing attack surface categories.
Setup: Fill in Before Starting
Before executing, confirm these values with the user if not already provided:
| Variable | Description |
|---|---|
TARGET |
Primary target URL |
LOGIN |
Login URL or credentials (if authenticated testing is in scope) |
CRED_AREAS |
Credential areas needing extra attention |
TOOLS_DIR |
Path to any custom tools folder |
SCOPE |
Client-side and front-end only (unless user explicitly extends) |
Authorization & Safety Constraints
- This assessment is authorized by the asset owner
- Non-destructive only — no DoS, brute force, spam, mass account creation, credential attacks
- Keep request volume moderate; avoid noisy scans unless the user explicitly approves
- Prefer passive analysis first, then low-risk validation
- Only attempt proof-of-concept when necessary to confirm a finding
- Never exceed the defined scope without explicit user approval
Mission
Identify the following across the client-side attack surface:
- Vulnerable / outdated client-side dependencies (JS libraries, third-party scripts)
- Sensitive information exposed in client-side assets (keys, tokens, internal endpoints, configs, source maps)
- Client-side vulnerabilities — see full checklist below
Vulnerability Checklist
Cover all of the following (mark each as Confirmed / Likely / Informational / False Positive):
Injection & Scripting
- Reflected XSS
- Stored XSS
- DOM-based XSS
- Mutation XSS (mXSS)
- Client-Side Template Injection (CSTI)
- HTML Injection
- CSS Injection
- Dangling markup injection
- Unsafe use of
innerHTML,outerHTML,document.write - Unsafe
eval/ dynamic code execution
Redirects & Framing
- Open redirect
- DOM-based open redirect
- Reverse tabnabbing /
window.openerabuse - Clickjacking / UI redressing
- Unsafe iframe embedding
- Weak iframe sandboxing
- Form action hijacking
Cross-Origin & Trust
- CORS misconfiguration
-
postMessageflaws (origin validation) - Cross-site WebSocket hijacking
- Missing Subresource Integrity (SRI) on third-party scripts
- Unsafe third-party script trust
Caching & Service Workers
- Web cache deception
- Web cache poisoning
- Service worker abuse / misconfiguration
- Offline cache poisoning
Data Exposure
- JWT / token leakage in
localStorage/sessionStorage/ cookies - Sensitive data in JS bundles or source
- Source map exposure (
.mapfiles reachable) - Hardcoded secrets / API keys in frontend code
- Stack traces or debug data visible to client
- Hidden admin functionality / feature flags exposed
Client-Side Logic & Manipulation
- Client-side authorization bypass
- Business logic manipulation in browser
- Parameter tampering
- Hidden field manipulation
- Client-side prototype pollution
- Insecure client-side deserialization
- Client-side path traversal
- DOM clobbering
Browser & Misc
- CSRF risk from frontend request patterns
- Mixed content
- MIME sniffing / content-type confusion
- Referer leakage
- Browser history leakage
- Autofill abuse / credential leakage
- Clipboard abuse
- File upload client-side validation bypass
- XS-Leaks
- LocalStorage / SessionStorage abuse
- Vulnerable third-party JavaScript libraries (CVE-matched)
Methodology (Execute in Order)
Phase 1 — Reconnaissance & Asset Enumeration
- Crawl target: enumerate pages, scripts, endpoints, static assets
- Identify JS bundles, source maps (
.map), manifests, service workers, web workers - Enumerate first-party and third-party JS resources (CDN scripts, analytics, tag managers)
- Check storage usage:
localStorage,sessionStorage,IndexedDB, cookies - Identify public config artifacts:
robots.txt,sitemap.xml,.well-known/*,manifest.json - Review HTTP response headers: CSP, CORS,
X-Frame-Options,X-Content-Type-Options,Referrer-Policy,Permissions-Policy,HSTS
Tools to use: curl, wget, browser DevTools, gau, waybackurls, hakrawler, katana,
subfinder, httpx, nuclei, custom scripts in TOOLS_DIR, Chrome (manual review)
Phase 2 — Static Analysis
- Download and review all reachable JS bundles and source maps
- Search for: hardcoded keys, tokens, credentials, internal URLs, debug flags, feature flags
- Parse source maps to reconstruct original source where available
- Identify JS library names and versions; cross-reference against known CVEs (RetireJS, Snyk DB)
- Review HTML for: inline scripts, hidden fields, form actions, iframes,
rel="noopener" presence
- Review CSP policy for bypasses (wildcards, unsafe-inline, unsafe-eval, missing directives)
rel="noopener" presenceTools: retire.js, npm audit, semgrep, grep/ripgrep, browser DevTools Sources tab,
js-beautify, source-map CLI
Phase 3 — Targeted Low-Risk Runtime Validation
- Open the target in Chrome; observe network requests, console errors, storage
- Test CORS by issuing cross-origin requests with crafted
Origin headers
- Check
postMessage handlers: send crafted messages with untrusted origins
- Test open redirect candidates with controlled payloads
- Test XSS candidates with non-alerting, non-destructive probes (e.g., unique string reflection)
- Inspect cookies: flags (
HttpOnly, Secure, SameSite), scope, expiry
- Check service workers: scope, fetch event handlers, cache strategies
- Test iframe embedding from external origin
Phase 4 — Risk Confirmation (Only Where Needed)
- Construct minimal PoC to confirm exploitability where finding is likely but unconfirmed
- Do not automate or repeat; single manual validation only
- Document exact reproduction steps
JavaScript Library Review Format
Origin headerspostMessage handlers: send crafted messages with untrusted originsHttpOnly, Secure, SameSite), scope, expiry- Construct minimal PoC to confirm exploitability where finding is likely but unconfirmed
- Do not automate or repeat; single manual validation only
- Document exact reproduction steps
JavaScript Library Review Format
For each identified library:
| Field | Value |
|---|---|
| Library name | |
| Detected version | |
| File path / URL | |
| Evidence | |
| Known CVEs / issues | |
| Assessment | Vulnerable / Outdated / OK |
| Security relevance |
Running Log (Keep Updated Throughout)
Maintain a running log as you work:
[STEP] Description of action
[TOOL] Tool and command used
[OUTPUT] Key evidence or finding
[CONFIDENCE] High / Medium / Low
Output
Save the final report as:
client_side_pentest_report.md
in the current working directory.
Report Structure
# Client-Side Penetration Test Report
## Executive Summary
## Scope & Assumptions
## Methodology
## Asset Inventory (client-side relevant)
## JavaScript Library Inventory
## Sensitive Data Exposure Findings
## Vulnerability Findings
## Informational Observations
## False Positives Ruled Out
## Recommended Remediation
## Appendix (commands, URLs, raw evidence, notes)
Per-Finding Format
# Client-Side Penetration Test Report
## Executive Summary
## Scope & Assumptions
## Methodology
## Asset Inventory (client-side relevant)
## JavaScript Library Inventory
## Sensitive Data Exposure Findings
## Vulnerability Findings
## Informational Observations
## False Positives Ruled Out
## Recommended Remediation
## Appendix (commands, URLs, raw evidence, notes)
### [FINDING TITLE]
- **Severity**: Critical / High / Medium / Low / Informational
- **CWE**: CWE-XXXX — [name]
- **Affected asset(s)**:
- **Description**:
- **Evidence**:
- **Reproduction steps**:
- **Security impact**:
- **Likelihood / Confidence**: Confirmed / Likely / Informational / False Positive
- **Remediation**:
- **References**:
Execution Style
- Be systematic, concise, and technical
- Prefer high signal over noisy output
- Do not stop at the first issue — continue until all phases are complete
- Distinguish clearly between Confirmed, Likely, Informational, and False Positive findings
- Do not overstate severity; be skeptical and evidence-driven
- If a noisier step is needed (e.g., active scanning, fuzzing), pause and ask the user for approval
with a clear explanation of what will be done and why
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。