MISC刷题8

starme / 2024-10-20 / 原文

[SDCTF 2022]Flag Trafficker

题目描述:

We’ve sniffed the traffic of somebody suspected to be looking up flags online! Unfortunately, just searching for the flag format in their traffic doesn’t appear to be working…can you find the leaked flag?

下载附件得到001.pcapng

直接ctrl+F搜索:

image-20240622012215562

然后控制台运行这段JSFUCK代码即可

[鹤城杯 2021]A_MISC

下载得到附件task_flag.zip,但是有密码

尝试zip伪加密--失败

那就爆破:

image-20240622102316665

能正常爆破的话都会在这里显示的

image-20240622102419974

qwer

解压缩后得到文件:

image-20240622102524140

发现可能未完全显示

爆破宽高:

image-20240622102610692

image-20240622102624542

下载得到file.pcap文件

image-20240622102919925

看样子像是时间盲注

image-20240622103416652

现在需要将所有的查询流量解析为纯文本,然后用正则匹配匹配出对应字符的ascii,然后再转换为对应字符即可

使用tshark命令,将有用的payload提取出来

tshark -r file.pcap -Y "http.request" -T fields -e "urlencoded-form.value"  > data.txt

提取出每次变化前的最后一个字符,组成的字符串就会含有flag,提取脚本:

with open('data.txt', 'r', encoding='UTF-8') as f:
    data = f.read().strip().split('\n')

# 初始化flag列表,假设flag的长度是50
flag = [0] * 50  # 使用列表推导式初始化列表

for i in data:
    # 确保i的长度足够,避免索引越界
    if len(i) > 73:
        start_index = 73
        end_index_comma = i.find(',', start_index)
        # 确保找到了',',并且没有越界
        if end_index_comma != -1 and end_index_comma < len(i):
            index_str = i[start_index:end_index_comma]
            # 确保截取的字符串是有效的数字
            if index_str.isdigit():
                index = int(index_str)
                # 确保index在flag列表的范围内
                if 0 <= index < len(flag):
                    start_index_equal = i.find('=')
                    end_index_sleep = i.find(',sleep')
                    if start_index_equal != -1 and end_index_sleep != -1 and start_index_equal < end_index_sleep:
                        value_str = i[start_index_equal + 1:end_index_sleep]
                        if value_str.isdigit():
                            flag[index] = int(value_str)

# 将flag列表转换为字节串并解码
print(bytes(flag).decode('utf-8'))

[HNCTF 2022 Week1]三生三世

下载得到三生三世.zip

爆破:

image-20240622110902597

一般直接爆破的话密码不会有大写字母

得到一个base64编码的文本

使用010,将base64转为文件:

image-20240622111237474

也可以直接放浏览器地址栏

QR Research

image-20240622111355829

nc{lmTnc}stWceostsfeo__sf

特征是有

发现是n型栅栏密码:https://www.qqxiuzi.cn/bianma/zhalanmima.php

image-20240622112705545

image-20240703155550390

[HNCTF 2022 Week1]silly_zip

下载得到silly_zip.zip,有密码

先判断是否有zip伪加密:

image-20240622113354083

在fix_silly_zip目录下得到flag.bmp

但感觉显示不全

爆破宽高:

image-20240622113511096

image-20240622113524470

NSSCTF{bmp_3ndian}

[HNCTF 2022 Week1]piz.galf

题目名字提示逆序

拖入010,发现KP,即PK(zip压缩包)的逆序

image-20240622113831781

逆回去就行了

image-20240622113718436

image-20240622113950632

将得到的reverse_1_piz.galf改为reverse_1_piz.zip

然后解压,得到pmb.galf

提示bmp文件逆序,拖入010中也可看出:

image-20240622114100264

像上面步骤类似

最终得到:

image-20240622114214781

NSSCTF{d1r0w_0ll3h}