added default.nix and various ctf examples

This commit is contained in:
Emile Clark-Boman 2025-06-27 03:08:31 +10:00
parent b9c5a5bf3e
commit 89973b803c
6 changed files with 197 additions and 1 deletions

28
test.py
View file

@ -1,28 +0,0 @@
import string
from imp.attacks import paddingoracle
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
CHARSET = [c.encode() for c in string.printable]
KEY = b'you wont get me!'
FLAG = b'imbaud{omg_you_catched_me}'
CIPHER = AES.new(KEY, AES.MODE_ECB)
def encrypt(b: bytes, debug=False) -> bytes:
padded = pad(b + FLAG, 16)
if debug:
print(padded)
# print(padded)
return CIPHER.encrypt(padded)
def main() -> None:
paddingoracle.crack(encrypt, pad, CHARSET, 16, batch_size=50, debug=True)
if __name__ == '__main__':
try:
main()
except (KeyboardInterrupt, EOFError):
print('\n[!] Interrupt')