附件下载下来为压缩包,需要密码,查看该压缩包的内容
此处发现里面四个txt文件均已被加密,但是每个txt的内容都只有四个字节,符合crc32爆破条件,直接上脚本:
import binascii import stringdef crack_crc(): print('-------------Start Crack CRC-------------') crc_list = [0x67b2d3df, 0x628abed2, 0x6b073427, 0x08c8da10]#文件的CRC32值列表,注意顺序 comment = '' chars = string.printable for crc_value in crc_list: for char1 in chars: for char2 in chars: for char3 in chars: for char4 in chars: res_char = char1 + char2 + char3 + char4#获取遍历的任意4Byte字符 char_crc = binascii.crc32(res_char.encode())#获取遍历字符的CRC32值 calc_crc = char_crc & 0xffffffff#将遍历的字符的CRC32值与0xffffffff进行与运算 if calc_crc == crc_value:#将获取字符的CRC32值与每个文件的CRC32值进行匹配 print('[+] {}: {}'.format(hex(crc_value),res_char)) comment += res_char print('-----------CRC Crack Completed-----------') print('Result: {}'.format(comment))
if __name__ == '__main__': crack_crc() 结果如下: moectf{qwq_crc!} 标签:__,crc,--,res,chars,MISC,char,CRC32,crc32 From: https://www.cnblogs.com/GGbomb/p/17794179.html