rev
Challenges

Plastic Shield

OPSec is useless unless you do it correctly.
This is after I throw it into dogbolt, and check the main of the program

Only one character is extracted:
char var_189 = var_148[rdx >> 2];
That character goes directly to blake2b:
crypto_blake2b(&var_188, 0x40, &var_189, 1);
Figedting some more then I have to look at Ghidra

0x3c
in hexadecimal = 60 in decimalSo:
local_30 = (password_length * 60) / 100
Which simplifies to:
local_30 = password_length * 0.6
With all that in places the binary plastic-shield
is a password-checking program that:
Asks for a password input (up to 255 characters)
Applies a special character detection algorithm - it finds the character at position
floor(0.6 * password_length)
Uses that special character as a key to decrypt an embedded ciphertext
Uses BLAKE2b hashing to derive a 64-byte hash from the special character
Uses AES-CBC decryption with:
Key: first 32 bytes of the hash
IV: bytes 32-48 of the hash
And we need to decrypts from the embedded hex string
713d7f2c0f502f485a8af0c284bd3f1e7b03d27204a616a8340beaae23f130edf65401c1f99fe99f63486a385ccea217
from binascii import unhexlify
from hashlib import blake2b
from Crypto.Cipher import AES
def main():
# The embedded hex ciphertext from the binary
hex_ciphertext = "713d7f2c0f502f485a8af0c284bd3f1e7b03d27204a616a8340beaae23f130edf65401c1f99fe99f63486a385ccea217"
ciphertext = unhexlify(hex_ciphertext)
print(f"[*] Brute forcing special character...")
# Try all printable ASCII characters
for i in range(32, 127):
char = chr(i)
# Hash the character with BLAKE2b (64 bytes)
hash_result = blake2b(char.encode("utf-8"), digest_size=64).digest()
# Split: first 32 bytes = key, next 16 bytes = IV
key = hash_result[:32]
iv = hash_result[32:48]
# Decrypt with AES-CBC
cipher = AES.new(key, AES.MODE_CBC, iv)
plaintext = cipher.decrypt(ciphertext)
# Remove PKCS7 padding
pad_len = plaintext[-1]
if 1 <= pad_len <= 16:
plaintext = plaintext[:-pad_len]
# Check if it looks like a flag
decoded = plaintext.decode("utf-8", errors="ignore")
if "scriptCTF{" in decoded:
print(f"[+] Found special character: '{char}' (ASCII {i})")
print(f"[+] Flag: {decoded}")
# Generate example password
password_length = 10
special_pos = int(0.6 * password_length) # Position 6 for length 10
password = ["A"] * password_length
password[special_pos] = char
example_password = "".join(password)
print(f"[+] Example working password: {example_password}")
return
print("[-] No flag found!")
main()
❯ python solve.py
[*] Brute forcing special character...
[+] Found special character: '`' (ASCII 96)
[+] Flag: scriptCTF{20_cau541i71e5_d3f3n5es_d0wn}
[+] Example working password: AAAAAA`AAA
scriptCTF{20_cau541i71e5_d3f3n5es_d0wn}
Plastic Shield 2 (upsolve)

Okay! Fixed last time's issue. Seriously though, I swear this one is unbreakable.
tbd, will write later.
Last updated