BSidesNYC CTFd Writeup - Secret Map: Scratching the surface
It was a forensics challenge, providing a 'map.jpg'
It was a forensics challenge, providing a 'map.jpg'
The challenge required us to find a 10-float "genetic code" that maximizes a hidden "survival rating" function to an average of 95.0% within 100 generations. This is solved using a Genetic Algorithm, an optimization technique that mimics natural selection.
This attack is a classic cryptographic vulnerability called CBC Bit-Flipping Attack, which targets data encrypted using the CBC mode. The goal of the challenge is to get the server to decrypt a malicious packet that results in a specific, secret value for the `device_id` (0xdeadbabe).
The core problem is that the same secret message (P) is being encrypted repeatedly with a predictable, but incrementing, counter. Because the message is longer than the known plaintext, we must retrieve two consecutive ciphertexts (C0 and C1) to piece together the full encryption keystream (K0).