2021DASCTF實戰精英夏令營暨DASCTF July X CBCTF 4th writeup


根據賽后講解學習。

Misc

Nuclear_wastewater

二維碼掃碼沒啥內容。。看圖片像素。

from PIL import Image

pic = Image.open("aaaaa.png")  # type: Image.Image
width, height = pic.size
lst = []
for x in range(0, width, 10):  # 放大圖片看一格子是10x10像素
    for y in range(0, pic.height, 10):
        pixel = pic.getpixel((x, y))
        if pixel == (255, 255, 255):
            continue
        r, g, b = pixel
        lst.extend(pixel)
from collections import Counter

data = ''
for i in lst:
    if i == 0: continue
    if i < 32 or i > 128:
        continue
    data += chr(i)

counter = Counter(data)
for k, count in counter.most_common():
    print(k, end='')  # key就是前面的  theKEYis:#R@/&p~!

得到解壓密碼。解壓后文件用 Unicode Steganography with Zero-Width Characters 解不出來。
用winhex/vim看一下。有200c,200d,200e,勾選這3項解碼。
得到提示:ctrix和去掉寬字符的密文

使用cyberchef進行ctrix解碼2次得到flag

0x4Just_a_GIF

gif解壓出圖片451張。每11張循環一次
1.將相同圖片對比像素點,得到一組圖片a, 其中有2張提示9張拼接圖
2.將a組合超來形成新圖片b, 發現b是二維碼的一部分
3.按提示將圖拼拼來掃碼

腳本

from pathlib import Path

from PIL import Image


def get_name(i):
    return str(i).rjust(3, '0') + '.png'


def diff(a, b, img) -> Image:  #
    a = Image.open(a)  # type: Image.Image
    b = Image.open(b)  # type: Image.Image
    a = a.convert("RGB")
    b = b.convert("RGB")

    w, h = a.size

    for x in range(w):
        for y in range(h):
            ra = a.getpixel((x, y))
            rb = b.getpixel((x, y))
            if ra != rb:
                img.putpixel((x, y), (1, 0, 0))


def main():
    count = len(list(Path('.').glob('*.png')))
    size = Image.open('001.png').size

    for start in range(11):
        img = Image.new("RGB", size, color=(255, 255, 255))
        for i in range(start, count, 11):
            if i + 11 > 450:
                break
            fp = get_name(i)
            fp_next = get_name(i + 11)
            diff(fp, fp_next, img)

        dst = Path('../res')
        if not dst.exists():
            dst.mkdir()
        img.save(dst / f'{start}.png')


if __name__ == '__main__':
    main()

我用手機上的barcode scanner掃的。qr searcher掃不到

其他wp鏈接:
http://www.snowywar.top/?p=2424
https://blog.csdn.net/qq_42880719/article/details/119301367


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM