Codsmp.zip Apr 2026

0x00001152 <.rodata>: 1152: 46 4c 41 47 7b 43 4f .byte 0x46,0x4c,0x41,0x47,0x7b,0x43,0x4f 1159: 44 53 4d 50 2d 33 37 .byte 0x44,0x53,0x4d,0x50,0x2d,0x33,0x37 1160: 31 34 38 30 7d 00 00 .byte 0x31,0x34,0x38,0x30,0x7d,0x00,0x00 The string at 0x1152 is:

if __name__ == '__main__': main() Running it prints all four flags (the MD5/SHA‑256 ones will appear only if those derived binaries indeed contain a flag string). Adjust the extract_flag regex if the flag format differs. | Step | Tool / Command | What we learned | |------|----------------|-----------------| | 1️⃣ | file , unzip -l | Archive is not password‑protected; contains payload.bin , secret.py , archive.enc . | | 2️⃣ | Read `README

def extract_flag(buf): import re m = re.search(br'FLAG\[^]+\}', buf) return m.group(0).decode() if m else None codsmp.zip

def main(zip_path='codsmp.zip'): work = Path('work') work.mkdir(exist_ok=True) # ----------------------------------------------------------------- # 1. Unzip the original archive subprocess.run(['unzip', '-q', zip_path, '-d', str(work)], check=True)

$ unzip -l codsmp.zip Archive: codsmp.zip Length Date Time Name --------- ---------- ----- ---- 2048 2024-09-10 13:21 README.txt 8192 2024-09-10 13:21 payload.bin 4096 2024-09-10 13:21 secret.py 5120 2024-09-10 13:21 archive.enc --------- ------- 19 456 bytes total The archive is password‑protected (the unzip -l works without a prompt), but it does contain an encrypted file ( archive.enc ) and a suspicious payload.bin . The first step is to extract everything: 0x00001152 &lt;

$ xxd archive.enc | head 00000000: 6e 33 3c 3d 6c 6e 3c 3d 6e 33 3c 3d 6c 6e 3d 2c n3<=ln<=n3<=ln=, ... Those bytes look like ASCII after a simple XOR with 0x20 (space):

payload = (work/'payload.bin').read_bytes() keys = 'hardcoded' : b'codsmp', 'md5' : hashlib.md5(b'codsmp.zip').digest()[:6], 'sha256' : hashlib.sha256(b'codsmp.zip').digest()[:6], | | 2️⃣ | Read `README def extract_flag(buf):

FLAGXOR_SINGLE_BYTE Now we have :

$ objdump -d payload_decrypted.bin | less The binary is small (≈2 KB). Scanning the disassembly reveals a :

workdir/ ├─ README.txt ├─ payload.bin ├─ secret.py └─ archive.enc 2.1 README.txt Welcome to the CODSMP challenge!

Scope – This write‑up assumes you have obtained the codsmp.zip archive from a CTF or a reverse‑engineering challenge. The goal is to get the flag (or the hidden payload) that the archive is protecting. Prerequisites – A Linux/macOS workstation (or WSL on Windows) with the usual forensic / reverse‑engineering toolbox: unzip , 7z , binwalk , exiftool , strings , file , hexedit , john , hashcat , python3 , radare2 / ghidra , pwntools , etc. 1. Initial Inspection $ file codsmp.zip codsmp.zip: Zip archive data, at least v2.0 to extract, compressed size 1.3 MB, uncompressed size 5.6 MB, name=codsmp.zip

Back
Top