Skip to content

Instantly share code, notes, and snippets.

@Grazfather
Grazfather / Dockerfile
Created January 28, 2024 18:46
Dockerfile to build Python3.8 and arm-none-eabi-gdb + toolchain
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
# install dependencies for python3.8
RUN apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
libnss3-dev libssl-dev libreadline-dev libffi-dev wget curl git \
file locales
#attempt to fix libncursesw.so.5
RUN apt install libncurses5 -y
#!/usr/bin/env bb
(ns context-times
(:require [clojure.data.csv :as csv]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.string :as s]
[clojure.tools.cli :refer [parse-opts]]))
;; CLI
#!/bin/bash
#
# Install/update Capstone/Keystone/Unicorn from GitHub with Python/Python3 bindings
# First time, run:
# $ sudo apt-get install git cmake gcc g++ pkg-config libglib2.0-dev
#
LOGFILE=/tmp/update-trinity.log
NB_CPU="$(grep -c processor /proc/cpuinfo)"
# Run from within gdb (e.g. `pi <enter>` and paste)
need = [0x27, 0xb3, 0x73, 0x9d, 0xf5, 0x11, 0xe7, 0xb1, 0xb3, 0xbe, 0x99, 0xb3, 0xf9, 0xf9, 0xf4, 0x30, 0x1b, 0x71, 0x99, 0x73, 0x23, 0x65, 0x99, 0xb1, 0x65, 0x11, 0x11, 0xbe, 0x23, 0x99, 0x27, 0xf9, 0x23, 0x99, 0x05, 0x65, 0xce]
map = {}
for i in range(0xfe):
r = gdb.execute("call get_tbl_entry({})".format(i), False, True)
v = int(r.rstrip().split()[-1], 16)
map[v] = i
s = ""
# Taken from the binary
gh = "A)\xd9e\xa1\xf1\xe1\xc9\x19\t\x93\x13\xa1\t\xb9I\xb9\x89\xdda1i\xa1\xf1q!\x9d\xd5=\x15\xd5"
mh = ""
def mirror_bits(c):
return (
(c & 1) << 7 |
(c & 2) << 5 |
(c & 4) << 3 |
(c & 8) << 1 |
from pwn import *
from collections import defaultdict
def add_row(graph, y, row):
for x, col in enumerate(row):
true_x = x/2
if col == " ": # Can do down or left
if not x & 1: # This is the left wall part
@Grazfather
Grazfather / delphi.py
Last active February 22, 2017 22:20
BSsidesSF CTF 2017 "delphi-status" crypto 250
# From BsidesSF CTF 2017
import itertools
import requests
import sys
from binascii import hexlify, unhexlify
uh = unhexlify
h = hexlify
@Grazfather
Grazfather / bt.py
Last active February 22, 2017 22:08
BsidesSF 2017 CTF b-64-b-tuff solution
import sys
from pwn import *
def exploit():
r.recvuntil("start: ")
addr = r.recv(10)
addr = int(addr, 16)
print hex(addr)

Original report:

************* Module gef
W:2774, 0: TODO: add more customizable items (fixme)
W:100, 0: Anomalous backslash in string: '\-'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
C:173, 0: Exactly one space required around comparison
    if len(sys.argv)==2 and sys.argv[1]=="--update":
                    ^^ (bad-whitespace)
C:173, 0: Exactly one space required around comparison
@Grazfather
Grazfather / RC3-cardmaker.py
Last active June 4, 2017 18:51
RC3 PWN 500 Card maker solution
#!/usr/bin/env python
import sys
from pwn import *
port = 8080
strtol_addr = 0x6030B0