压缩包密码破解示例分享(类似典破解)

再看那柔弱的柳树吧,在寒冬余威尚盛时节,就早早苏醒过来,望着冰冻的河面,迎着凛冽的寒风,它微微察觉出一丝春意,于是,不顾一切地率先吐翠,淡淡地披起娇黄嫩绿的新装。沿河望去,枝梢间烟纱雾彀,一片生机,这情景仿佛一首动人的歌,一首热烈向往春天的歌,一首报告春的信息的歌,一首表达美好信念的歌。我在想:既然迎春花被人称作报春花,那么,柳树可不可以叫作报春树呢春来了,万千柳枝在春风中袅袅舞动。柳树是热爱春天的,春天也是热爱柳树的。

昨天翻硬盘,找到一个好东西,可惜自己加了密码自己不记得了。试了几个常用的没试出来,于是写了这么个小脚本来替我尝试。。呵呵,还真给解出来了。
python脚本内容如下,跑跑自己加密的压缩包还不错


# -*- coding: utf-8 -*-import sys,osdef IsElementUniq(list):
"""
判断list中的元素是否为唯一的
"""
for word in list:
if list.count(word)>1:
return False return Truedef GenPswList():
"""
要求用户输入词,并根据单词组合密码,只尝试四个单词来组合,并限制密码长度为20。写的比较挫
"""
psw=raw_input('input a word>')
wordlist = []
while psw:
wordlist.append(psw)
psw=raw_input('input a word>')
print wordlist global g_pswlist
g_pswlist = []
for word in wordlist:
g_pswlist.append(word) for word1 in wordlist:
for word2 in wordlist:
locallist = [word1, word2]
if IsElementUniq(locallist):
tmp = word1 + word2
if len(tmp) < 20:
g_pswlist.append(tmp) for word1 in wordlist:
for word2 in wordlist:
for word3 in wordlist:
locallist = [word1, word2, word3]
if IsElementUniq(locallist):
tmp = word1 + word2 + word3
if len(tmp) < 20:
g_pswlist.append(tmp) for word1 in wordlist:
for word2 in wordlist:
for word3 in wordlist:
for word4 in wordlist:
locallist = [word1, word2, word3, word4]
if IsElementUniq(locallist):
tmp = word1 + word2 + word3 + word4
if len(tmp) < 20:
g_pswlist.append(tmp) print 'gen psw is:', g_pswlistdef TestUnZipPack(filename):
"""
尝试用密码来解压压缩包
""" command = ""
for psw in g_pswlist:
command = "7z e -p%s -y %s" %(psw,filename)
print command
ret = os.system(command)
if ret == 0:
print 'right psw is ', psw
breakdef main(filename):
GenPswList()
TestUnZipPack(filename)if __name__ == '__main__':
if len(sys.argv) != 2:
print 'argv error'
print 'example:test_7z_psw.py 1.7z'
sys.exit(1) main(sys.argv[1])

以上就是压缩包密码破解示例分享(类似典破解)。人活着是一种心情,穷也好,富也好,得也好,失也好,一切都是过眼云烟,只要心情好,一切都好。更多关于压缩包密码破解示例分享(类似典破解)请关注haodaima.com其它相关文章!

您可能有感兴趣的文章
详解python解压压缩包的五种方法

python中将zip压缩包转为gz.tar的方法