This was a challenge to demonstrate how the content-type header can be used to fool the browser into treating the HTTP response body in unexpected ways.
As the harder solution works for both, heres source:
php
alert(1) |
alert(1) |
asd javascript:alert(1)
test |
company | introText | ccEmail |
---|---|---|
adsdsdsa |
With <img src=x onerror=alert(domain)> this order you opt into the following enterprise terms for services. |
License | asddsasda |
Start | dassdasadsd |
A Pen by Mathias Karlsson on CodePen.
<html> | |
<head> | |
<script> | |
function text2bin(text){ | |
var pad = "00000000"; | |
var result = ""; | |
for(index in text){ | |
result += (pad + text.charCodeAt(index).toString(2)).slice(-8); //Pad with zeroes so that each char always becomes 8 binary chars | |
} | |
return result; |