202509_NBWS_encoded_csv

Tags:CSV,Base64,python

0x00. 题目

对附件文件中编码数据进行解码

附件路径:https://pan.baidu.com/s/1GyH7kitkMYywGC9YJeQLJA?pwd=Zmxh#list/path=/CTF附件

附件名称:202509_NBWS_ds-encodedata.zip

0x01. WP

1. 文件内容分析

数据文件为csv文件,本质还是文本文件,使用python库逐个解码

2. exp.py

import csv
import base64

with open('encodedata.csv', 'r', encoding='utf-8', newline='') as f:
    reader = csv.reader(f)
    headers = next(reader)
    data = []
    for row in reader:
        newrow=[]
        for cell in row:
            newrow.append(base64.b64decode(cell.encode()).decode())
        data.append(newrow)

with open('decodedata.csv', 'w', encoding='utf-8', newline='') as f:
    writer = csv.writer(f)
    writer.writerow(headers)
    writer.writerows(data)

图片

posted @ 2025-09-20 20:09  JasonJHu  阅读(21)  评论(0)    收藏  举报