Skip to content

Instantly share code, notes, and snippets.

@ricardojba
ricardojba / 0xOPOSEC 0x?? Challenge
Last active July 23, 2026 17:20
0xOPOSEC 0x?? Challenge
#!/usr/bin/env python3
# oposec-padding-oracle.py
import os
import base64
import urllib3
import requests
import threading
from concurrent.futures import ThreadPoolExecutor
# oposec-xor-known-plaintext-attack-encrypted-chat.py
# ncat madlabs.pw 1337
encrypted_flag = bytes.fromhex("418831b6416977a29459e1071f4a08ceb24beed7d9364ca2b23460")
encrypted_plaintext = bytes.fromhex("61a81196414f558eaa09f6390c181cdce075bec5e7301ef7a7747c77")
known_plaintext = b"flag{" + b"a" * 50
key = bytes(x ^ y for x, y in zip(encrypted_plaintext, known_plaintext))
flag = bytes(x ^ y for x, y in zip(encrypted_flag, key))
print(flag)