if data.find('!mdcrack') != -1:
nick = data.split('!')[ 0 ].replace(':','')
m = hashlib.md5()
hash = ""
hash_file = str(arg[4])
wordlist = arg[5]
try:
wordlistfile = open(wordlist,"r")
except IOError:
sck.send('PRIVMSG ' + chan + " :" 'invalid file' + '\r\n')
else:
pass
for line in wordlistfile:
m = hashlib.md5()
line = line.replace("\n","")
m.update(line)
word_hash = m.hexdigest()
if word_hash==hash_file:
sck.send('PRIVMSG ' + chan + " :" 'Collision! The word corresponding to the given hash is ' + line + '\r\n')
sck.send('PRIVMSG ' + chan + " :" 'The hash given does not correspond to any supplied word in the wordlist' + '\r\n')
该代码通过对单词列表中的每一行进行散列处理,然后将其与指定的散列进行比较来发挥作用。
我没有收到任何错误,但是当它找到一个哈希时,它会打印出Collision!
消息和The hash given does not correspond to any supplied word in the wordlist
消息,起初我虽然这是一个身份问题,但现在我一无所知。