Skip to content

Instantly share code, notes, and snippets.

@cmbuckley
Last active August 10, 2017 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbuckley/504fcad918420d2b7ffe36a947704d6b to your computer and use it in GitHub Desktop.
Save cmbuckley/504fcad918420d2b7ffe36a947704d6b to your computer and use it in GitHub Desktop.
<html>
<body>
<script id="script">
var window = {
location: {
hostname: 'malicious site'
}
};
alert(window.location.hostname);
</script>
<p>Running the following script:</p>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('code').innerText = document.getElementById('script').innerText;
}, true);
</script>
<pre id="code"></pre>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment