压缩文件处理
伪加密
zip : 50 4B 01 02 开始第九、十字节,将其修改为00 00,若成功解压表示为伪加密,如果解压错误则说明为真加密,50 为第一位
00 表示文件未加密
暴力破解可使用ziperello
软件
RAR: 十六进制编辑器打开文件,从开头第一个字节开始数52 61 72 21,找到第24个字节,字节尾数为4表示加密,为0表示无加密,将其改为0若可成功解压,则为伪加密
暴力破解参照CTF 压缩包分析
压缩包损坏
RAR:
比如少一个文件
HEAD_CRC 2字节 所有块或快部分的CRC
HEAD_TYPE 1字节 块类型
HEAD_FLAGS 1字节 块标记
HEAD_SIZE 2字节 块大小
ADD_SIZE 4字节 可选结果-增加块大小
----------------
文件块的第三个字节为块类型(头类型)
头类型是0x72 表示标记快
头类型是0x73 表示压缩文件头块
头类型是0x74 #表示文件头块
头类型是0x75 表示注释头
......
做法:将缺少的文件的文件头第三个字节改为74,缺少文件的文件头位置可根据已知文件的推出