Download static tailscaled binary here
TAILSCALED_SOCKET="/tmp2/$USER/tailscaled.sock"
TAILSCALED_STATE="tailscaled.state"
./tailscaled --tun=userspace-networking --state="$TAILSCALED_STATE" --socket "$TAILSCALED_SOCKET"
homogeneous (b=0), accurate | |
original [29267633625914, 119312469505830, 53136096702586, 77836329078246, 106460853890490, 166319733341350, 130263926313722, 174241440547686] | |
truncated [26, 108, 48, 70, 96, 151, 118, 158] | |
result [29267633625914, 119312469505830, 53136096702586, 77836329078246, 106460853890490, 166319733341350, 130263926313722, 174241440547686] | |
non homogeneous, using substitution with constant (works only if gcd(a-1, m)==1, and it might fails) | |
original [99102228030939, 44710696337531, 72519758320251, 142661241057915, 26385529352827, 189216876835451, 265000266150523, 197653568336507] | |
truncated [90, 40, 65, 129, 23, 172, 241, 179] | |
result [99102228030939, 44710696337531, 72519758320251, 142661241057915, 26385529352827, 189216876835451, 265000266150523, 197653568336507] |
Download static tailscaled binary here
TAILSCALED_SOCKET="/tmp2/$USER/tailscaled.sock"
TAILSCALED_STATE="tailscaled.state"
./tailscaled --tun=userspace-networking --state="$TAILSCALED_STATE" --socket "$TAILSCALED_SOCKET"
addEventListener('fetch', (event) => { | |
event.respondWith( | |
handleRequest(event.request).catch( | |
(err) => new Response(err.stack, { status: 500 }) | |
) | |
); | |
}); | |
const ID_LEN = 6 | |
const SEC_PER_DAY = 60 * 60 * 24 |
# padic ecdlp | |
# combines https://hackmd.io/@mitsu/ByhK-tZX_ and proposition 4 from https://arxiv.org/pdf/2010.15543 | |
def gen_problem(p, k): | |
R = Zmod(p**k) | |
S = (randint(1, p), randint(1, p)) | |
a1 = randint(1, p) | |
a2 = R(S[1] ** 2 - (S[0] ** 3 + a1 * S[0])) | |
E = EllipticCurve(R, [a1, a2]) |
conda create --name ctf sage=10.5 -c conda-forge
pip install web3 pwntools numpy z3-solver httpx fastecdsa pytesseract pyshark flask-unsign flask-unsign[wordlist] binteger websockets pycryptodome ecdsa black gunicorn websockets waitress git-dumper ptrlib gunicorn[gevent] ropper tqdm flask r2pipe PyExifTool python-docx pillow numpy pycurl galois networkx pyshark gradient-free-optimizers bottle playwright
# also try z3-solver==4.11.2.0 which could be faster
# with more ml stuffs:
conda create --name ctf sage=10.2 -c conda-forge scikit-learn pandas pytorch matplotlib torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
# not supported by Python 3.11
# pip install cvc5
from z3 import * | |
import random | |
from contextlib import contextmanager | |
from time import perf_counter | |
# ------------------ | |
# Start of utility functions | |
# credits: @y011d4 | |
# ------------------ |
A workaround for people who prefer entering password in tty when possible (e.g. using pinentry-mode loopback
) but don't want to break vscode commit signing:
~/.local/bin/my-pinentry.sh
:#!/bin/sh
if [ "$PINENTRY_USER_DATA" = "tty" ]; then
exec /usr/bin/pinentry-tty "$@"
else
exec /usr/bin/pinentry "$@"
fi
asdf_shell() { | |
export "ASDF_${1:u}_VERSION"="$2" | |
} | |
# and completion for zsh assuming ASDF_DATA_DIR is set | |
_asdf_shell_1() { | |
local -a plugins=( "${ASDF_DATA_DIR:?}/plugins"/*(:t) ) | |
compadd -a plugins | |
} | |
_asdf_shell_2() { |
from lll_cvp import * | |
from functools import partial | |
def example1(): | |
# copied from https://github.com/rkm0959/Inequality_Solving_with_CVP/blob/main/Example%20Challenge%204%20-%20HITCON%20CTF%202019%20Quals%20-%20not%20so%20hard%20RSA/solve_challenge_4.sage | |
## Example 4 : HITCON CTF 2019 Quals not so hard RSA | |
## d is 465 bits |
# Time usage: <5min | |
# Net usage: ~200MB | |
# Disk usage: <800MB docker image | |
FROM ubuntu:20.04 | |
# Setting up Macaulay2 repository | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends software-properties-common apt-transport-https && \ |