Skip to content

Instantly share code, notes, and snippets.

View hellman's full-sized avatar
🍊

Aleksei Udovenko hellman

🍊
View GitHub Profile
@hellman
hellman / bin300.c
Last active December 10, 2015 00:59
PHDays CTF Quals 2013 bin300 solution
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <gmp.h>
#include <pthread.h>
#include <semaphore.h>
/*
@hellman
hellman / xor.py
Created October 16, 2013 08:43
xor script
#!/usr/bin/python
#-*- coding:utf-8 -*-
"""
xor strings
options:
-s - string with \\xAF escapes
-r - raw string
-h - hex-encoded string (non-letterdigit chars are stripped)
-f - read data from file (- for stdin)
from z3.z3 import *
s = Solver()
V = 683
vs = []
for v in range(1, V + 1):
vs.append(Int("v%03d" % v))
s.add(vs[-1] >= 1)
s.add(vs[-1] <= 3)

Keybase proof

I hereby claim:

  • I am hellman on github.
  • I am hellman (https://keybase.io/hellman) on keybase.
  • I have a public key ASAKsf-3olqWdsVlBn7KV6yJ_qKKO-O2as2_XdCCm-xuCgo

To claim this, I am signing this object:

@hellman
hellman / hxphash_solver.py
Created October 2, 2016 20:54
Solver for hxphash (rev 250) from TUM CTF 2016
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import random, zlib, re
from struct import *
from base64 import *
from commands import getoutput
from sock import *
from z3.z3 import *
@hellman
hellman / beelzemon_solver.py
Created October 10, 2016 15:15
HITCON QUALS 2016 - Beelzemon (PPC 150)
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from sock import Sock
def find_greedy(s):
a, b = [], []
sa = sb = 0
for x in sorted(s, reverse=True, key=abs):
if abs(sa + x - sb) < abs(sb + x - sa):
@hellman
hellman / sharingan_solver.py
Created October 10, 2016 15:36
HITCON QUALS 2016 - Sharingan (Misc 100)
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from sock import Sock
f = Sock("52.197.160.186 31337")
def read_map():
res = []
print " ", "".join("%2d" % i for i in xrange(19))
@hellman
hellman / 0ctf-arsenal.cpp
Last active October 10, 2016 20:04
0CTF 2016 Quals - Arsenal
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;
typedef unsigned short ushort;
typedef pair<int, int> PII;
@hellman
hellman / 0ctf-square.py
Last active October 10, 2016 20:06
0CTF 2016 Quals - Square
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from itertools import combinations, product
from collections import defaultdict
from aes import AES as AESCLS
AES = AESCLS()
@hellman
hellman / supercomputer.py
Last active February 28, 2017 13:20
Boston Key Party CTF 2016 - Supercomputer
from sage.all import *
import re
active_bits = [
0, 3, 4, 7, 8, 9, 10, 11, 14, 20, 21, 24, 25, 26,
35, 40, 41, 43, 45, 46, 47,
]
code = """