LOADING

加载过慢请开启缓存 浏览器默认开启

Misc题解 Stage 1

2024/3/7 题解 CTF

Misc题解 Stage 1

1. [MTCTF 2021] Different_Puzzle

这些图片好像不能用蛮力

拿到手是一个.vhd结尾的磁盘映像文件,里面是一堆黑条白条,看起来像条形码。还有一个flag.exe文件,打开提示需要密码。

推测是通过拼接图片得到条形码,扫描得到文件密码。

把null.vhd拖到winhex,按扇区地址升序排列。

1

从上到下手动拼接图片,得到条形码。

2

3

扫描得到密码,打开flag.exe,得到flag.txt

flag{af26d693-2de2-4b16-be49-d95e83a43f76}

2. Girlfriend’s account

大写中文金额转换问题,直接贴脚本

import pandas as pd
from decimal import Decimal

dict1 = {
    '零': Decimal('0'),
    '壹': Decimal('1'),
    '贰': Decimal('2'),
    '叁': Decimal('3'),
    '肆': Decimal('4'),
    '伍': Decimal('5'),
    '陆': Decimal('6'),
    '柒': Decimal('7'),
    '捌': Decimal('8'),
    '玖': Decimal('9'),
}

def convert_to_number(s):
    res = Decimal('0')
    length = len(s)
    for i in range(length):
        if s[i] == '佰':
            res += dict1[s[i-1]] * Decimal('100')
        elif s[i] == '拾':
            res += dict1[s[i-1]] * Decimal('10')
        elif s[i] == '元' and s[i-1] != '佰' and s[i-1] != '拾':
            res += dict1[s[i-1]]
        elif s[i] == '角':
            res += dict1[s[i-1]] / Decimal('10')
        elif s[i] == '分':
            res += dict1[s[i-1]] / Decimal('100')
    return res

df = pd.read_excel('Misc-Girlfriends_account-.xlsx')

overall_total = Decimal('0')

for index, row in df.iterrows():
    amount = convert_to_number(str(row['单件金额']))
    quantity = dict1[row['件数']]
    overall_total += amount * quantity

print(overall_total)

3. [DNUICTF 2021] 你喜欢压缩包吗

压缩包套娃,每次的解压密码都和里面的压缩包名字相同。

import zipfile
import os

def extract_zip(file_path, password):
    with zipfile.ZipFile(file_path) as zfile:
        zfile.extractall(members=zfile.namelist(), pwd=password.encode('utf-8'))

def get_next_zip(file_path):
    names = os.listdir()
    for name in names:
        if name.endswith('.zip') and name != file_path:
            return name
    return None

def main():
    now = "zip.zip"

    while True:
        print("START " + now)
        zfile = zipfile.ZipFile(now)
        password = zfile.namelist()[0].split('.')[0]
        extract_zip(now, password)
        zfile.close()

        try:
            os.remove(now)
        except OSError as e:
            print(e)

        next_zip = get_next_zip(now)
        if next_zip:
            now = next_zip
        else:
            break

        print('END ' + now)

if __name__ == "__main__":
    main()

最后得到233333.zip,六位纯数字密码,APR爆破得到sqlite数据库文件,搜索flag字段得到flag。

4. [TQLCTF 2022] Ranma½

拖到CyberChef里

4

末尾得到 HTTPZB{QFOLP6_KRZ1Q} 看出来是换位密码。都试一遍,发现是维吉尼亚爆破,得到flag。

TQLCTF{CODIN6_WOR1D}