我试图对具有此结构的密码执行字典攻击:
可能的密码示例:
creek8937basket
arrow3156hardly
eager4109eleven
我可以成功地使用像can这样的程序来生成一个包含5个小写字母、4个数字和6个小写字母的密码列表,但是我想在第一部分和最后一部分中使用单词。
crunch 15 15 -d 2% -d 2@ -t @@@@@%%%%@@@@@@ | aircrack-ng -e ESSID -w - Desktop/wpa2.cap
我如何创建一个字典,以便它使用5个字母和6个字母的英文单词的第一部分和最后一部分的密码。
我知道这方面有两本字典,但我需要找出如何实现它们:
发布于 2017-01-27 01:34:39
这并不完全是你想要的,但它是它的近似值。它将从5个字母列表和6个字母单词列表中随机抽取一个单词,并在单词之间输出所有可能的4位数字组合,并打印到一个文件中,以备进一步使用。
您可以随心所欲地重复多次,并将所有这些文件保存为字典,如果愿意,甚至可以合并它们。此外,这将节省您的计算机从窒息本身死亡,无论是空间和性能方面。
import sys
orig_stdout = sys.stdout
f = file('pass_list', 'w') # Specify the name and path of the output file.
sys.stdout = f
import itertools
from itertools import product
import random
digits = '0123456789' # Set the digits.
prefix = open('5-letter.txt').read().split() # Specifiy the path to 5 letter word list.
first = random.choice(prefix)
suffix = open('6-letter.txt').read().split() # Specifiy the path to 6 letter word list.
last = random.choice(suffix)
for keygen in itertools.product(digits, repeat=4): # Specify the length of the digit combinations.
print (first+ ''.join(keygen)+last)
sys.stdout = orig_stdout
f.close()
注意:两个输入.txt文件都需要每行有一个单词才能正常工作。
编辑:我想补充的是,如果你想要的话,你可以打印出一个更大的文件,但是你知道,虽然机会很小,但是这个前缀和后缀词会在输出文件中重复出现。下面是如何修改代码的方法。
prefix = open('5-letter.txt').read().split()
a = random.choice(prefix)
b = random.choice(prefix)
c = random.choice(prefix)
suffix = open('6-letter.txt').read().split()
x = random.choice(suffix)
y = random.choice(suffix)
z = random.choice(suffix)
for keygen in itertools.product(digits, repeat=4):
print (a+ '' .join(keygen)+x)
for keygen in itertools.product(digits, repeat=4):
print (b+ '' .join(keygen)+y)
for keygen in itertools.product(digits, repeat=4):
print (c+ '' .join(keygen)+z)
不太漂亮,但它完成了任务。然而,如上所述,重复的可能性随着重复而增加。文件越大,手工编辑就越烦人。
https://security.stackexchange.com/questions/149516
复制相似问题