【CTF】压缩包解密-CRC碰撞

烟灰

当压缩包中看到文件大小很小,如4,代表有4个字符(例如:qbcd),可以通过CRC碰撞,获取到文件中的字符串内容
image
python2脚本:

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import datetime
import binascii
 

def crack(crc_in):
    crcs = set([crc_in])
    
    r = 'abcdefghijklmnopqrstuvwxyz_'  #压缩字符串
    for a in r:
        for b in r:
            for c in r:
                for d in r:
                    txt = a+b+c+d
                    crc = binascii.crc32(txt)
                    if (crc & 0xFFFFFFFF) in crcs:
                        return txt

if __name__ == "__main__": 
    s=[0x6083A1C8, 0xCE70D424,0xC3F17511,0x526FD582,0x30E25038,0xAA3E6AEA]
    password=''
    for x in s:
        passw = crack(x)
        password+=str(passw)
        print password
阅读 3.2k

工作是为了自由?

1 声望
0 粉丝
0 条评论

工作是为了自由?

1 声望
0 粉丝
文章目录
宣传栏