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}

相关推荐
nimadan129 小时前
**AI漫剧软件2025推荐,解锁高性价比创意制作新体验**
人工智能·python
雾岛听蓝10 小时前
C++11新特性(lambda、包装器)
c++·经验分享·笔记
TG_yunshuguoji11 小时前
亚马逊云代理商:AWS 国际站缺卡新用户创建邮箱怎么选择?
安全·云计算·aws
yunhuibin11 小时前
GoogLeNet学习
人工智能·python·深度学习·神经网络·学习
易辰君12 小时前
【Python爬虫实战】正则:中文匹配与贪婪非贪婪模式详解
开发语言·爬虫·python
秀儿还能再秀12 小时前
正则表达式核心语法 + Python的 re 库中常用方法
python·正则表达式
xcLeigh12 小时前
Python入门:Python3 正则表达式全面学习教程
python·学习·正则表达式·教程·python3
代码游侠12 小时前
Linux驱动复习——驱动
linux·运维·arm开发·笔记·学习
多恩Stone13 小时前
【C++ debug】在 VS Code 中无 Attach 调试 Python 调用的 C++ 扩展
开发语言·c++·python
枷锁—sha13 小时前
【CTFshow-pwn系列】03_栈溢出【pwn 053】详解:逐字节爆破!手写 Canary 的终极破解
网络·笔记·安全·网络安全