❯ python crypto.py level:0 bkcrack 1.6.1 - 2024-01-22 [21:59:49] Z reduction using 44370 bytes of known plaintext 26.0 % (11536 / 44370) [21:59:50] Attack on 155 Z values at index 33459 Keys: d0043c88 20e5781d 2160b96d 94.8 % (147 / 155) Found a solution. Stopping. You may resume the attack with the option: --continue-attack 147 [21:59:50] Keys d0043c88 20e5781d 2160b96d
用密钥获取压缩包密码
1 2 3 4 5 6 7 8 9 10 11
❯ bkcrack -C prob05.zip -c uncrackable.m4a -k d0043c88 20e5781d 2160b96d -b \?a -l 12 bkcrack 1.6.1 - 2024-01-22 [22:42:55] Recovering password length 12... Password: bQCvRH7q1ULs 60.4 % (2321 / 3844) Found a solution. Stopping. You may resume the password recovery with the option: --continue-recovery 625151303030 [22:42:59] Password as bytes: 62 51 43 76 52 48 37 71 31 55 4c 73 as text: bQCvRH7q1ULs
用密码解压之后查看 uncrackable.m4a 末尾的附加字符 strings uncrackable.m4a | grep flag
❯ bkcrack -C prob05.zip -c 70.m4a -p 70.txt -o 5 -x 0 000000 bkcrack 1.6.1 - 2024-01-22 [00:47:57] Attack on 4194304 Z values at index 12 Keys: 5bb795f4 424af6b2 acadf670 43.6 % (1828975 / 4194304) Found a solution. Stopping. You may resume the attack with the option: --continue-attack 1828975 [01:02:46] Keys 5bb795f4 424af6b2 acadf670
❯ python crypto.py level:5 bkcrack 1.6.1 - 2024-01-22 [22:16:14] Z reduction using 1048569 bytes of known plaintext 0.8 % (8070 / 1048569) [22:16:15] Attack on 130 Z values at index 1041024 Keys: a08fc77f 1dd36012 734e2126 76.2 % (99 / 130) Found a solution. Stopping. You may resume the attack with the option: --continue-attack 99 [22:16:15] Keys a08fc77f 1dd36012 734e2126
for i inrange(len(flag)): char = canvas.crop((W * i, 0, W * (i + 1), H)) char.save(f'./tmp_char/char_{i}.png')
defmosaic_img(img: Image.Image, L, H, R, D): w, h = R - L, D - H a = [0, 0, 0] cnt = 0 for x inrange(w): for y inrange(h): j = img.getpixel((L + x, H + y)) for ch inrange(len(a)): a[ch] += j[ch] cnt += 1 b = [k // cnt for k in a] mosaic = Image.new('RGB', (w, h), tuple(b)) img.paste(mosaic, (L, H, R, D))
for i inrange(5, len(flag)): mosaic_img(canvas, W * i, 0, W * i + W, H // 2) mosaic_img(canvas, W * i, H // 2, W * i + W, H)
canvas.save('flag_censored.png', format='png') f = Image.open('./70.png') censored = Image.open('./flag_censored.png') ll = len(flag) # ll = len(flag) - 1 cropped_region = f.crop((W * (ll - 1), 0, W * ll, H // 2)) censored_cropped = censored.crop((W * (ll - 1), 0, W * ll, H // 2)) diff = ImageChops.difference(censored_cropped, cropped_region) if diff.getextrema()[0][0] == 0and diff.getextrema()[1][0] == 0and diff.getextrema()[2][0] == 0: # print("not best", chr(k), diff.getextrema()) cropped_region = f.crop((W * (ll - 1), H // 2, W * ll, H)) censored_cropped = censored.crop((W * (ll - 1), H // 2, W * ll, H)) diff = ImageChops.difference(censored_cropped, cropped_region) if diff.getextrema()[0][0] == 0and diff.getextrema()[1][0] == 0and diff.getextrema()[2][0] == 0: print(chr(k), diff.getextrema()) flag = flag[:-1]
- decoded morse data: flag g3t f14g fr0m mor3ecad3 add underline between each word go to https:://storage..wearos..fans//amarket//name..wav (all lowercase))