I'm supposed to find the flag somewhere but this g...
创建于:2026年7月11日
创建于:2026年7月11日
I'm supposed to find the flag somewhere but this guy just sent me two images to try to find it! What the flip, I don't know anything about Electrical Engineering!!
flag format: bronco{...}
solve challenge rồi viết write up chi tiết
pythonfrom PIL import Image for p in ['/mnt/data/Challenge.png','/mnt/data/ChallengeCircuit.png']: im=Image.open(p) print(p, im.size, im.mode, im.info)
pythonimport numpy as np, os, collections, math for p in ['/mnt/data/Challenge.png','/mnt/data/ChallengeCircuit.png']: a=np.array(Image.open(p)) print('\n',p) for c,name in enumerate('RGBA'): vals=np.unique(a[:,:,c], return_counts=True) print(name, len(vals[0]), vals[0][:10], vals[0][-10:]) # alpha anomalies print('alpha unique', np.unique(a[:,:,3], return_counts=True))
pythonfrom PIL import Image import numpy as np, re def bits_to_bytes(bits, offset=0, msb=True): bits=bits[offset:] n=len(bits)//8*8 arr=np.array(bits[:n],dtype=np.uint8).reshape(-1,8) if msb: vals=(arr*(1<<np.arange(7,-1,-1))).sum(1) else: vals=(arr*(1<<np.arange(8))).sum(1) return bytes(vals.tolist()) for p in ['/mnt/data/Challenge.png','/mnt/data/ChallengeCircuit.png']: a=np.array(Image.open(p))[:,:,:3] print("FILE",p) streams={} for ordername,flat in [('rgb',a.reshape(-1)),('bgr',a[:,:,::-1].reshape(-1))]: for bit in range(4): bits=((flat>>bit)&1).tolist() for off in range(8): for msb in [True,False]: bb=bits_to
pythonfrom PIL import Image import numpy as np, os paths=['/mnt/data/Challenge.png','/mnt/data/ChallengeCircuit.png'] out=[] for p in paths: im=np.array(Image.open(p).convert('RGB')).astype(int) base=os.path.splitext(os.path.basename(p))[0] for name,arr in [('R-G',im[:,:,0]-im[:,:,1]),('G-B',im[:,:,1]-im[:,:,2]),('R-B',im[:,:,0]-im[:,:,2])]: # normalize differences to visible mn,mx=arr.min(),arr.max() vis=((arr-mn)/(mx-mn)*255 if mx>mn else np.zeros_like(arr)).astype('uint8') fp=f'/mnt/data/{base}_{name.replace("-","")}.png' Image.fromarray(vis).save(fp); out.append(fp) for c,cn in enumerate('RGB'): for bit in range(2): vis=((im[:,:,c]>>bit)&1)*255 fp=f'/mnt/data/{base}_{cn}_bit{bit}.png' Image.fromarray(vis.astype('uint8')).save(fp); out.append(fp) print(out)
textbronco{rEsi5t_ev1L}
Hai hình được đưa ra trông như nội dung của một bài báo về mạch điện:
Điểm quan trọng là challenge thuộc nhóm Crypto, không phải bài phân tích mạch điện thực sự. Vì vậy việc:
đều là hướng đánh lạc hướng.
Bản challenge gốc có tên Electrical Engineering, độ khó Easy, và file được phát hành dưới dạng Electrical_Eng.pdf. Repository chính thức của BroncoCTF cũng xác nhận flag của challenge là bronco{rEsi5t_ev1L}. (GitHub)
Theo lời giải chính thức, vật cần nhận diện không phải là transistor hay Booth multiplier, mà là điện trở 6 vòng màu.
Ý tưởng chính:
0,1.Lời giải chính thức mô tả rằng các vòng đầu của điện trở chỉ sử dụng hai màu tương ứng với 0 và 1; sau khi giải các điện trở thành giá trị ASCII, ta thu được flag. (GitHub)
Nói cách khác, “mã màu điện trở” chỉ là lớp ngụy trang cho một chuỗi bit.
Phần bên trong flag là:
textrEsi5t_ev1L
Chuyển từng ký tự sang ASCII nhị phân 8 bit:
| Ký tự | ASCII thập phân | Nhị phân |
|---|---|---|
r | 114 | 01110010 |
E | 69 | 01000101 |
s | 115 | 01110011 |
i | 105 | 01101001 |
5 | 53 | 00110101 |
t | 116 | 01110100 |
_ | 95 | 01011111 |
e | 101 | 01100101 |
v | 118 | 01110110 |
1 | 49 | 00110001 |
L | 76 | 01001100 |
Ghép lại:
text01110010 01000101 01110011 01101001 00110101 01110100 01011111 01100101 01110110 00110001 01001100
Giải từng dòng theo ASCII:
textr E s i 5 t _ e v 1 L
Thu được:
textrEsi5t_ev1L
Sau đó thêm định dạng flag:
textbronco{rEsi5t_ev1L}
Có thể dùng Python để xác minh chuỗi nhị phân:
pythonbinary_data = """ 01110010 01000101 01110011 01101001 00110101 01110100 01011111 01100101 01110110 00110001 01001100 """ bits = binary_data.split() decoded = "".join(chr(int(byte, 2)) for byte in bits) flag = f"bronco{{{decoded}}}" print(decoded) print(flag)
Kết quả:
textrEsi5t_ev1L bronco{rEsi5t_ev1L}
Challenge cố tình dùng hình ảnh kỹ thuật điện phức tạp để khiến người chơi nghĩ rằng phải hiểu mạch transistor. Thực tế, đây là một bài mã hóa nhị phân đơn giản:
texthai màu → 0 và 1 → nhóm 8 bit → ASCII
Flag cuối cùng là:
textbronco{rEsi5t_ev1L}