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

» BitCoin Wallet stealor New
Sun Feb 19, 2017 7:52 pm by jammieban

» The Omega Organisation is looking for members
Sun Feb 19, 2017 5:50 pm by TheOmegaOrg

» Hack any Facebook Account for Free
Thu Feb 16, 2017 2:25 pm by Admin

» Teen Patti Gold Hack & 3 Patti Chips Code Extra Bonus 2016
Sun Feb 12, 2017 12:13 pm by Shan Soomro 51

» Hallmarks of Scientific Research
Fri Feb 10, 2017 4:04 pm by Nomi gee

» Hotspot Shield Elite VPN [Latest]
Sun Jan 29, 2017 11:52 am by Admin

» CCleaner Professional Plus [Latest]
Sun Jan 29, 2017 9:32 am by harry756

» SQL Dumper v.8.0
Fri Jan 13, 2017 10:18 pm by imsopickled

» Infographic Resume/CV Pack
Fri Jan 06, 2017 2:55 pm by Admin

February 2017

MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728     

Calendar Calendar

Affiliates


free forum

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

Visitors Counter


Flag Counter


MD5 hash cracker

Share

Admin
Admin

Posts : 472
Reputation : 7
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 Fri Feb 24, 2017 4:51 am