Skip to content

Instantly share code, notes, and snippets.

View avlidienbrunn's full-sized avatar

Mathias Karlsson avlidienbrunn

View GitHub Profile
@avlidienbrunn
avlidienbrunn / writeup.md
Created September 18, 2023 16:18
challenge writeup content-type shenanigans

Description

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.

Source

As the harder solution works for both, heres source:

php
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
@avlidienbrunn
avlidienbrunn / Bypvm.markdown
Created August 4, 2014 13:32
A Pen by Mathias Karlsson.
<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;