Files
ctfkit/examples/README.md
T

1.3 KiB

Examples — real CTF challenges solved with this toolkit

Every example is reproducible offline (no live server, no sage) and uses lib/crypto_utils.py / lib/net.py where applicable. Solved by distilling patterns from the public p4-team/ctf archive.

Challenge Event Category Vuln Flag
ps_and_qs SECCON 2017 Quals Crypto Two RSA keys share a prime (gcd(n1,n2)=p) SECCON{1234567890ABCDEF}
lost_modulus HITCON 2019 Quals Crypto RSA leaks e,d,iqmp,ipmq but not n — recover n hitcon{1t_is_50_easy_t0_find_th3_modulus_back@@!!@!@!@@!}
a2s Pwn2Win 2021 Crypto 2-round reduced AES — differential attack recovers key CTF-BR{bu7_1f_7h0u6h7_c0rrup75_l4n6u463,_l4n6u463_c4n_4l50_c0rrup7_7h0u6h7}
russian_threesome Hack.lu 2020 RE/Misc Inverse-permutation fixed-point on a drum dump (CP1251) Кто хочет много знать, тому мало спать.

Run them

cd /home/code/ctfkit

# crypto — self contained
python3 examples/ps_and_qs.py
python3 examples/lost_modulus/solve.py

# a2s — runs the differential attack then extracts the flag
cd examples/a2s && python3 solve.py && cd ../..

# russian_threesome — permutation fixed point
python3 examples/russian_threesome/solve.py