溯惘逐忆
- UID
- 5006
- 主题
- 帖子
- 经验
- 点
- 棉棒
- 根
- 人气
- 点
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
暴力破解:
- import zipfile, zlib
- from itertools import product
- encodings = ['utf-8', 'shiftjis','gbk']
- watashi = ['私','わたし','ワタシ']
- ha = ['は','ハ','わ','ワ']
- doushiyou = ['どうしよう','ドウシヨウ','如何しよう','如何シヨウ']
- mo = ['も','モ']
- nai = ['ない','無い','ナイ']
- egomazo = ['エゴマゾ','えごまぞ']
- desu = ['です','デス']
- zfile = zipfile.ZipFile('test.zip')
- afile = zfile.namelist()[0]
- print(afile)
- def main():
- for encoding in encodings:
- pwd_iter = product(watashi,ha,doushiyou,mo,nai,egomazo,desu)
- for each in pwd_iter:
- pwd = ''.join(each)
- print(pwd)
- try:
- zfile.extractall(pwd=pwd.encode(encoding=encoding))
- except (RuntimeError,zlib.error):
- continue
- else:
- print('found: {%s}(%s)'%(pwd,encoding))
- with open('pwd.txt','wb') as f:
- f.write(pwd.encode(encoding=encoding))
- return
- main()
复制代码 |
|