ACTF新生赛2020:NTFS数据流

查看几个压缩包,发现内容都是一致的,猜测应该flag就藏在这些文本文件中,来个脚本筛选出一个文件夹中文本内容不同的文本文件

复制代码
import os
import filecmp

def find_different_files(directory):
 
    files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f)) and f.endswith('.txt')]
    if len(files) < 2:
        print("需要至少两个文件进行比较。")
        return []

    files = [os.path.join(directory, f) for f in files]
    
    different_files = []
    
    first_file = files.pop(0)
 
    for file in files:
        if not filecmp.cmp(first_file, file, shallow=False):
            different_files.append(file)

    return different_files
directory = 'flag'
different_files = find_different_files(directory)
if different_files:
    print("找到以下不同的文件:")
    for file in different_files:
        print(os.path.relpath(file, directory))
else:
    print("所有文件内容都相同。")

293.txt_flag.txt打开就是flag

相关推荐
鲁邦通物联网3 小时前
AGV多控制器通信适配实操:IP规划、配置模板与出厂验证
网络·4g工业路由器·工业路由器·4g路由器·工业级路由器·5g工业路由器·出海联网
鲁邦通物联网3 小时前
DNV新造船海事网关安全通信架构与系列船验证方法
运维·安全·海事网关·船用网关·海事网络安全·智慧航运·船用路由器
BK贝壳8 小时前
bool-hybrid-array 的 GPU_opt 与 cjx:一个没显卡就报错的开关,一个把 800 字压到 96 字节的编码
python
橘色的喵12 小时前
zmq Linux 内核与系统调优(ARM64 嵌入式平台)
linux·网络·性能优化·zmq·内核优化
BD_Marathon12 小时前
安装Jupyter notebook
ide·python·jupyter
云半S一12 小时前
Agent学习总结补充:2
人工智能·经验分享·笔记·agent·学习分享
Zlzxzw12 小时前
End-to-End Autonomous Generation of Human Assembly Plans
python
Wellijohn13 小时前
2000 个请求、30% 失败率:我把 Python 批量并发的限流和重试参数算了一遍
后端·python·性能优化
小飞在努力14 小时前
【实现负载均匀在线判题③】从零散模块到统一,编译运行全链路封装
c语言·开发语言·c++·笔记
Logintern0915 小时前
deep agents 多智能体模式——规划与委派
python·langchain