tên challenge: Zopslop Mô tả: The flag is hidden i...
Created on: May 9, 2026
Answered using GPT-5.5 Thinking by Chat01
Created on: May 9, 2026
Answered using GPT-5.5 Thinking by Chat01
tên challenge: Zopslop
Mô tả: The flag is hidden inside the attachment.
flag format: BKISC{...}
solve challenge rồi viết write up chi tiết kèm câu lệnh + script
textBKISC{h0w_d1d_y0u_gue55_1t?}
Full solve script: solve_zopslop.py
Chạy:
bashpython3 solve_zopslop.py chall.zip
Output chính:
text[+] FLAG = BKISC{h0w_d1d_y0u_gue55_1t?}
bashfile chall.zip unzip -l chall.zip mkdir work unzip -q chall.zip -d work cd work file step_1.zip
chall.zip chỉ chứa step_1.zip.
Kiểm tra các ZIP signature trong step_1.zip:
bashpython3 - <<'PY' from pathlib import Path b = Path("step_1.zip").read_bytes() for sig in [b"PK\x03\x04", b"PK\x07\x08", b"PK\x01\x02", b"PK\x05\x06"]: print(sig, [i for i in range(len(b)) if b.startswith(sig, i)]) PY
Kết quả đáng chú ý:
textb'PK\x03\x04' [0, 263, 1733] b'PK\x05\x06' [1711, 2514]
Có 2 ZIP bị nối vào nhau. ZIP thứ hai bắt đầu tại offset 1733.
Tách file:
bashdd if=step_1.zip of=part1.zip bs=1 count=1733 status=none dd if=step_1.zip of=part2.zip bs=1 skip=1733 status=none unzip -l part1.zip unzip -l part2.zip
part1.zip có:
textzip_password.txt step_2.zip
part2.zip có:
textstep_2.png
Extract part2.zip:
bashmkdir part2 unzip -q part2.zip -d part2
Decode QR:
bashpython3 - <<'PY' import cv2 img = cv2.imread("part2/step_2.png") print(cv2.QRCodeDetector().detectAndDecode(img)[0]) PY
Kết quả:
texthttps://www.youtube.com/watch?v=dQw4w9WgXcQ
Đây chỉ là Rickroll, không phải hướng giải chính.
step_2.zipExtract part1.zip:
bashmkdir part1 unzip -q part1.zip -d part1
zip_password.txt nhìn như text bình thường, nhưng bị chèn rất nhiều ký tự Unicode U+200E.
Decode bằng cách bỏ U+200E:
bashpython3 - <<'PY' from pathlib import Path s = Path("part1/zip_password.txt").read_text("utf-8") pwd = "".join(c for c in s if c != "\u200e") print(pwd) PY
Password thu được:
textsuper_duper_omega_very_secret_password_hehehehehehe_not_guessy_at_all_10957129085701395809137580139758013957813095713
step_2.zip dùng WinZip AES, unzip thường không giải được method 99, nên mình decrypt bằng script. WinZip AES dùng PBKDF2-HMAC-SHA1, AES-CTR và HMAC kiểm tra integrity.
step_2.zipTrong solve script, phần xử lý ZIP AES làm các bước:
pythonkm = pbkdf2_hmac("sha1", password, salt, 1000, 2 * key_len + 2) aes_key = km[:key_len] mac_key = km[key_len:2 * key_len] verifier = km[-2:]
Sau khi decrypt, thu được:
textstep_2/step_3.rar step_2/zip_password
File step_2/zip_password chỉ gồm whitespace Unicode. Mỗi ký tự whitespace biểu diễn 1 nibble hex.
Mapping dùng để decode:
pythonmp = {chr(i): ((i & 0xf) + 2) & 0xf for i in range(0x2000, 0x2008)} mp.update({ " ": 0xf, "\n": 0xe, "\r": 0xe, "\t": 0xd, chr(0x85): 0x0, chr(0xa0): 0x1, })
Command decode:
bashpython3 - <<'PY' from pathlib import Path s = Path("step_2/zip_password").read_text("utf-8") mp = {chr(i): ((i & 0xf) + 2) & 0xf for i in range(0x2000, 0x2008)} mp.update({ " ": 0xf, "\n": 0xe, "\r": 0xe, "\t": 0xd, chr(0x85): 0x0, chr(0xa0): 0x1, }) vals = [mp[c] for c in s] b = bytes((vals[i] << 4) | vals[i + 1] for i in range(0, len(vals) - 1, 2)) print(b.decode("latin1").rstrip("\r\n")) PY
Password RAR:
textwhite_space_encoding_is_not_that_guessy_right_or_is_it?_09178093762985078932p587892305873298057129851987513987
step_3.rar là RAR5 encrypted. Trong archive có:
textstep_3/decrypt.py step_3/decrypt.py:secret
:secret là NTFS Alternate Data Stream được lưu dưới dạng RAR5 service header STM.
RAR5 lưu thông tin file encryption trong extra record type 0x01; record này chứa version, flags, KDF count, salt, IV và password check value. RAR technical note cũng mô tả flag 0x0002 là tweaked checksums, ảnh hưởng checksum chứ không đổi cách decrypt data. (WinRAR)
Sau khi giải RAR layer, lấy được decrypt.py:
pythonfrom cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives import padding from cryptography.hazmat.backends import default_backend import base64 key = b"bkisctfisthebest" iv = b"theremustbesmthg" with open("encrypt.bin", "rb") as f: ciphertext = base64.urlsafe_b64decode(f.read()) cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend()) decryptor = cipher.decryptor() padded_plaintext = decryptor.update(ciphertext) + decryptor.finalize() unpadder = padding.PKCS7(128).unpadder() plaintext = unpadder.update(padded_plaintext) + unpadder.finalize() print(plaintext)
File encrypt.bin lấy từ ADS :secret:
textAdb_rVwlsUXfgGBstyss1jSDxlh37npYHcTj5vgVwH0=
Chạy decrypt:
bashpython3 decrypt.py
Output:
textb'BKISC{h0w_d1d_y0u_gue55_1t?}'
Mình đã để script đầy đủ ở đây:
Cài dependency nếu máy thiếu:
bashpython3 -m pip install cryptography rarfile sudo apt install gcc libarchive-dev
Chạy:
bashpython3 solve_zopslop.py chall.zip
Script tự làm toàn bộ:
textchall.zip → step_1.zip → split ZIP nối ZIP → decode U+200E password → decrypt WinZip AES step_2.zip → decode whitespace password → decrypt/patch RAR5 layer → lấy decrypt.py + encrypt.bin → AES-CBC decrypt flag