Tags: csv 

Rating:

### Writeup

When we open the file secret_1 (1).csv we see that there are some text like 0,1......... which are basically the qr code coodinate of black pixel stored. Now accordingly we need to write a solve script to get the qr code and they use any qr code scanner to scan the qr code a get the secret text or flag. Solve script -

```py
from PIL import Image
import csv

def decode_coordinate(coord):
x, y = map(int, coord.split(','))
return (x, y)

def decode_coordinates(encoded_coordinates):
return [decode_coordinate(coord) for coord in encoded_coordinates]

# Read the black pixel coordinates from the CSV file
with open("secret.csv", "r") as f:
reader = csv.reader(f)
next(reader) # Skip the header row
encoded_coordinates = [row[0] for row in reader]

decoded_coordinates = decode_coordinates(encoded_coordinates)

# Recreate the QR code image
image = Image.new("1", (100, 100), color=255)
for x, y in decoded_coordinates:
image.putpixel((x, y), 0)

image.save("recreated_qr_code.png")
```

### Flag - n00bz{qr_c0d3_1n_4_csv_f1l3_w0w!!!}

Original writeup (https://github.com/n00bzUnit3d/n00bzCTF2023-OfficalWriteups/tree/master/Forensics/QRazy%20CSV).