Skip to content

Instantly share code, notes, and snippets.

View rtoma's full-sized avatar

Renzo Toma rtoma

  • Netherlands
View GitHub Profile
@saelo
saelo / pwn.py
Last active December 15, 2019 23:35
Solution for "assignment" of GoogleCTF 2017
#!/usr/bin/env python3
#
# Exploit for "assignment" of GoogleCTF 2017
#
# CTF-quality exploit...
#
# Slightly simplified and shortened explanation:
#
# The bug is a UAF of one or both values during add_assign() if a GC is
# triggered during allocate_value(). The exploit first abuses this to leak a
@hellman
hellman / decrypt_flag.rs
Created June 18, 2017 22:04
Google CTF 2017 Quals - Shake It
#[macro_use]
extern crate arrayref;
extern crate crypto;
use crypto::aead::AeadDecryptor;
use crypto::chacha20poly1305::ChaCha20Poly1305;
use std::env;
use std::fs::File;
use std::io::{Read, Write};
@hellman
hellman / crypto_backdoor.py
Last active June 15, 2019 07:00
Google CTF 2017 Quals - Crypto Backdoor
def I(s):
val = 0
for i in range(len(s)):
digit = ord(s[len(s) - i - 1])
val <<= 8
val |= digit
return val
def Sn(i, length):
s = ''
@hellman
hellman / 0solve.py
Last active September 3, 2017 16:22
Google CTF 2017 Quals - Introspective CRC
'''
CRC is affine.
CRC(x) = L(x) + C, where L is linear.
We want CRC(x) = L(x) + C = x.
Write as L(x)+x = C.
Solve matrix equation.
'''
from sage.all import *
@chrismytton
chrismytton / yaml2json.sh
Created October 19, 2016 15:32
Shell function to convert YAML to JSON
yaml2json () {
ruby -r yaml -r json -e 'puts YAML.load($stdin.read).to_json'
}