Skip to content

Instantly share code, notes, and snippets.

@Xornet-Euphoria
Xornet-Euphoria / optimize_list.py
Last active February 29, 2024 12:52
Pickle bytecode optimization (with my own script for crafting payload)
import pickle
import pickletools
import payload_crafter
class RunLengthCrafter(payload_crafter.Crafter):
def __init__(self, *, check_stop=False) -> None:
super().__init__(check_stop=check_stop)
@Xornet-Euphoria
Xornet-Euphoria / exploit.js
Created January 23, 2024 13:03
picoCTF 2021 - Turboflan
// utility functions
// convert float64 <-> uint64
let buf = new ArrayBuffer(8);
let float_buf = new Float64Array(buf);
let uint_buf = new BigUint64Array(buf);
function f2i(v) {
float_buf[0] = v;
return uint_buf[0];
@Xornet-Euphoria
Xornet-Euphoria / exploit.js
Last active January 18, 2024 03:22
picoCTF 2021 - Download Horsepower (with comment)
// utility functions
// convert float64 <-> uint64
let buf = new ArrayBuffer(8);
let float_buf = new Float64Array(buf);
let uint_buf = new BigUint64Array(buf);
function f2i(v) {
float_buf[0] = v;
return uint_buf[0];
@Xornet-Euphoria
Xornet-Euphoria / exploit.js
Last active January 16, 2024 15:33
*CTF 2019 - oob-v8
// utility functions
// convert float64 <-> uint64
let buf = new ArrayBuffer(8);
let float_buf = new Float64Array(buf);
let uint_buf = new BigUint64Array(buf);
function f2i(v) {
float_buf[0] = v;
return uint_buf[0];
@Xornet-Euphoria
Xornet-Euphoria / exploit.js
Created January 15, 2024 11:49
DownUnserCTF 2020 - is this pwn or web?
// only tested by `./d8 exploit.js`
// utility functions
// convert float64 <-> uint64
let buf = new ArrayBuffer(8);
let float_buf = new Float64Array(buf);
let uint_buf = new BigUint64Array(buf);
function f2i(v) {
float_buf[0] = v;
from typing import List, Optional
def calc_f(f: List[int], x: int, m: Optional[int]=None) -> int:
ret = 0
for i, a in enumerate(f):
term = a * x**i
if m is not None:
term %= m
@Xornet-Euphoria
Xornet-Euphoria / manger.py
Last active June 8, 2022 05:54
Manger's Attack
from Crypto.Util.number import getPrime, getRandomInteger, long_to_bytes
# ceil(numerator / denominator)
def frac_ceil(numerator, denominator):
if numerator % denominator == 0:
return numerator // denominator
return numerator // denominator + 1