www.i4info.org

i4info Provides the best hacking Material. Latest hacking tutorials and tools are available here. It is the best place for hackers.

Latest topics

December 2016

MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar

Affiliates


free forum

Forumotion on Facebook Forumotion on Twitter Forumotion on YouTubeForumotion on Google+

Visitors Counter


Flag Counter

About Author

Muhammad Shahroze Rashid
i4info
Web Developer
Web Developer & Designer,Researcher and Technical writer. An Information Security Consultant and System Auditor, a keen Security researcher.
samanabad
lahore, Punjab
54000
Pakistan
[email protected]
03064904829
DOB: 05/25/1992
Muhammad Shahroze Rashid
Muhammad Shahroze Rashid is a Web Developer and Designer, Android Developer, InfoGrapher, IT consultant and Researcher
Reviewed by Google
Google
Date published: 01/19/2016
9 / 10 stars
Muhammad Shahroze Rashid
Muhammad Shahroze Rashid Web Developer & Designer,Researcher and Technical writer. An Information Security Consultant and System Audito
samanabad
lahore
Punjab
54000
Pakistan

MD5 hash cracker

Share

Admin
Admin

Posts : 451
Reputation : 5
Join date : 2014-12-10
Age : 24
Location : Pakistan

MD5 hash cracker

Post by Admin on Wed Mar 04, 2015 2:10 pm

PyCrack MD5 Hash Cracker


PyCrack
================================
A python MD5 hash cracker that uses permutations.

INFORMATION

PyCrack will brute force an MD5 hash string, by generating a set of permutations.
Basically, it will generate every possible string using the characters a-z, A-Z,
and 0-9. It will start off as 1 character, until it has checked every possible
permutation, and then the length will increase by 1, every time it, until it hits
a maximum of a 25.
Brute forcing takes a very long time, depending on the legnth of the string that
was hashed, or if it is salted, but if this is kept running long enough, it will
crack any alphanumeric hash up to 25 characters in length.



USAGE

This is a command line tool, so it takes arguments to run.


SOURCE CODE

Python 2.7.5
CODE:

# PyCrack MD5 Hash Cracker
# Version 1.0.0
# Coded in Python 2.7.5


#IMPORTS
import hashlib
import os
import sys
import datetime

#GLOBAL
startTime = datetime.datetime.now()

#DEBUG MESSAGES
def action(msg) : print '[#] - ' + msg
def alert(msg) : print '[+] - ' + msg
def error(msg) : print '[!] - ' + msg
def errorExit(msg) : raise SystemExit('[!] - ' + msg)

#MD5 STRING
def md5(string): return hashlib.md5(string).hexdigest()

#PERMUTATION BUILDER
def xpermutation(characters, size):
if size == 0:
yield []
else:
for x in xrange(len(characters)):
for y in xpermutation(characters[Mad] + characters[x:], size - 1):
yield [characters[x]] + y

#BRUTE FORCE
def bruteForce(hash):
attempt = 0
characters = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
maxLength = xrange(0,25)
stringBuilder = ''
for length in maxLength:
for x in xpermutation(characters, length):
permutation = stringBuilder + ''.join(x)
attempt = attempt + 1
if md5(permutation) == hash:
end_time = str(datetime.datetime.now() - startTime).split('.')[0]
print '[' + str(attempt) + '] - ' + permutation + ' - CRACKED! Took ' + end_time
raw_input('\nPress the <ENTER> key to EXIT...')
sys.exit()
else:
print '[' + str(attempt) + '] - ' + permutation
errorExit('Failed to brute force hash.')

#START
if os.name == 'nt' : os.system('cls')
else : os.system('clear')
print ''.rjust(56, '#')
print '#' + ''.center(54) + '#'
print '# PyCrack MD5 Hash Cracker'.ljust(55) + '#'
print '# Version 1.0.0'.ljust(55) + '#'
print '# Coded by InvisibleMan in Python 2.7.5'.ljust(55) + '#'
print '# Download : [You must be registered and logged in to see this link.] + '#'
print '#' + ''.center(54) + '#'
print ''.rjust(56, '#')
if sys.version_info.major != 2 or sys.version_info.minor != 7:
errorExit('Requires Python version 2.7')
if len(sys.argv) == 2:
if len(sys.argv[1]) == 32 and sys.argv[1].isalnum():
bruteForce(sys.argv[1])
else:
error('Invalid MD5 hash!')
errorExit('Usage : crack.py [HASH]')
else:
error('Missing command line arguments.')
errorExit('Usage : pycrack.py [HASH]')


Python 3.3.2




# PyCrack MD5 Hash Cracker
# Version 1.0.0
# Coded in Python 3.3.2


#IMPORTS
import hashlib
import os
import sys
import datetime

#GLOBAL
startTime = datetime.datetime.now()

#DEBUG MESSAGES
def action(msg) : print('[#] - ' + msg)
def alert(msg) : print('[+] - ' + msg)
def error(msg) : print('[!] - ' + msg)
def errorExit(msg) : raise SystemExit('[!] - ' + msg)

#MD5 STRING
def md5(string): return hashlib.md5(string.encode('utf-8')).hexdigest()

#PERMUTATION BUILDER
def xpermutation(characters, size):
if size == 0:
yield []
else:
for x in range(len(characters)):
for y in xpermutation(characters[Mad] + characters[x:], size - 1):
yield [characters[x]] + y

#BRUTE FORCE
def bruteForce(hash):
attempt = 0
characters = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
maxLength = range(0,25)
stringBuilder = ''
for length in maxLength:
for x in xpermutation(characters, length):
permutation = stringBuilder + ''.join(x)
attempt = attempt + 1
if md5(permutation) == hash:
end_time = str(datetime.datetime.now() - startTime).split('.')[0]
print('[' + str(attempt) + '] - ' + permutation + ' - CRACKED! Took ' + end_time)
input('\nPress the <ENTER> key to EXIT...')
sys.exit()
else:
print('[' + str(attempt) + '] - ' + permutation)
errorExit('Failed to brute force hash.')

#START
if os.name == 'nt' : os.system('cls')
else : os.system('clear')
print ''.rjust(56, '#')
print '#' + ''.center(54) + '#'
print '# PyCrack MD5 Hash Cracker'.ljust(55) + '#'
print '# Version 1.0.0'.ljust(55) + '#'
print '# Coded by InvisibleMan in Python 3.3.2'.ljust(55) + '#'
print '# Download : [You must be registered and logged in to see this link.] + '#'
print '#' + ''.center(54) + '#'
print ''.rjust(56, '#')
if sys.version_info.major != 3 or sys.version_info.minor != 3:
errorExit('Requires Python version 3.3')
if len(sys.argv) == 2:
if len(sys.argv[1]) == 32 and sys.argv[1].isalnum():
bruteForce(sys.argv[1])
else:
error('Invalid MD5 hash!')
errorExit('Usage : pycrack.py [HASH]')
else:
error('Missing command line arguments.')
errorExit('Usage : pycrack.py [HASH]')






 

    Current date/time is Tue Dec 06, 2016 6:55 pm