Skip to content

Instantly share code, notes, and snippets.

View mozfreddyb's full-sized avatar

Frederik Braun mozfreddyb

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="jld" fetch="https://github.com/jld/" />
<remove-project name="platform_prebuilts_qemu-kernel" />
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="jld" revision="secure-goldfish" />
</manifest>
@ttaubert
ttaubert / rc4.js
Last active August 29, 2015 14:08
RC4 in (almost) a tweet
function*r(k){t=x=>(y=x%n)in s?s[y]:y;w=_=>t((s[i%n]=t(j+=f=t(i++)))+(s[j%n]=f));for(n=256,s=[i=j=0];i<n;)w(j+=k[i%k.length]);for(j=0,i=1;;)yield w()}
// A raw RC4 stream.
// Works in Firefox only (needs lots of ES6).
// 150 chars
// Usage:
for (var b of r([65,65,65])) {
console.log(b);
}
@devd
devd / ext2csp.pl
Last active July 12, 2016 22:31
Simple Tool to maybe rewrite extensions to be CSP compatible
#Run this on Extension Source code to make it inline-script-less
#perl ext2csp.pl <extdir>;
#where extdir is the directory with the manifest.json.
#This will make a inplace change: make a copy if you want it to work on a copy.
use strict;
use warnings;
use HTML::Parser ();
@mozfreddyb
mozfreddyb / add-ca-cert.js
Created July 10, 2017 12:09
privileged JS for Firefox to add a certificate as a trusted CA
if (typeof Cc == "undefined") { Cc = Components.classes; }
if (typeof Cu == "undefined") { Cu = Components.utils; }
if (typeof Ci == "undefined") { Ci = Components.interfaces; }
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509Cert = Ci.nsIX509Cert;
const nsIX509CertDB = Ci.nsIX509CertDB;
const certdb = Cc[nsX509CertDB].getService(nsIX509CertDB);
let certstring = `-----BEGIN CERTIFICATE-----
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select