Skip to content

Instantly share code, notes, and snippets.

@otms61
otms61 / braincpy.py
Last active November 12, 2015 11:57
#!/usr/bin/python
# -*- coding: utf-8 -*-
import struct
from subprocess import Popen, PIPE
def p(a):
return struct.pack("<I", a)
# 0x080df815: add esp, dword [ebp+0x0A] ; ret ; (1 found)
@otms61
otms61 / jackshit.py
Created July 4, 2015 16:27
write up for jackshit
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import struct
import telnetlib
from time import sleep
import signal
import string
@otms61
otms61 / fss_gainesville.py
Last active August 29, 2015 14:23
write up for BkP2013 fss_gainesville
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import struct
import telnetlib
from time import sleep
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@otms61
otms61 / kappa.py
Created June 20, 2015 18:33
kappa
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket, struct, telnetlib
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
f = s.makefile('rw', bufsize=0)
return s, f
from struct import pack
import os
def p(x):
return pack('<I', x)
# 080e5080 <_IO_2_1_stdin_>:
stdin_addr = 0x80e5080
# 080a94c0 <fread_unlocked>:
@otms61
otms61 / math_util.py
Created April 23, 2015 05:58
math utils
def gcd(a, b):
"""Return greatest common divisor using Euclid's Algorithm."""
while b:
a, b = b, a % b
return a
def lcm(a, b):
"""Return lowest common multiple."""
return a * b // gcd(a, b)
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket, struct, re, telnetlib
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
f = s.makefile('rw', bufsize=0)
return s, f
@otms61
otms61 / angry.c
Last active August 29, 2015 14:14
int first_attack(int socket) {
int stuck_gurd = gs_14;
write(socket, 'left or right? (l/r) \n', 0x15);
read(socket, buf, 4);
if(buf[0] == 'l') {
write(socket, "left-fist attack!\n", 0x12);
}
else if(buf[0] == 'r') {
@otms61
otms61 / ezhp.py
Created January 29, 2015 08:24
write up of ezhp
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket, struct, re, telnetlib
import time
puts_got = 0x804a008
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
@otms61
otms61 / ezhp.c
Created January 29, 2015 08:22
write up of ezhp
struct heap
{
int head;
int next;
int prev;
/* data */
};
int notes[0x3fe];