Created
October 30, 2015 13:10
-
-
Save benfoxall/e5bc132ee585074b1366 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>iframe inject test</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var f = document.createElement('iframe'); | |
f.src = 'data:text/html;charset=utf-8,%3Ch1%3Ehello%3C%2Fh1%3E'; | |
document.body.appendChild(f); | |
var bs = new Blob(['document.write("sub script");document.body.style.background="#ccc"'], {type : 'text/javascript'}); | |
var bsurl = URL.createObjectURL(bs); | |
var b = new Blob(['<h1>HELLO</h1><script>document.write("ok")<','/script><script src="',bsurl,'"><','/script>'], {type : 'text/html'}); | |
var url = URL.createObjectURL(b); | |
var f = document.createElement('iframe'); | |
f.src = url; | |
document.body.appendChild(f); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment