Skip to content

Instantly share code, notes, and snippets.

View crowell's full-sized avatar
🐢
I may be slow to respond.

Jeffrey Crowell crowell

🐢
I may be slow to respond.
  • Boston, MA
View GitHub Profile
using System;
using System.Drawing;
using SdlDotNet.Graphics;
using SdlDotNet.Core;
using SdlDotNet.Input;
using System.IO.Ports; //connection to the Arduino
using System.Text; //stringbuilder
using System.Data;
@crowell
crowell / process.C
Created October 31, 2012 18:42
Safety in the process file
#include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <map>
#include "getpost.h"
#include <sys/resource.h>
using namespace std;
@crowell
crowell / hw4p1a.py
Created November 14, 2012 17:43
hw4p1a
import math
N = 15241559823203705227878887673081037716739857612370054905916497747890512048310998045508373462474562762403971294892047440113259277270082256942002416995850675202397184299808987
e = 13
def mysqrt(x):
if x < 0:
raise ValueError('square root not defined for negative numbers')
n = int(x)
if n == 0:
@crowell
crowell / hw4p1b
Created November 14, 2012 17:44
hw4p1b
import math
import fractions
N = 1791144786733299256875903974696580801523488563758757235898102851290189765401005609588035532773568199
e = 3
def gcd_iter(u, v):
while v:
u, v = v, u % v
return abs(u)
@crowell
crowell / hw4p1b.py
Created November 14, 2012 17:44
hw4p1b
import math
import fractions
N = 1791144786733299256875903974696580801523488563758757235898102851290189765401005609588035532773568199
e = 3
def gcd_iter(u, v):
while v:
u, v = v, u % v
return abs(u)
@crowell
crowell / hw4p1c.py
Created November 14, 2012 17:44
hw4p1c
import math
N = 257604469245070482680978550578686065374289166183513000923532857227284294429858993942954469559591983
e = 3
d = 85868156415023494226992850192895355124763055394504333641177619075761431476619664647651489853197328
def mysqrt(x):
if x < 0:
raise ValueError('square root not defined for negative numbers')
n = int(x)
@crowell
crowell / github.rb
Created November 25, 2013 01:29
my gist at 2013-11-24 20:29:29 -0500
require 'httparty'
require 'colorize'
require 'highline/import'
require 'json'
class GitHub
def getToken
puts "[!] GitHub API Token needed to use gists".red
_username = ask("USERNAME: ".green) {|q| q.echo = true}
_password = ask("PASSWORD: ".green) {|q| q.echo = false}
// De Bruijn pattern generator.
// Jeffrey Crowell
#include "debruijn.h"
char* peda_charset =
"A%sB$nC-(D;)Ea0Fb1Gc2Hd3Ie4Jf5Kg6Lh7Mi8Nj9OkPlQmRnSoTpUqVrWsXtYuZvwxyz";
// Generate a De Bruijn sequence. Code interpreted from wikipedia.
void db(int t, int p, int n, int maxlen, int k, int* a, char* sequence,

radare2 is a very cool set of tools that you probably don't know how to use! Let's go through a simple exploit CTF challenge to understand how to use it for exploit development.

We'll be focusing on "ropasaurus rex" which is a simple challenge from Plaid CTF After checking out the latest and greatest radare from git, let's get started!

Open up ropasaurusrex in r2 and call analyze on the binary. We can list the functions with "afl"

# Poker II Firmware disassembly help tool.
original = IO.read("./Poker II original firmware.bin")
extracted = ""
original.each_byte{|b|
m = (((b & 0x0f) << 4) | ((b & 0xf0) >> 4)) ^ 0xff
extracted << m.chr
}
puts extracted