Skip to content

Instantly share code, notes, and snippets.

View TheBlupper's full-sized avatar


View GitHub Profile
TheBlupper /
Created March 9, 2024 20:07
SSM2024 kval pwn
import os
import requests
open('sploit.S', 'w').write('''
global _start
section .text
mov rax, 59 ; execve
mov rdi, fn
TheBlupper /
Last active March 10, 2024 20:22
SSM2024 kval crypto (Really Secure Autput, md10, BlackSmith och rsAI)
from Crypto.Util.number import *
from pwn import *
import string
import random
io = remote('', 50000)
io.recvuntil(b'card: ')
e, N = eval(io.recvuntil(b'. ', drop=True))
TheBlupper /
Created March 11, 2024 09:20
python bytecode exploit
import subprocess
import opcode
# This may need to be adjusted but should always
# be reachable
import threading
from sage.all import *
from ortools.sat.python import cp_model as ort
from queue import Queue
def babai_coords(M, tgt):
Returns both the (approximate) closest vector
to tgt and its coordinates in the lattice M
TheBlupper /
Last active June 6, 2024 09:10
Approximate closest vector solver. Despite running the whole of LLL it's way faster than the common Gram-Schmidt version since Sage rationals are so slow...
def cvp_coords(B, t, reduce=True):
Returns both the (approximate) closest vector
to t and its coordinates in the lattice B
t = vector(ZZ, t)
if reduce: B, R = B.LLL(transformation=True)
else: R = identity_matrix(ZZ, B.nrows())