GXYCTF2019:gakki

把题目给的附件解压后给了张图片,顺带着瞟一眼属性,没有值得注意的

binwalk检测一手,看见有个rar压缩包

提取出来的压缩包是有密码的,但是题目并没有给出获取密码的途径,所以先爆破试试,用最常用的四位数爆破

果然是四位数密码的爆破,flag.txt里面是一大串的乱码

用python脚本进行字频统计

复制代码
import collections

def count_characters(filename):
    with open(filename, 'r', encoding='utf-8') as file:
        content = file.read()
        counter = collections.Counter(content)
        return counter

def print_sorted_counts(counter):
    for char, count in counter.most_common():
        print(f"'{char}': {count}")

def main():
    filename = input("请输入文本文件的路径:")
    try:
        char_counts = count_characters(filename)
        print_sorted_counts(char_counts)
    except FileNotFoundError:
        print("文件未找到,请检查路径是否正确。")
    except Exception as e:
        print(f"发生错误:{e}")

if __name__ == "__main__":
    main()

flag:flag{gaki_IsMyw1fe}

相关推荐
Flittly14 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(3)TodoWrite (待办写入)
python·agent
千寻girling18 小时前
一份不可多得的 《 Django 》 零基础入门教程
后端·python·面试
databook1 天前
探索视觉的边界:用 Manim 重现有趣的知觉错觉
python·动效
明月_清风1 天前
Python 性能微观世界:列表推导式 vs for 循环
后端·python
明月_清风1 天前
Python 性能翻身仗:从 O(n) 到 O(1) 的工程实践
后端·python
齐生12 天前
iOS 知识点 - 渲染机制、动画、卡顿小集合
笔记
helloweilei2 天前
python 抽象基类
python
用户962377954482 天前
VulnHub DC-3 靶机渗透测试笔记
安全
用户8356290780512 天前
Python 实现 PPT 转 HTML
后端·python
zone77392 天前
004:RAG 入门-LangChain读取PDF
后端·python·面试