Ali_Eagle
12-08-2009, 11:50 PM
یک کد به زبان python برای کراک کردن md5 ها که از یک wordlist استفاده می کنه که لینکشو می زارم واستون به صورت rar شده حجمش 72 mb است و به صورت عادی 28 Gb است !!!
worddlist link :
http://rapidshare.com/files/131701801/28GBwordlist.Patlat.NET.rar
code :
#!/usr/bin/env python
################################################## ###########################
# md5word.py #
# #
# MD5: 428E1B0BBE3A6D6B0E869D6D5124DEC5 #
# #
# Encrypts each word in a wordlist to md5 hash and tryes to match it with #
# a given md5 hash. #
# #
# Copyright (C) 2009 RuSH4ck3R #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
################################################## ###########################
import sys
from hashlib import md5
m = md5()
class MD5_Crack :
def Check(self) :
# check arguments
if len(sys.argv) != 3 :
print '\nUsage: md5word.py <hash> <wordlist>'
sys.exit()
else :
# check hash
try :
print '\nChecking hash file...'
HASH = open(sys.argv[1], 'r')
HASH = HASH.readline()
print 'Hash: %s' % (HASH)
HASH = HASH.replace('\n', '')
except :
print '\nError: couldn\'t read hash file'
sys.exit()
# check wordlist
try :
print '\nChecking wordlist file...'
WORDS = open(sys.argv[2], 'r').readlines()
print 'Words: %s' % (len(WORDS))
except :
print '\nError: couldn\'t read wordlist file'
sys.exit()
# starting cracking if all is good
self.Crack(HASH, WORDS)
def Crack(self, hash, words) :
try :
print '\nCracking...'
for checkword in words :
m = md5() # clear buffer
checkword = checkword.replace('\n', '')
m.update(checkword)
hashed_checkword = m.hexdigest()
# checking for match
if hashed_checkword == hash :
print '\nFound match: %s ' % (checkword)
sys.exit()
print '\nNo match found, use different wordlist: exiting'
except KeyboardInterrupt :
print '\nCracking cancelled: exiting'
except :
'\nUknown error: exiting'
if __name__ == '__main__' :
MD5_Crack().Check()
worddlist link :
http://rapidshare.com/files/131701801/28GBwordlist.Patlat.NET.rar
code :
#!/usr/bin/env python
################################################## ###########################
# md5word.py #
# #
# MD5: 428E1B0BBE3A6D6B0E869D6D5124DEC5 #
# #
# Encrypts each word in a wordlist to md5 hash and tryes to match it with #
# a given md5 hash. #
# #
# Copyright (C) 2009 RuSH4ck3R #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
################################################## ###########################
import sys
from hashlib import md5
m = md5()
class MD5_Crack :
def Check(self) :
# check arguments
if len(sys.argv) != 3 :
print '\nUsage: md5word.py <hash> <wordlist>'
sys.exit()
else :
# check hash
try :
print '\nChecking hash file...'
HASH = open(sys.argv[1], 'r')
HASH = HASH.readline()
print 'Hash: %s' % (HASH)
HASH = HASH.replace('\n', '')
except :
print '\nError: couldn\'t read hash file'
sys.exit()
# check wordlist
try :
print '\nChecking wordlist file...'
WORDS = open(sys.argv[2], 'r').readlines()
print 'Words: %s' % (len(WORDS))
except :
print '\nError: couldn\'t read wordlist file'
sys.exit()
# starting cracking if all is good
self.Crack(HASH, WORDS)
def Crack(self, hash, words) :
try :
print '\nCracking...'
for checkword in words :
m = md5() # clear buffer
checkword = checkword.replace('\n', '')
m.update(checkword)
hashed_checkword = m.hexdigest()
# checking for match
if hashed_checkword == hash :
print '\nFound match: %s ' % (checkword)
sys.exit()
print '\nNo match found, use different wordlist: exiting'
except KeyboardInterrupt :
print '\nCracking cancelled: exiting'
except :
'\nUknown error: exiting'
if __name__ == '__main__' :
MD5_Crack().Check()
