Skip to content

Instantly share code, notes, and snippets.

View evandrix's full-sized avatar
💭
offline

evandrix evandrix

💭
offline
View GitHub Profile
@evandrix
evandrix / README
Created August 28, 2012 02:46
Hax.Tor
Level 1. Make a nasa.gov URL display a text of My Choice
Level 2. debfKNH1AvtBo deGH9Aq./kiSY denjFRfA8kzL2
Level 3. Recognize
Level 4. IP address is 72.14.221.104. What contains artvЂ â € ™ That Points to IT?
Level 5. Password is the owlvЂ ™ s Name
Level 6. LetvЂ ™ s See you do some Easy SQL ninjitsu
Level 7. snifflog.txt â € "ngrep format
Level 8. Password is on a Picture: not available from Anywhere
Level 9. Elementary Maths
Level 10. A poem
@evandrix
evandrix / torrent.py
Created August 28, 2012 00:50
PlaidCTF 2012: 200 - Torrent
packets = []
f = open('packets', 'rb')
data = f.readlines()
f.close()
for line in data:
line = line.strip()
packets.append({'index': line.split('\t')[0], 'data': line.split('\t')[1]})
packets = sorted(packets, key=lambda packet: packet['index'])
@evandrix
evandrix / A.cpp
Created May 3, 2012 21:13
Google Code Jam 2012
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
@evandrix
evandrix / code.java
Created March 26, 2012 02:17
Log Domain Computations
/*
First off, logAdd() takes two arguments of type double in log space, logX and logY.
It returns a double value which closely approximates log(X + Y). Consequently, the inputs and output are in log space, and we need not convert in and out of log space to complete this operation.
*/
public static double logAdd(double logX, double logY) {
// 1. make X the max
if (logY > logX) {
double temp = logX;
logX = logY;
logY = temp;
@evandrix
evandrix / kqueue_demo.cpp
Created March 15, 2012 03:23
Linux epoll / BSD kqueue sample
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <errno.h>
#include <string.h>
#include <inttypes.h>
@evandrix
evandrix / pep20_by_example.py
Created March 13, 2012 18:45
PEP 20 (The Zen of Python) by example
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com
@evandrix
evandrix / ctf_mpetrov.c
Created February 24, 2012 14:43 — forked from michaelpetrov/ctf_mpetrov.c
Stripe CTF Challenge Level 06 Solution
//
// Created by Michael Petrov on 12-02-23.
// Copyright (c) 2012 TenthBit Inc. All rights reserved.
// http://michaelpetrov.com ([email protected])
//
//
// This solution performs a timing attack on the fork system call. By monitoring the process closely
// it is possible to discover where the fork likely happened. With some basic heuristics, it's possible
// to infer where the wrong character is. With very minor brute force searching it becomes very easy
// to find the password one letter at a time.
@evandrix
evandrix / gist:1901352
Created February 24, 2012 14:40 — forked from michaelpetrov/gist:1899630
Stripe CTF Challenge - Solutions to all Levels
Stripe CTF - Work Notes
mpetrov ([email protected])
These notes are very rough. They should give a general idea of how each level was solved.
---- LEVEL 01 (login: e9gx26YEb2) -----
Solution: modifying PATH env variable
Password: kxlVXUvzv
date.c
@evandrix
evandrix / gist:1893103
Created February 23, 2012 14:34 — forked from lezhangxyz/gist:1890401
ctfsh
#!/bin/sh
if [ ! -t 0 ]; then
echo >&2 'STDIN is not a terminal'
exit 1
fi
clear
cd "$(mktemp -d)"
@evandrix
evandrix / C-naive.cpp
Created February 21, 2012 23:47
FAU WinterContest 2012
#include <iostream>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <string.h>
using namespace std;
#define REP(i, a, b) for(int i=int(a); i<int(b); i++)
typedef long long ll;
const int MAXS=10001, MAXQ=100001, MAXM=100001;