Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊
Something

Aleksei hellman

🍊
Something
View GitHub Profile
@hellman
hellman / bin300.c
Last active Dec 10, 2015
PHDays CTF Quals 2013 bin300 solution
View bin300.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <gmp.h>
#include <pthread.h>
#include <semaphore.h>
/*
View xor.py
#!/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)
@hellman
hellman / easyhash.py
Created Oct 16, 2013
Easy hash breaking with z3
View easyhash.py
#-*- coding:utf-8 -*-
import random
from z3 import *
s = Solver()
htest = random.randint(0, 1<<32-1)
print hex(htest)
View 3-color.py
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)
@hellman
hellman / 0ctf-square.py
Last active Oct 10, 2016
0CTF 2016 Quals - Square
View 0ctf-square.py
#!/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 / 0ctf-arsenal.cpp
Last active Oct 10, 2016
0CTF 2016 Quals - Arsenal
View 0ctf-arsenal.cpp
#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;
View keybase.md

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:

View cally.py
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys, re
from ics import Calendar
from urllib2 import urlopen
import requests
print >>sys.stderr, "[i] Starting..."
@hellman
hellman / hxphash_solver.py
Created Oct 2, 2016
Solver for hxphash (rev 250) from TUM CTF 2016
View hxphash_solver.py
#!/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 Oct 10, 2016
HITCON QUALS 2016 - Beelzemon (PPC 150)
View beelzemon_solver.py
#!/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):